Sep
23
2017

How to setup a Centurylink IQ SIP Trunk for Asterisk

Centurylink IQ architecture

I recently struggled to install a Centurylink SIP trunk.  Our rep could only provided us with Cisco configuration instructions.  From there we had to decipher the appropriate settings in Asterisk.  If you are reading this post you are probably in serious trouble right now.  Don’t worry!  Take a deep breath and keep reading!

 This is for Vanilla Asterisk 1.8.x.  I will cover sip.conf and extensions.conf examples.  The reference system is CentOS 7 paired with Asterisk 1.8.28.  This tutorial assumes you have working knowledge of Asterisk and the core configuration files.

Goals of the Post:

  • Configure Centurylink IQ SIP Trunk (sip.conf)
  • Configure Inbound/Outbound dialing (extensions.conf)
  • Set Hosts Mapping (/etc/hosts)

 

Before we begin I strongly encourage you to insist on test numbers(DID’s in T1 parlance) from your account representative at Centurylink.  Open the email sent to you with the SIP trunk credentials.

It should look something like this:

Lono T.  Cat 
1888 Pike street Ste 188 
Seattle, WA 98122 

CenturyLink Sales Order: 968285321
CenturyLink Account Number : 88888888

Dear Customer:

The following information is vital trunk group information for your Centurylink IQ SIP. In order to make and receive calls over the service, you will need to register your trunk group. Therefore, it is important to keep this accessible.

Trunk Group Information:

  Trunk Group Name: LONO4688PB08
  Trunk Group Alias: SAVE LONO

To activate your service, you will need to register the trunk group as indicated above. To register the trunk group, you will need to program your PBX and/or Session Border Controller with the information provided below:

 

  Pilot User: 2063225040@voip.centurylink.com
  Trunk Group SIP ID: 1977661-2063225040
  Trunk Group SIP Password: Y8F81288X333
  CenturyLink SBC IPv4 Address: 210.115.66.11:5100
  CenturyLink SBC IPv6 Address: [0000:0000:0000:0000:0000:0000:0000:0001]:5100

 

Centurylink IQ SIP Trunk (sip.conf)

To configure the trunk we will need to make three additions to the ‘/etc/asterisk/sip.conf’ file:

  1. SIP registry
  2. Inbound peer
  3. Outbound peer

/etc/asterisk/sip.conf

;register => user[:secret[:authuser]]@host[:port][/extension];register => user[:secret[:authuser]]@host[:port][/extension]

;Register to Centurylink
register =>2063225040:Y8F81288X333:1977661-2063225040@voip.centurylink.com:5100

 

;Inbound CenturyLink
[centurylink-in]
type=peer
username=1977661-2063225040
host=voip.centurylink.com
port=5100
qualify=yes
directmedia=no
context=from-pstn
insecure=port,invite

;Outbound CenturyLink
[centurylink-out]
type=peer
username=1977661-2063225040
secret=Y8F81288X333
host=voip.centurylink.com
port=5100
qualify=yes
directmedia=no
sendrpid = yes
trustrpid = no

Please note below, you may have to append the TN extension to the register statement, example:

register =>2063225040:Y8F81288X333:1977661-2063225040@voip.centurylink.com:5100/2063225040

The inbound/outbound peers are separate because the inbound calls are unauthenticated and require a default context.  The outbound requires a password.

If the registry is working as intended check it with the ‘sip show registry’ command:

[root@mattcom1 ~]# asterisk -rvvvvvvvvvvvvvvvvvvvvvvv
Asterisk 1.8.28-cert2, Copyright (C) 1999 – 2013 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
=========================================================================
Connected to Asterisk 1.8.28-cert2 currently running on mattcom1 (pid = 16437)
Verbosity is at least 23
— Remote UNIX connection
mattcom1*CLI> sip show registry
Host                                   dnsmgr      Username       Refresh     State               Reg.Time
voip.centurylink.com:5100   N            2063225040  3585        Registered       Sat, 23 Sep 2017 02:36:34
1 SIP registrations.
mattcom1*CLI>

The SIP peers should look like this:

[root@mattcom1 ~]# asterisk -rvvvvvvvvvvvvvvvvvvvvvvv
Asterisk 1.8.28-cert2, Copyright (C) 1999 – 2013 Digium, Inc. and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
=========================================================================
Connected to Asterisk 1.8.28-cert2 currently running onmattcom1 (pid = 16437)
Verbosity is at least 23
mattcom1*CLI> sip show peers
Name/username                     Host                               Dyn Forcerport    ACL      Port         Status

centurylink-in/1977661-206      210.115.66.11              N                                  5100        OK (50 ms)
centurylink-out/1977661-206    210.115.66.11              N                                  5100        OK (76 ms)

 

Inbound/Outbound dialing (extensions.conf)

Next we will add two contexts which we will arbitrarily call, ‘[outbound]’ & ‘[from-pstn]’ to the ‘/etc/asterisk/extensions.conf’.  Your actual context may be named something else.

The first example is for a 10 digit

/etc/asterisk/extensions.conf:

 [outbound]

;Normal Outbound
exten => _NXXNXXXXXX,1,NoOp(=== Outbound Centurylink IQ SIP TRUNK Call ===)
exten => _NXXNXXXXXX,n,Set(CALLERID(num)=2063225041)
exten => _NXXNXXXXXX,n,Set(CALLERID(name)=Lonocorp)
exten => _NXXNXXXXXX,n,Dial(SIP/centurylink-out/${EXTEN},45)
exten => _NXXNXXXXXX,n,Hangup

 

The next example is inbound calls to the arbitrarily named ‘from-pstn’ context.  I’m making up fake number range, the real ones will obviously be given sent by your account rep.  Do not use your TN number as a DID or in the CallerID!  The TN number is the 10 digit number that identifies your specific SIP Trunk.  In this example it is 2063225040.  This is not a usable number.  In my example below I will use the next number in sequence, 2063225041.

/etc/asterisk/extensions.conf:

[from-pstn]

;Inbound call to 206-322-5041 sent to SIP ext. 1888, VM, & finally hangup.
exten =>  2063225041,NoOp(===  Incoming Centurylink IQ SIP TRUNK Call ===)
exten =>  2063225041,1,Answer()
exten =>  2063225041,n,Dial(SIP/1888,25)
exten =>  2063225041,n,Voicemail(1888,u)
exten =>  2063225041,n,Hangup()

 

Hosts Mapping (/etc/hosts)

The last step is to specifically define the host ‘voip.centurylink.com’.  The host name(voip.centurylink.com) resolves to a different server then the actual upstream Broadworks registrar.  If you do not change your hosts file the service will not work.

example:

[matt@mattcom1 Desktop]$ nslookup voip.centurylink.com
[matt@mattcom1 Desktop]$ nslookup voip.centurylink.com
Server: 4.2.2.2Address: 4.2.2.2#53

Non-authoritative answer:
voip.centurylink.com canonical name = f5-voip-dmz.centurylink.com.Name: f5-voip-dmz.centurylink.com
Address: 155.70.55.192

[matt@mattcom1 Desktop]$

Why does Centurylink do this?  I have no idea…  it’s very unusual for company this big to misconfigure their own DNS and then ask the customers to work around it!  To fix this we must make a entry in the ‘/etc/hosts’ file.  The IP Address we will use is that of the Session Border Controller from the Centurylink IQ SIP TRUNK info email.  In this case: 210.115.66.11.  The IP address will vary by area.

/etc/hosts file:

210.115.66.11           voip.centurylink.com
127.0.0.1                   localhost.localdomain localhost mattcom1
::1                              localhost6.localdomain6 localhost6

 

I hoped this helps!  Special thanks to my friend and colleague Mike for working with different iterations of code until we had a working model!  He scoured the Cisco directions for Asterisk equivalents plus found the exact string to make the registry work.  A lot of people out there owe you Mike!

This is a add supported site, If you like this article please consider supporting my sponsors.  Have a great day and thanks for reading!

 





No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment