Amazon Connect: Example of Click to Call in JavaScript
0
Hello All, Is there an example code for a click to call from a web page, possibly using the V3 using javascript ?
asked 16 days ago18 views
1 Answers
0
When connected to ccp assign agent to a variable
connect.agent((agent) => {
window.CCP.agent = agent;
})
Then you can make a call as below:
const endpoint = connect.Endpoint.byPhoneNumber(phoneToDial);
window.CCP.agent.connect(endpoint, {
failure: (e: any) => {
console.log("call failed");
}
})
answered 16 days ago
Relevant questions
Error using the AWS Connect Streams API to create an outbound call leg for initiating a transfer: "QuotaExceededException: Cannot dial third party destination: The agent is at maximum capacity."
asked 2 months agois there a way to get All the Real Time Agent Statuses in AWS Connect?
asked 5 months agoJavascript as a Game client for a Gamelift Server
asked 3 years agoJavascript IoT client SDK AttachPolicy call inside AWS lambda blocks and causes the lambda to timeout without any error/exception/log whatsoever
Accepted Answerasked 6 months agoMobile phone call alert from AWS
asked 4 months agoI am using javascript v3 aws-sdk to communicate with AWS-API, but intermittent delay occurs in certain regions.
asked 5 months agoAWS-SDK-Javascript v3 API call to DynamoDB is return undefined and ignoring execution of a console.log command
Accepted Answerasked 24 days agoPass scripting variables to html in Sumerian
Accepted Answerasked 5 months agoAmazon Connect: Example of Click to Call in JavaScript
asked 16 days agoClick to call Functionality
asked 4 days ago
thanks @bbolek . But I have further questions . I am trying to use the javascript v3 for Connect ( https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-connect/index.html ) And my current problem is the connection is refused . I think I am missing a parameter either during creating ConnectClient or StartOutboundVoiceContactCommand (see below ) . I get error "Uncaught (in promise) Error: Credential is missing"
//code fragment import { ConnectClient, AssociateApprovedOriginCommand, StartOutboundVoiceContactCommand } from "@aws-sdk/client-connect";
const client = new ConnectClient({ region: "us-west-2" }) /// const params = { "ContactFlowId": "36c5ea54-XXXX-XXXX-XXXXX-XXXXXXXX", "DestinationPhoneNumber": "+1XXXXXXXXXX", "InstanceId": "arn:aws:connect:us-west-2:XXXXXXX", }; const command = new StartOutboundVoiceContactCommand(params); client.send(command);