question

rhaylander-almeida6268 avatar image
rhaylander-almeida6268 asked Phong Vu commented

RingOut creating Outbound and Inbound calls

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.

ringout
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
I confirm that RingOut does generate two call log records. Let me know if you have any questions.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

rhaylander-almeida6268 avatar image
rhaylander-almeida6268 answered
The issue I'm experiencing is the same as this guy did:  https://devcommunity.ringcentral.com/ringcentraldev/topics/ringout-quirks

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.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

rhaylander-almeida6268 avatar image
rhaylander-almeida6268 answered
Hi Tyler, have you had the chance to take a look at the reference I've sent?
It's really important for us to receive an answer from you guys before we take the next step, otherwise we could just waste time going into the wrong direction.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

ak avatar image
ak answered
There would be two call logs or rather two records within the active calls object of the API response when you receive a Presence notification as below:

{
                 
  "uuid": "3219598113702261466-7473112250947924986",
  "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
  }
}
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. 

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 



1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

karthika-r6376 avatar image
karthika-r6376 answered
@AK But what if another incoming call comes at the same time when the number A is talking to number B . We may miss that particular call log from our side if we refer only direction as Outbound.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
I did lots of investigation. And our internal development team also faces this issue and there is no perfect solution yet.

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.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

karthika-r6376 avatar image
karthika-r6376 answered Phong Vu commented
@Tyler Long Did you find any perfect solution for above problem other than mentioned workaround. Still we are getting two call log records.
4 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image Tyler Liu ♦ commented ·
Actually the workaround I mentioned is deprecated, you should not use it anymore!

It is a known bug of our side and we need to fix it.

I will push the engineering team.
1 Like 1 ·
Ext 41384 avatar image Ext 41384 Tyler Liu ♦ commented ·

Hi is there a fix for this problem?

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Ext 41384 commented ·

Can you create a new question and post your finding. You can add the link to this old thread as a reference.

Thanks

0 Likes 0 ·
karthika-r6376 avatar image karthika-r6376 commented ·
Thanks for the quick update. Please update us once you have any estimated time for a fix.
0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys