Swati
Swati

Reputation: 862

Twilio: Dial extension number along with twilio number

I am using Twilio for inbound calls, where user can call an application through Twilio-Number (brought from Twilio) and will be redirected to admin.

Now, We want Admin to call User using same Twilio-Number. We wabt to call this as <Twilio_Number>#<user_id>. We want to pass <user_id> as extension, so that when Admin clicks on the link with tel=<Twilio_Number>#<user_id>, it will initiate a phone-call to twilio-number.

In our app, we will find user's mobile using his id and redirect call to user's mobile number.

I have referred this doc: https://www.twilio.com/docs/howto/companydirectory

But would need few more details like:

How will Twilio recognize the extension number? And by which name is it provided in call-request parameters?

Currently, we received these parameters in twilio-voice call request CallSid, AccountSid, ApiVersion, Direction, To, Called, Caller, From. In the same request-parameters, how I can get extension digits?

Thanks.

Upvotes: 9

Views: 6659

Answers (2)

Pablo Mendez
Pablo Mendez

Reputation: 11

I don't know if you solved this problem yet (probably yes) but what you can do is, create a record in DB with the extension (id agent) and when Twilio go to your callback url updated the records depending of the state.

Hope this works to you. I'm doing this with the same scenario.

Upvotes: 1

Have you had the chance to review the IVR information provided on Twilio's site? I believe it is a better solution for what you are trying to accomplish.

https://www.twilio.com/docs/howto/ivrs-the-basics

(Please follow the links to the next section at the bottom of the pages.)

After reviewing the documents, please open a support request with specific questions via https://www.twilio.com/user/account/support/ticket/create

Look forward to your ticket.

Take care!

Upvotes: 1

Related Questions