Many VoIP service providers offer SIP Trunks as a standard product, but just what is a SIP trunk and what can you use it for and how do you make it work with Asterisk or FreePBX? I will attempt to answer these questions in this 3 part blog, starting with the basics.
What is a SIP Trunk?
A SIP trunk uses standard SIP signalling, but the endpoints of the trunk are fixed – typically one end point is the ITSP – Internet Telephony Service Provider – and the other is your PBX (e.g. Asterisk or FreePBX).
The SIP Trunk will usually just be one segment in the entire end-to-end pathway of a call. It may be used for inbound/outbound or both types of call and a number of different calls can be active at the same time, all using the same SIP Trunk connection. However, to truly qualify as a SIP Trunk, it should be possible to associate more than one incoming number (DDI or DID) with the same account.
I will only be discussing so-called “Retail SIP Trunks” in this article – i.e. those connecting an ITSP VoIP service to customer premises equipment such as an IP-PBX. There also exist “Wholesale SIP Trunks” where one VoIP service provider has an approved connection with another. These wholesale connections are tailored to high volumes of call traffic with lower ‘per-minute’ pricing in return for guaranteed minimum volume commitment.
What do you connect to a SIP Trunk?
Normally, the equipment at the customer’s premises will be some kind of SIP-enabled PBX. An Asterisk PBX or FreePBX server is ideal for this role.
Although possible, it would be unusual and probably impractical to connect an IP Phone or softphone directly to a SIP Trunk. However, there is just about no difference in terms of the SIP signalling. Under the hood, the Asterisk configuration to connect to a personal VoIP account – the type normally used for a single IP phone or softphone – is quite similar to that used for a SIP Trunk account. However, in the graphical user interface provided by something like FreePBX, the two entities are presented under different headings and made to appear more different than they really are. In many respects, the differences between personal SIP accounts and SIP Trunks are commercial rather than technical – greater capacity for simultaneous calls and greater provision of inbound numbers managed through a single SIP connection. The main technical difference is the ability of a PBX to extract the target DDI number and use it to correctly route inbound calls. Also, the network address of the endpoints for a SIP trunk will nearly always be fixed whereas the address of a softphone or SIP client installed on your smartphone will be constantly changing.
How do you connect to a SIP Trunk?
Sometimes it is necessary for the PBX to register with the ITSP, primarily because this allows the service provider to know where the PBX is located – its IP address. The service provider then knows to send your inbound calls to that IP address. Sometimes the connection is achieved without registration, simply using a pre-defined static IP address. This latter option is more likely to be used for direct connections to carriers or for other high-end connections involving wholesale services.
Making and receiving calls over a SIP Trunk
Inbound calls delivered by the ITSP to your PBX will contain the DDI number that was called. This must be interpreted by the PBX to determine the routing of the call to a device – typically a phone – but it could be to a ring group or ACD queue. More about the setup for inbound calls in part 2.
Outbound calls are sent to the ITSP by the PBX and they will very often need to be authenticated. The authentication is triggered by a challenge response sent from the ITSP after receiving the initial INVITE request; responding to the challenge, the PBX re-sends the original INVITE request, but with an extra header (the digest) containing credentials for authentication/authorisation. The credentials take the form of a username and password, but the password is normally encrypted before being sent. The challenge authentication/authorisation is required even if the PBX has registered. Again, there will be some more on this later.
To read part 2, click here.
Comments
One response to “Taking the plunge with SIP Trunks – Part 1”
[…] In part 1, I explained how a SIP Trunk is really just a virtual connection between your Asterisk PBX and the […]