function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Austin VillanuevaAustin Villanueva 

Open CTI call log visible to all or a group of user NEED HELP ASAP

Hi everyone. In our company we are currently implementing the opencti for our customers.
So one of the feature that we want is to create a call log while or after the call is finish. 
I saw that I can use the 
sforce.opencti.screenPop({
                            type: sforce.opencti.SCREENPOP_TYPE.NEW_RECORD_MODAL, 
                            params: { entityName: 'Task'}
}); 

because I read something that a call log is the same as task but unfortunately this is not shareable. 
Only the one user can see the this call log that is not our customer wants. Is there any other way around that can solve this?
I tried to create a public group and assign the task but it's not working only contacts and lead can be assign or relate to the task.
Is there any open cti function that I can use regarding this issue? because this is a sample scenario we want. 
For example, there are list of phone numbers that the agents need to call, if the other agents already called this number there's no need to call
that number. and so agents need to know about it by having a call log that is visible to all assigned users in a open cti call center.

I hope you can help me about this. Thank you.

Austin
prasanth sfdcprasanth sfdc
Hi Austin, 

      Please help me to solve this for me.  I have installed SFDC open cti adapter but, I am not able to find where to pass the API links data and how to pass which has been given from my client. (one is freepbx  another one is Mcube). Salesforce documentation is saying that, we need to uncomment the TWILO code after installing the Twillio package in SFDC org.  But Twilio is paid one and client doesn't want to pay for TWILIO. Could you guide me any documentation or code for doing CTI with SFDC OPEN CTI ADAPTER. 


In the below class "SoftphoneProviderHelper" sfdc documents saying that remove the comments after installing the TWILIO package.

Or do we need to modify the TWILIO package for CTI with our credentails ? 

Please help me to solve this.  
 
/*
Copyright 2016 salesforce.com, inc. All rights reserved.

Use of this software is subject to the salesforce.com Developerforce Terms of Use and other applicable terms that salesforce.com may make available, as may be amended from time to time. You may not decompile, reverse engineer, disassemble, attempt to derive the source code of, decrypt, modify, or create derivative works of this software, updates thereto, or any part thereof. You may not use the software to engage in any development activity that infringes the rights of a third party, including that which interferes with, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of salesforce.com or any third party.

WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL SALESFORCE.COM HAVE ANY LIABILITY FOR ANY DAMAGES, INCLUDING BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND, WHETHER IN CONTRACT, TORT OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/

public class SoftphoneProviderHelper {
  public class ProviderFactory
    {
        public ProviderFactory(){}
        public SoftphoneProviderHelper.SoftphoneProvider newProvider(String className)
        {
            Type providerImpl = Type.forName(className);
            if (providerImpl == null){
                return null;
            }
            return (SoftphoneProviderHelper.SoftphoneProvider) providerImpl.newInstance();
        }
    }

    public class CallResult {
        public String status;
        public String toNumber;
        public String fromNumber;
        public String accoundId;
        public String provider;
        public String error;
        public String duration;
        public DateTime startTime;
    }

    public interface SoftphoneProvider {
      CallResult makeCall(String account, String token, String toNumber, String fromNumber);
    }

    /*
     * Example of a call provider, using the Twilio Helper Package
     */
    public class TwilioProvider implements SoftphoneProvider {
      public CallResult makeCall(String account, String token, String toNumber, String fromNumber) {
          /* uncomment this code once you installed the Twilio Helper Package in your org
           * more info here: https://www.twilio.com/docs/libraries/salesforce#installation


          TwilioRestClient client = new TwilioRestClient(account, token);

          Map<String,String> params = new Map<String,String> {
                  'To'   => toNumber,
                  'From' => fromNumber,
                  'Url' => 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient'
              };
          TwilioCall call = client.getAccount().getCalls().create(params);
          CallResult result = new CallResult();
          result.status = call.getStatus();
          return result;

          */
          CallResult result = new CallResult();
          result.status = 'TWILIO_IS_NOT_INSTALLED';
          return result;
        }
    }

    public class DummyProvider implements SoftphoneProvider {
      public CallResult makeCall(String account, String token, String toNumber, String fromNumber) {
            CallResult result = new CallResult();
            result.status = 'DUMMY_RESPONSE_OK';
            result.toNumber = toNumber;
            result.fromNumber = fromNumber;
            result.accoundId = account;
            result.provider = 'DUMMY_PROVIDER';
            result.duration = '10sec';
            result.startTime = DateTime.now();
            return result;
        }
    }
}