6

Twilio noob + VoIP noob here, so brace yourself for a double-dumb question.

I have a local Twilio number that currently points to a text-to-speech voicemail greeting. I get a lot of hang-ups (empty voicemail messages), so I would prefer to start routing my incoming calls to a VoIP phone during business hours.

I only have one question about this so far: HOW?

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
JoshR
  • 461
  • 3
  • 9

1 Answers1

16

Forwarding voice calls from a Twilio number to a VoIP client.
Example with Zoiper VoIP client (https://www.zoiper.com/).

Twilio configuration

Step 1 - Configure credentials

Log on to your Twilio console (Master Account or switch to a Subaccount), then go to: Programmable Voice >> SIP Domains >> Credential Lists https://www.twilio.com/console/voice/sip/cls

enter image description here

Click on "Create new Credential List"

enter image description here

Remember the username and password, you will need it for Zoiper VoIP client configuration.

Step 2 - Configure SIP domain

Once you've created a credential list, go to Voice SIP Domains https://www.twilio.com/console/voice/sip/endpoints

Click on "Create new SIP Domain"

Enter values for:

FRIENDLY NAME: "My SIP Domain"

SIP URI: "something" (the 'something' has to be some unique name) you will need this something when you configure Zoiper.

enter image description here

then for CREDENTIAL LISTS select "My List" (the one you created on 'Credential Lists'.

enter image description here

also for SIP Registration section, down the page, select ENABLED and again for CREDENTIAL LISTS select "My List"

enter image description here

Don't forget to "Save"

Step 3 - Configure a TwiML Bin

Next, you need to create a TwiML Bin, go to https://www.twilio.com/console/runtime/twiml-bins and let's call it "SipBin" with the folowing code:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
  <Sip>
    alex@something.sip.us1.twilio.com  
  </Sip>
</Dial>
</Response>

Note the alex@something part is alex from when we created the credential list and something from when we created the SIP domain.

Save this bin.

Step 4 - Configure Twilio phone number

Next configure the Twilio phone number, as when a voice call comes in to run the TwiML from the bin. https://www.twilio.com/console/phone-numbers/incoming

enter image description here

Save the phone number configuration. Next, let's configure Zoiper.


Zoiper configuration

Download and install the Zoiper VoIP client app on your smartphone (https://www.zoiper.com/).

Launch the app, click on the "hamburger" menu at top left then go to Settings then to Accounts.

Select the "SIP" tab, then click on the "+" (plus) sign to add an account. It will ask you for a "Username/Login" and a "Password".

Enter the ones you used when you created the credential list at Twilio.

Click the "Login" button, it will take you to next page to enter "hostname or provider".

Enter something.sip.us1.twilio.com, replace something with your name choice when you configured the SIP URI at Twilio.

Click "Next", it will take you to a page regarding "provider/PBX authentication or outbound proxy".

Do not check the box, click "Skip".

On the next page, wait until Zoiper connects to Twilio, it will automatically find "SIP TLS" , it will go green.

You can now click "Finish".

You're done, call your Twilio number and Zoiper will ring.


Update: Outgoing Calls Configuration (only needed at Twilio)

Step 1

To make outgoing calls work you will need to create a second Twilio Bin, let's call it SipBinOut with the folowing code:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial callerId="+13335557777">{{#e164}}{{To}}{{/e164}}</Dial>
</Response>

replace +13335557777 with your Twilio number.

After you save the bin, retain (copy) the bin's URL from the Properties section at the top (see picture below).


enter image description here


Step 2

Go to the Sip Domain Configuration page for your SIP Domain (the one where you entered the FRIENDLY NAME and the SIP URI).

In the section for Voice Configuration configure the REQUEST URL, paste the SipBinOut URL from the previous step (keep the method HTTP POST).

Save with the button at the bottom.

Alex Baban
  • 11,312
  • 4
  • 30
  • 44
  • Wow, thanks for this amazingly detailed response! I'll try this during the week and let you know how it goes. – JoshR Jan 20 '18 at 18:54
  • Is there a version of this that routes the number to a dedicated VOIP handset rather than an app on a personal phone? This would be used by multiple people at a store's front desk, so a personal device won't work. Thanks again! – JoshR Jan 23 '18 at 20:31
  • Configuring your VoIP phone would be similar, it should be mentioned in phone's documentation/manual or search Internet for your specific model. – Alex Baban Jan 23 '18 at 21:39
  • Thank you very much! Incoming calls worked. Tell me pls how to make outgoing calls work? – Stanislav Belichenko Mar 26 '18 at 14:11
  • 1
    @AlexBaban You are awesome! If you do not mind, I'll try to ask one more question: do you have such an instruction for SMS? – Stanislav Belichenko Mar 26 '18 at 22:37
  • @AlexBaban, Could you please just explain outgoing call method.As you mentioned in step 1 of outgoing call setup, there is no URL at the top of Properties section.I am adding somthing like this from Herokku [link](http://mytwiliotest.herokuapp.com/voice?callerId=+18xxxxxxxxx) – Rajendra Aug 30 '18 at 14:34
  • 1
    @AlexBaban I've asked the equivalent question for SMS: https://stackoverflow.com/questions/52100722/sms-messaging-using-twilio-with-sip – brandones Aug 30 '18 at 15:33
  • @Rajendra I've updated the answer with a picture, you can see the `URL` section under `Properties` for the bin. – Alex Baban Aug 31 '18 at 00:38
  • @brandones , Sorry, but I don't know if Twilio supports SMS over SIP, hopefully somebody can clarify on your question. – Alex Baban Aug 31 '18 at 00:41