I'm using the RingOut API to initiate calls for my customers and I'm monitoring the events. When I initiate a call to a number A, 2 calls are being created and I'm receiving events of both of them.
I'm sending the following body:
{ from: {phoneNumber: "NUMBER_A"}, to: {phoneNumber: "NUMBER_B"}, playPrompt: true }
Then I start receiving the following events:
[{ telephonyStatus: 'Ringing', from: 'NUMBER_A', id: '', to: 'NUMBER_B', sessionId: '35393577028', direction: 'Outbound' }]
The one above is ok, but then I receive these:
[{ telephonyStatus: 'Ringing', from: 'NUMBER_B', id: 'b536df52145149d6af765f47a2ec6ed9', to: 'NUMBER_A', sessionId: '35393581028', direction: 'Inbound' },{ telephonyStatus: 'CallConnected', from: 'NUMBER_A', id: 'c4e45991e1d84caa9dccd6e9b76d1e10', to: 'NUMBER_B', sessionId: '35393577028', direction: 'Outbound' }]
See the call log below:
I'd like to know if I'm doing something wrong or if I could relate both events because I don't believe it's reliable to correlate the "from" and "to" properties from the events, or even if I could change the way I'm doing the RingOut and make it stop creating two calls, when it was suppose to just create an Outbound call. Any guidance here will be really appreciated!
Let me know if you need further information.
It is a known bug of our side and we need to fix it.
I will push the engineering team.
Hi is there a fix for this problem?
Can you create a new question and post your finding. You can add the link to this old thread as a reference.
Thanks
There is a solution which works most of the time (maybe 99%):
Outbound fromNumber = inbound toNumber
&&
Math.abs(outbound sessionId inbound sessionId) is one of 1000, 2000, 3000, 4000.
Then you can assert that they are actually two legs of the same call instead of two separate calls.
{
"uuid": "3219598113702261466-7473112250947924986",As you are initiating a Ringout between one of the numbers on your account and an external number / Internal number you would see the active calls for the two legs.
"timestamp": "2017-07-14T17:29:10.968Z",
"subscriptionId": "103a9249-a0d9-420c-a545-fecc97ff6782",
"body": {
"extensionId": 734191020,
"telephonyStatus": "Ringing",
"activeCalls": [
{
"id": "9834152a1f624655b8e9065d3accb384",
"direction": "Inbound",
"fromName": "xxxx xxxx ",
"from": "RingCentral Number (ext number)",
"toName": "Anil Digital Line Only",
"to": "Customer Number",
"telephonyStatus": "Ringing",
"startTime": "2017-07-14T17:28:59.314Z"
},
{
"id": "a3945590afb8496c8d0a5553842a042a",
"direction": "Outbound",
"fromName": "Anil Digital Line Only",
"from": "RingCentral Number",
"toName": "Customer Name",
"to": "Customer Number",
"telephonyStatus": "CallConnected",
"sessionId": "158674552020",
"startTime": "2017-07-14T17:28:59.220Z"
}
],
"sequence": 555006,
"presenceStatus": "Available",
"userStatus": "Available",
"dndStatus": "TakeAllCalls",
"allowSeeMyPresence": true,
"ringOnMonitoredCall": false,
"pickUpCallsOnHold": false
}
}
If you would like to just refer to a single call log record then you could refer to the records with the direction: "Outbound"
As the sessionID remains the same for this leg ( direction: " Outbound / Inbound " ) across all the three events:
1.) Ringing
2.) Call Connected
3.) No Call
After the last response, I'm not sure if I understood what was the solution or what the guy had to do.
Let me know if really there isn't anything else to do.
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder