Zentrunk is a SIP Trunking service from Plivo that allows you to connect with fixed and mobile phones in over 200 countries. Connect your cloud or on-premise communication infrastructure to Plivo’s Zentrunk SIP Trunking service to connect to your customers easily.This documentation provides a basic configuration to get Asterisk up and running with Plivo as the external SIP gateway.To get started with Zentrunk using Asterisk you would need to do the following:
To configure the asterisk to connect to your Plivo Zentrunk, locate the root configuration of Asterisk on your machine. These locations vary from platform to platform.In this case (Debian Jessie GNU/Linux System), the root configuration is present at /etc/asterisk/.With the root configuration directory located, there are two major configurations that need to do -
Create a new channel named “plivo-phone” at /etc/asterisk/sip.conf. This channel will be used in X-Lite to connect to asterisk. Also, create another channel called “plivo-trunk” which will connect to your Plivo Trunk.
Copy
Ask AI
[plivo-phone]type=friendcontext=Zentrunkhost=dynamicsecret=password1234[zentrunk]type=peercontext=Plivohost=Termination SIP Domain of your Plivo Trunksecret=Password for TestAuthGroupusername=Username for TestAuthGroup
A “plivo-phone” channel is created with the following attributes.
Type=friend - Creates a user and peer connection
Context=Zentrunk - Context is the identifier for a dialplan that will be loaded from extensions.conf. The sip.conf identifies and allows connections to the asterisk server. The context in the identifier allows the execution of call flow when a call is received from XLite.
Host=dynamic - XLite can be connected from anywhere
Secret=password1234 - Password to be used in X-Lite
The “zentrunk” channel is created with the following attributes.
Type=peer - Creates a peer connection
Context=Plivo - Context is the identifier for a dialplan that will be loaded from extensions.conf. The sip.conf identifies and allows connections to the asterisk server. The context in the identifier allows the execution of call flow when a call is received from XLite.
Next, you should set up a Dial Plan. A Dial Plan tells Asterisk what to do when a call has to be placed. The “Content” attribute in the SIP channel connects a channel with a dialplan. Add a dialplan named “Zentrunk” in extensions.conf under /etc/asterisk/directory.
The above dial plan has defined an extension for a number starting with the digit 1. When a call is made from X-Lite to a number that starts with 1, it hits the asterisk server first. The dialplan that satisfies this pattern matching get loaded, in this case, the above plan. The caller ID is set to your Plivo Number and the SIP INVITE is sent to “Zentrunk” channel which forwards the invite to Plivo Trunk from where the outbound call is placed.
To configure your asterisk to connect to your Plivo Zentrunk, locate the root configuration of Asterisk on your machine. These locations vary from platform to platform.In this case (Debian Jessie GNU/Linux System), the root configuration is present at /etc/asterisk/.With the root configuration directory located, there are three major configurations that you need to do -
A 6001 channel is created with the following attributes.
Note: Use 6001 as your user in X-lite.
Type=friend - Creates a user and peer connection .
Context=incoming - Context is the identifier for a dialplan that will be loaded from extensions.conf. The sip.conf identifies and allows connections to the asterisk server. The context in the identifier allows the execution of call flow when a call is received from XLite.
Host=dynamic - XLite can be connected from anywhere
Next, you should set up a Dial Plan. A Dial Plan tells Asterisk what to do when a call is received .The “Content” attribute in the SIP channel connects a channel with a dialplan. Add a dialplan named “incoming” in extensions.conf under /etc/asterisk/directory.
The above dial plan has defined an extension for a SIP enpoint named 6001. When a call is made to your inbound number, it hits the Plivo first and then it is forwarded to your asterisk server .Once the dialplan is loaded and the call is placed to the soft phone registered as 6001 in your asterik