Hi,
for some reason my replies here went directly to Muhammad, so I helped him with that and I will share with you what I said to him.
What you can do on FreeSWITCH side is to configure in the dialplan extension a response header, like that for example:
Pay attention that I added the 'r' letter before 'h', because 'rh' means response header.
A response header will be attached on the 200OK in case of outgoing call from your SIP.js, so when someone is answering the call on the other end, you'll get a 200OK with that custom SIP header.
And with SIP.js you can actually very easily catch the response (200OK) and take whatever you need from, so in function where you implement an outgoing call just do something like that:
var inviterInviteOptions: InviterInviteOptions = {
requestDelegate: {
// Catch 2XX SIP messages (mostly the 200 OK) to detect the call answer event.
onAccept(response: AckableIncomingResponseWithSession)
{
....
....
var callUUID = response.message.getHeader("X-UUID") || "";
....
....
}
}
}
So on SIP.js client you just need to catch it by setting InviterInviteOptions object with onAccept callback and pass this object to the "invite" function.
Hope it helps.