Is there a way to change the phone icon which gets displayed in lightning-clickToDial element to any other icon? By default it shows an 'end call' icon. I want to change that icon to a normal phone icon. Is it possible?
1 Answer
Code snippets from salesforce component library.
Component:
<lightning:clickToDialService aura:id="clickToDialService"/>
<lightning:button label="enableClickToDial" onclick="{! c.enableClickToDial }"/>
<lightning:button label="disableClickToDial" onclick="{! c.disableClickToDial }"/>
<lightning:button label="onClickToDial" onclick="{! c.onClickToDial }"/>
<p><lightning:clickToDial value="14155555554"/></p>
<p><lightning:clickToDial value="14155555555" recordId="5003000000D8cuI" params="accountSid=xxx, sourceId=xxx, apiVersion=123"/></p>
JS Controller:
({
enableClickToDial: function (cmp, event, helper) {
// clickToDialService is for internal use only.
// Use sforce.opencti.enableClickToDial() in your org.
// https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_enableclicktodial_lex.htm
var clickToDialService = cmp.find("clickToDialService");
clickToDialService.enable();
},
disableClickToDial: function (cmp, event, helper) {
// clickToDialService is for internal use only.
// Use sforce.opencti.disableClickToDial() in your org.
// https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_disableclicktodial_lex.htm
var clickToDialService = cmp.find("clickToDialService");
clickToDialService.disable();
},
onClickToDial: function (cmp, event, helper) {
// clickToDialService is for internal use only.
// Use sforce.opencti.onClickToDial() in your org.
// https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_onclicktodial_lex.htm
var clickToDialService = cmp.find("clickToDialService");
clickToDialService.addDialListener(function(payload){
console.log("This alert simulates the onClickToDial method for Open CTI in Lightning Experience. The phone number is dialed sending the following payload: " + JSON.stringify(payload));
});
}
});
Here is a Documentation for AURA Components on salesforce component library it will render numbers as shown below
LWC Documentation example is not working so the best thing is to raise a case to salesforce in case you need to use it in LWC.