The Twilio integration, as any other SIP provider integration, consists of 2 parts. First part is the setup on the provider side during which you will be asked to note down some important information which you will use in the second part which is the setup in LiveAgent admin panel. Here are the steps which we'll take:
- Create a SIP trunk
- Set up Termination URI and credentials
- Setup Origination URI
- Add numbers to the SIP trunk
- Create numbers in LiveAgent
So let's start by logging to your Twilio console and going to Elastic SIP Trunks, you can use the Go to bar in the upper right corner of your console to search for this section. Once there click on Create new SIP Trunk button.
You'll need to give some Friendly Name to your new trunk so let's use for example LiveAgent.
Once the SIP trunk is created make sure that the Secure trunking is disabled on the General tab:
Once you have your trunk created a move to the Termination screen where you need to fill in unique Termination SIP URI and add new credentials for the trunk by clicking the PLUS + icon next to Credentials list. You are going to need both the Termination SIP URI and the credentials on the LiveAgent setup part so please save these for later use.
For the Termination SIP URI you can use anything unique so, for example, you can use your LiveAgent account domain without dots, so if your LiveAgent account domain was something.ladesk.com you could add it as somethingladeskcom as the Termination SIP URI. You need to save somethingladeskcom.pstn.twilio.com for later use. If your desired URI isn't available, try something else, it doesn't matter that much.
When adding the credentials you will again need some friendly name, username, and password. You can use for example this password generator to get a strong password. Save the username and password for later use during LiveAgent setup phase.
Twilio username and password can NOT contain special characters ( e.g. @#$% )
Once done with the Credentials list and the Termination SIP URI Save the whole Termination screen. Sometimes you might get an error "Unable to save SIP trunk: is invalid". In that case, please proceed to the next steps 3. and 4. and then get back to this step and do it again.
Proceed to Origination screen and Add new Origination URI. Origination SIP URI will be one of the following 3 based on whether your LiveAgent account is hosted on our US servers, UK servers or EU servers:
- sip:1-sip-la-us-tx.ladesk.com when your LiveAgent is hosted on US servers
- sip:1-sip-la-us-ca.ladesk.com when your LiveAgent is hosted on US servers
- sip:1-sip-la-uk.ladesk.com when your LiveAgent is hosted on UK servers
- sip:1-sip-la-eu.ladesk.com when your LiveAgent is hosted on EU servers
- sip:1-sip-la-de.ladesk.com when your LiveAgent is hosted on EU servers
The correct URI is displayed in your LiveAgent admin panel while you are adding a Twilio number so please skip to step 5 of this article and see the second screenshot in this step where the section where Origination URI is displayed is highlighted.
If you are not sure which one to use please contact our live support. Do not forget to Save the whole Origination screen.
Move forward to the Number section and either add your existing Twilio numbers or buy new numbers which will be added to your LiveAgent SIP trunk. The numbers which you add will be routed to your LiveAgent account from this point on. Write down the numbers which you wish to set up in your LiveAgent, include also the international prefix and remove any separators, so the number from below screenshot must be saved like this +421233057904.
Make sure you have the Termination SIP URI, the Termination Credentials and the numbers written down and log in to your LiveAgent admin panel and go to Configuration->Call->Numbers->click Create->select Twilio from the list of providers.
On the next screen you will need to fill in a bunch of fields so lets get over them one by one:
- Origination URI - you can see this one highlighted at the below screenshot at the very top. Here the software tells you which Origination URI you need to set up during step 3 of this article.
- Name - friendly name for the number which you are adding, it can be some name like Sales number or just the actual phone number
- Number - the full number which you are adding with +, international prefix and without any separators
- Dial out prefix - this prefix is used if you set up LiveAgent with hardware phones (enter e.g. 01), in such case you will first need to dial this prefix on your hardware phone and then dial the actual number which you wish to call. Alternatively, you can initiate the call from the LiveAgent panel and simply answer your hardware phone to start the actual call.
- Host - here you need to write the Termination SIP URI which you've set up in previous steps, so somethingladeskcom.pstn.twilio.com
- Username - the username you've added when creating the credentials on the Termination screen - somethingladeskcom
- Password - the password you've added when creating the credentials on the Termination screen
Save the number and you are ready to test the outgoing and incoming calls with it. For outgoing calls, you should also check the "Voice Geographic Permissions" section on your Twilio console to allow the outgoing calls to other countries.
After you have your number added you might want to proceed and set up the welcome, offline, queue messages and maybe even some IVR options. Please continue with the IVR guide which covers these options.