How to get Call Status(Connected, Busy, No answered & Ringing) from Amazon Connect Streams API?

0

I am using Amazon Connect Streams API https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md and we have different call status in Amazon Connect e.g. call connected, call missed/no answered!

how can i get call status of the following call dispositions (busy, connected, in progress, ringing, no answered) from within Streams API?

已提問 2 年前檢視次數 1137 次
1 個回答
0

There are two steps to this, first you need to subscribe to agent events then you trigger based on things happening to the agent. So for example...

connect.agent(async function (agent) {
    agent.onStateChange(function (agentState){
        console.log("Agent State Changed to: " + agentState.newState);
    });
});

You can do similar subscribing to contact events.

connect.contact(function (contact) {
    activeContact = contact;
    contact.onRefresh(function (contact) {/* do stuff */});
    contact.onIncoming(function (contact) {/* do stuff */});
    contact.onAccepted(function (contact) {/* do stuff */});
    contact.onMissed(function (contact) {/* do stuff */});
});

Subscribing to events is covered here... https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md#event-subscription

ledge
已回答 2 年前
  • contact.onMissed(); gives error as well as contact.onEnded.

    console prints, "[contact.onMissed] Call is Missed. Contact status is error" on function handleMissed(contact) { console.log("[contact.onMissed] Call Missed by agent. Call status is " + contact.getStatus().type); }

  • bro is this just crawling stackoverflow bro? lol

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南