Mansoor Jafar
Mansoor Jafar

Reputation: 1488

Twillio sendDigits for CallerID (outbound calls)

After searching I could find a TWIML noun 'sendDigits' which sends digits to the destination number like following:

<Dial record="true" callerId="415-123-1111">
      <Number sendDigits="wwww1928">
        415-123-4567
      </Number>
</Dial>

What I need is to send digits to the 'CallerId' (we need to use callerId's which are already in extension system locally). I could find nothing in TWIML References for this.

Can anybody please tell me a work around to send Digits for 'CallerID'.

Thank you

Upvotes: 0

Views: 1002

Answers (1)

Carter Rabasa
Carter Rabasa

Reputation: 269

Twilio employee here. I think I understand what you're trying to do: you want to connect person A (phone number + extension) to person B (phone number + extension). Is this correct?

If so, you're half way there, you've essentially coded the 2nd half of the call (to person B). But you need to use the REST API to initiate a call to Person A. The API call takes 3 parameters:

  • To - the phone number for person A
  • From - the caller ID you want person A to see when their phone rings (usually a Twilio #)
  • URL - the URL to your TwiML

The TwiML you send to Twilio should look something like this:

<Play digits="12345"/>
<!-- at this point you've successfully connected to Person A -->
<Dial record="true" callerId="TWILIO NUMBER HERE">
  <Number sendDigits="wwww1928">
    415-123-4567
  </Number>
</Dial>
<!-- at this point you've successfully connected to Person B -->

The key thing to remember is that connecting a call between two people is a 2-step process: first use the REST API to establish a live call to the 1st person and then use TwiML and to establish a live call to the 2nd person. Then Twilio bridges them together.

Hope this helps!

Upvotes: 2

Related Questions