Skip to main content

Hi, I'm doing a nodejs app, that creates a subscription. Once the subscription is set, I make a call and I start receiving multiple calls with code: "Setup". ¿Is this correct? Do you know what these code status means (Setup code is that the client is calling?)


Thanks

I guess you referred to the telephony session event notification. If so, please read this blog. Scroll to the "Call statuses and how to use them" section for explanation about multiple events with the same status.


Thanks you! I'm going to take a look on that!


Hey ​@PhongVu 
This blog was very helpful.

Thank you!


​@PhongVu 

Any idea why I would be getting multiple web-hook events with status answered?
And how to differentiate between them to get the real answered call. 

It looks like the first answered status comes in during the dialing stage, well prior to the agent answering the phone even prior to the proceeding status. And the second one comes when the phone is actually answered.


this logic seems to do the trick for determining the real answered call

const hasExtension = parties[0].extensionId ? true : false;
const callDirection = parties[0].from.extensionId ? "outbound" : "inbound";
if (callDirection === 'outbound' && !hasExtension || callDirection === 'inbound' && hasExtension) {
                console.log('\nCall answered');

}


Reply