Mocking an Inbound call event in amazon connect


I tried to mock an inbound call event for amazon connect. I have tried with following code.

const mockEvent = {
      Details: {
        ContactData: {
          ContactId: "30435683-7566-4dfa-8060-af4cf3295cd2",
          Attributes: {
            "name": "jhon"
          CustomerEndpoint: {
            Address: "<My PhoneNumber>",
            Type: "TELEPHONE_NUMBER"

    // Create a new contact object => {
      console.log(`Connected to contact ${contact.getContactId()}`);
      contact.onIncoming((incoming) => {
        console.log(`Incoming call from ${incoming.getEndpoint().phoneNumber}`);
        // Answer the call
    }, mockEvent.Details.ContactData, {
      softphone: {
        allowFramedSoftphone: true

With this code I am unable to initiate an inbound call. Is there any way that we can initiate an inbound call with a button clicked Please mention.

asked a year ago438 views
1 Answer

based on the code you provided, it looks like you are using the Amazon Connect Streams API to interact with the contact center.

The Amazon Connect Streams API is primarily used for integrating Amazon Connect with web-based applications and enabling custom real-time voice and chat capabilities. It allows developers to interact with Amazon Connect and perform various operations such as initiating and managing contacts, handling audio and video streams, and managing call routing and queuing.

To initiate an inbound call using Amazon Connect, you will need to use the Amazon Connect Contact Control Panel (CCP) or a third-party tool that integrates with Amazon Connect. You can use the CCP to place an outbound call or simulate an inbound call. However, you cannot initiate an inbound call using the Amazon Connect Streams API alone.

If you want to initiate an inbound call with a button click, you can add a click event listener to your button and use the Amazon Connect CCP or a third-party tool to simulate the inbound call. You can also use the Amazon Connect APIs to initiate the call programmatically.

profile picture
answered a year ago
profile pictureAWS
reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions