question

matt-resmer13992 avatar image
matt-resmer13992 asked matt-resmer13992 commented

How to find the dialed number

Hi Guys,


I've successfully got inbound call call connected events coming through to my WebHook when a call is picked up by an extension which is fantastic.


I also need to know though what the number is that the caller actually dialled initially (not the extension but the actual original calling number) ... how do I find that out? It isn't in the json blob that the WebHook receives.


Thanks for the help

sdk
1 |3000

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

1 Answer

Phong Vu avatar image
Phong Vu answered matt-resmer13992 commented
Did you use the "incoming-call-pickup" event filter? If so, check the payload and look for the from and fromName


11 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.

Phong Vu avatar image Phong Vu ♦♦ commented ·
Then there is the to field. Both caller and callee numbers are there.
1 Like 1 ·
Phong Vu avatar image Phong Vu ♦♦ commented ·
Hi Matt,

Since you use the "/restapi/v1.0/account/~/extension/~/incoming-call-pickupincoming-call-pickup" event filter, which is at extension level, therefore, only incoming calls to that direct phone number or to a main company phone number with that extension's number (e.g. (xxx)xxx-xxxx*103) would trigger the notification of the incoming call for that extension.

- If it is a call to the direct phone number, the "to" will show the phone number the caller dialed.
- If it is a call to the company main phone number followed by the extension number, the "to" will show the extension number the caller dialed. In this case, you have to implement extra code to match the extension number with the direct number of that extension.

Here are some test result from my test:

Call to company main phone number with extension number 103:

{"body": {"toName": "Anina Bot", "srvLvlExt": "390", "extensionId": 186639004, "from": "+1650513XXXX", "uuid": "942086925183307542", "to": "103", "timestamp": "2019-02-15T17:26:41.914Z"

Call to extension 103 direct number:

{"body": {"toName": "Anina Bot", "srvLvlExt": "390", "extensionId": 186639004, "from": "+1650513XXXX", "uuid": "8345456564148253871", "to": "+14134183745", "timestamp": "2019-02-15T17:27:11.560Z"

Hope this helps,
+ Phong
1 Like 1 ·
Phong Vu avatar image Phong Vu ♦♦ commented ·
No, each RingCentral account can have multiple extensions (aka users). Each extension has an extension number (e.g. 101, or 102, etc) and it can have zero or multiple direct numbers.

Now if someone from outside can always call the main company number followed by the extension number to reach that user. Or, he/she can call any direct number assigned to that user.

When you use the "incoming-call-pickup" notification, you will get the "to" with a value match what the caller dialed as explained above.

+ Phong
1 Like 1 ·
Phong Vu avatar image Phong Vu ♦♦ commented ·
Ok, one more time to explain this to you by an example

  1. You have 1 RingCentral account
  2. By default, the account has a main company phone number (e.g. 226 123 4567) and one extension number 101.
  3. You have 3 employees in your company and you want to add them as users to use RingCentral.
  4. You add 3 new users to your account and they are extension 102, 103 and 104.
  5. Up to now, you and your employees can receive incoming call if some one dials the main company phone number and the extension number e.g. 2261234567*103
  6. You want each employee has its own direct phone number so they can call and receive incoming call directly without using the company main number.
  7. You purchase 3 phone numbers and assign the number to each of the employee. Employee 3 need more than one direct phone number, let's say one number used for customer support and one number for customer feedback. You purchase 2 direct numbers and assign them to extension 103.

As you see, you have 1 account and you have multiple users/extensions with possibility to have multiple phone numbers/lines.

If you want to try this out in your sandbox, login with your main company number at https://service.devtest.ringcentral.com and try adding users and direct numbers and assign them as discussed above.

If you want to have a phone call conversation on this. Send you phone number via phong.vu@ringcentral.com and I am more than happy to help you more.
1 Like 1 ·
matt-resmer13992 avatar image matt-resmer13992 commented ·
Thanks Phong, but from is the number of the person who called ... I need the number they actually dialled to initiate the call
0 Likes 0 ·
Show more comments

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