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
Md. Abdur Razzak.Md. Abdur Razzak. 

Content Security Policy Directive Console Error. Salesforce Outbound call (Click To Dial) using Twilio Flex is not Working.

I am trying to implement Twilio Flex for Salesforce Open CTI. I am using a twilio trial account. Twilio Inbound calls to salesforce using twilio flex is fine. But Click-To-Dial for salesforce outbound call using twilio flex is not working. When I click a phone number from the salesforce contact page, the twilio window pops up and shows a message 'Attempting Outbound call now' then stops and no call is placed in the specified number.

And I got this console error erery time
Refused to run the JavaScript URL because it violates the following Content Security Policy 
directive: "script-src 'self' 'nonce-fbd8b58ceca1755f12efd1a1e2bd2a8f' 
chrome-extension: 'unsafe-eval' *.canary.lwc.dev *.visualforce.com 
https://ssl.gstatic.com/accessibility/ https://static.lightning.force.com". 
Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce 
('nonce-...') is required to enable inline execution.

Error: outbound calling disabled
    at assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461
    at assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461
    at Object.next (assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461)
    at assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461
    at new Promise (<anonymous>)
    at i (assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461)
    at e.startOutboundCall (assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:1461)
    at e.<anonymous> (assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:142)
    at assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:142
    at Object.next (assets.flex.twilio.com/releases/flex-ui/1.23.1/twilio-flex.min.js:142)
(anonymous) @ assets.flex.twilio.com/twilio/flex-salesforce-integration/1.4.0/plugin-flex-salesforce-integration.js:1

 
Best Answer chosen by Md. Abdur Razzak.
SwethaSwetha (Salesforce Developers) 
HI Md. Abdur Razzak,

Thanks for sharing the fix you found on the https://salesforce.stackexchange.com/questions/327138/salesforce-outbound-call-click-to-dial-using-twilio-flex/327456#327456

You mentioned that you had to Enable the Dial Pad in "Twilio flex Setting" in Twilio. Then you had to set the Caller Id and other information there.

Please mark this answer as best to close the thread so that others facing the same issue will find this information useful. Thank you

All Answers

SwethaSwetha (Salesforce Developers) 
HI Md. Abdur ,
Does this error occur in all the browsers or just Chrome?Thanks
Md. Abdur Razzak.Md. Abdur Razzak.
I have tried chrome and edge. In both of them I got the same error.
SwethaSwetha (Salesforce Developers) 
HI Md. Abdur Razzak,

Thanks for sharing the fix you found on the https://salesforce.stackexchange.com/questions/327138/salesforce-outbound-call-click-to-dial-using-twilio-flex/327456#327456

You mentioned that you had to Enable the Dial Pad in "Twilio flex Setting" in Twilio. Then you had to set the Caller Id and other information there.

Please mark this answer as best to close the thread so that others facing the same issue will find this information useful. Thank you
This was selected as the best answer