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
Devanshu soodDevanshu sood 

how to access dynamically CTI Adapter URL in apex?

User-added image
Best Answer chosen by Devanshu sood
Raj VakatiRaj Vakati
Select Id ,AdapterURL from CallCenter

Use SOQL to query or use Dynamic Apex as well 



 

All Answers

Raj VakatiRaj Vakati
Select Id ,AdapterURL from CallCenter

Use SOQL to query or use Dynamic Apex as well 



 
This was selected as the best answer
Devanshu soodDevanshu sood

I want to append adapter url  like https://developer.salesforce.com/+'apex/DailerVF'; via apex

how can i do this?
 

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;
        }
    }
}