How to find the dialed number

  • 1
  • Question
  • Updated 2 months ago
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
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb

Posted 2 months ago

  • 1
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
Did you use the "incoming-call-pickup" event filter? If so, check the payload and look for the from and fromName


Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Thanks Phong, but from is the number of the person who called ... I need the number they actually dialled to initiate the call
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
Then there is the to field. Both caller and callee numbers are there.
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Thanks again Phong, but the to field is the extension number ... not the **original number the user dialed**
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
I think when a call is internal, then it is an extension number. Then you have to read the extension info and get the phone number. Can you test calling from a mobile number to see if it will show that phone number instead.
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Thanks Phong ... I did a test where I called externally from my own mobile number, but I can't seem to find the info I need in the event (or other events)

What I need, is if a company has multiple lines under one account, someone from the outside calls in and the call goes to a particular extension, what I want to know is the number the person dialed to initiate the call ... and it's an inbound external call

I don't want to know the extension number, I don't want to know the caller's own number, I want to know the number they very first dialed when they picked up their phone in the first place

Or is it that an account can only have one inbound line?
(Edited)
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
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
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Many thanks Phong, that's very helpful! ... so does that mean then, that if a company wants to have multiple inbound lines, they need a separate ring central account for each one then?

If that were the case, I'm assuming they could still obviously have the different lines ultimately going to the same extensions right?
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
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
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Thanks Phong, but to be honest I really don't understand what you're saying there. I don't feel it answers my question.

It really sounds like you're saying an inbound phone line/number and an extension number are one and the same thing ... I really don't see how that can be the case.

I'm feeling it's really difficult just getting this one simple concept answered no matter how I phrase my question.
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,016 Points 5k badge 2x thumb
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.
Photo of Matt Resmer

Matt Resmer

  • 300 Points 250 badge 2x thumb
Many thanks for the extra information Phong. It's a big help :)