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)




How to connect Asterisk SIP Clients over Duel Layers of NAT

A common problem with SIP is it’s difficulty handling NAT(especially over multiple layers).  A common symptom is no audio stream.  The Asterisk CLI  shows a successful call connection succeeding followed by an error in /var/log/asterisk/messages:

[Jun 14 17:16:26] WARNING[2967] chan_sip.c: Retransmission timeout reached on transmission 4e2a8586-3a91c1cf-e73f6b64@ for seqno 2 (Critical Response) — See
Packet timed out after 6399ms with no response



Asterisk: Creating an Extension to Logout Agents from CallerID

I told a customer for the company I for that I would figure out how to logout agents by CID(Caller ID). So I figured, why not kill two birds with one stone. Today we will create a single Queue, Agent, and dial plan to accomplish this goal. I’m using Asterisk 1.4, Fedora 10 and a Polycom IP SIP phone for my demonstration purposes.

When I started this project four hours ago, I thought I would google my way to another successful blog post(and happy customer), but no…  logging out agents in Asterisk is very unintuitive.  The agentcallbacklogin utility has the exact same prompts for logging in as out.  AgentCallbackLogin (when initiated, from the dial plan)  asks for three things, agent, agent password, and call back number.  To eliminate all these prompts I’m using the ‘$CallerID(num)’ variable to automatically answer the agent and call back number.  So the user 8888 dials ‘1000’ and and AgentCallbackLogin assumes he is AGENT/8888 with a password of ‘8888’.

from /etc/asterisk/extensions.conf

exten => 1000,1,AgentcallbackLogin(${CALLERID(num)}||${CALLERID(num)}@savelono-queue-out)
exten => 1000,n,hangup



sip.conf – agent logoff example


context=default                 ; Default context for incoming calls
;allowguest=no                  ; Allow or reject guest calls (default is yes)
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
;allowtransfer=no               ; Disable all transfers (unless enabled in peers or users)

bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
; bindport is the local UDP port that Asterisk will listen on

bindaddr=                ; IP address to bind to ( binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls

; Note: Asterisk only uses the first host
; in SRV records
; Disabling DNS SRV lookups disables the

type=friend                    ; Friends place calls and receive calls
context=from-sip               ; Context for incoming calls from this user
host=dynamic                   ; This peer register with us
dtmfmode=rfc2833               ; Choices are inband, rfc2833, or info