Asterisk 14: Build: Ubuntu/Debian
Below are the steps to building asterisk 14.6.0 on a Debian/Ubuntu
The current build was done on Ubuntu 16.04.2 LTS.
This is a vanilla install of Asterisk 14, with no Web Interface or extra features.
Let's start by running these commands:
apt-get install build-essential
apt-get install git-core subversion libjansson-dev sqlite autoconf automake libtool libxml2-dev libncurses5-dev
Now you are able to download asterisk 14 and compile it.
cd /usr/src/
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-14-current.tar.gz
tar xzvf asterisk-14-current.tar.gz
cd asterisk-14.6.0/
./contrib/scripts/install_prereq install
./bootstrap.sh
./configure
make && make install
make samples
make config
systemctl start asterisk
Now asterisk should already be running and you can log in with this command:
asterisk -r
In this example below the BLF feature it's configured for 3 SIP Zoiper phones (extensions).
First in the sip.conf file we have these records:
[555]
type=friend
regexten=555
secret=555
callerid="Jane Smith" <555>
subscribecontext=localextensions
host=dynamic
context=users
hassip = yes
directmedia=yes
disallow=all
allow=ulaw
allow=alaw
callevents=yes
accept_outofcall_messages=yes
auth_messages_request=no
outofcall_message_context=dpma_message_context
allowsubscribe=yes
callcounter=yes
notifyringing=yes
notifyhold=yes
callevents=yes
limitonpeer=yes
subscribecontext=BLF
busylevel=1
[333]
type=friend
callerid="John Snom" <333>
secret=333
regexten=333
subscribecontext=localextensions
language=en
context=users
hassip = yes
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
callevents=yes
accept_outofcall_messages=yes
auth_messages_request=no
outofcall_message_context=dpma_message_context
allowsubscribe=yes
callcounter=yes
notifyringing=yes
notifyhold=yes
callevents=yes
limitonpeer=yes
subscribecontext=BLF
busylevel=1
[444]
type=friend
regexten=444
secret=444
callerid="Mitko Palauzov" <444>
subscribecontext=localextensions
host=dynamic
context=users
hassip = yes
directmedia=yes
disallow=all
allow=gsm
allow=ulaw
allow=alaw
callevents=yes
accept_outofcall_messages=yes
auth_messages_request=no
outofcall_message_context=dpma_message_context
allowsubscribe=yes
callcounter=yes
notifyringing=yes
notifyhold=yes
callevents=yes
limitonpeer=yes
subscribecontext=BLF
Second in the extensions.conf we have these records:
[BLF]
exten => _X.,hint,SIP/${EXTEN}
[users]
exten => _X.,1,Dial(SIP/${EXTEN})
exten => _X.,n,Hangup
If all is configured and work correctly the signalling flow should be like this:
SUBSCRIBE sip:666@10.7.173.25:5060 SIP/2.0.
Via: SIP/2.0/UDP
10.2.4.38:7060;branch=z9hG4bK-524287-1---31ac4b589f877ec4;rport.
Max-Forwards: 70.
Contact: <sip:444@10.2.4.38:7060;transport=UDP>.
To: <sip:666@10.7.173.25;transport=UDP>;tag=as3acb34c0.
From: <sip:444@10.7.173.25;transport=UDP>;tag=f87ca241.
Call-ID: Iw5-6iiAANra37alagT4mg...
CSeq: 8 SUBSCRIBE.
Expires: 60.
Accept: application/dialog-info+xml.
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO,
SUBSCRIBE.
User-Agent: Z 5.1.7 rv2.8.51.
Authorization: Digest
username="444",realm="asterisk",nonce="1004db6c",uri="sip:666@10.7.173.25:5060",response="fb6f2b0b99f31cdd8fd26797a8bb7f49",algorithm=MD5.
Event: dialog.
Allow-Events: presence, kpml, talk.
Content-Length: 0.
.
U 2017/08/08 16:59:22.247421 10.7.173.25:5060 -> 10.2.4.38:7060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP
10.2.4.38:7060;branch=z9hG4bK-524287-1---31ac4b589f877ec4;received=10.2.4.38;rport=7060.
From: <sip:444@10.7.173.25;transport=UDP>;tag=f87ca241.
To: <sip:666@10.7.173.25;transport=UDP>;tag=as3acb34c0.
Call-ID: Iw5-6iiAANra37alagT4mg...
CSeq: 8 SUBSCRIBE.
Server: Asterisk PBX 14.6.0.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH, MESSAGE.
Supported: replaces, timer.
Expires: 60.
Contact: <sip:666@10.7.173.25:5060>;expires=60.
Content-Length: 0.
.
U 2017/08/08 16:59:22.247527 10.7.173.25:5060 -> 10.2.4.38:7060
NOTIFY sip:444@10.2.4.38:7060;transport=UDP SIP/2.0.
Via: SIP/2.0/UDP 10.7.173.25:5060;branch=z9hG4bK02b16c09;rport.
Max-Forwards: 70.
From: <sip:666@10.7.173.25;transport=UDP>;tag=as3acb34c0.
To: <sip:444@10.7.173.25;transport=UDP>;tag=f87ca241.
Contact: <sip:666@10.7.173.25:5060>.
Call-ID: Iw5-6iiAANra37alagT4mg...
CSeq: 104 NOTIFY.
User-Agent: Asterisk PBX 14.6.0.
Subscription-State: active.
Event: dialog.
Content-Type: application/dialog-info+xml.
Content-Length: 202.
.
<?xml version="1.0"?>
<dialog-info xmlns="urn:ietf:params:xml:ns:dialog-info" version="2"
state="full" entity="sip:666@10.7.173.25">
<dialog id="666">
<state>terminated</state>
</dialog>
</dialog-info>
U 2017/08/08 16:59:22.250441 10.2.4.38:7060 -> 10.7.173.25:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 10.7.173.25:5060;branch=z9hG4bK66765060;rport=5060.
Contact: <sip:444@10.2.4.38:7060;transport=UDP>.
To: <sip:444@10.7.173.25;transport=UDP>;tag=256abe40.
From: <sip:666@10.7.173.25;transport=UDP>;tag=as6415064a.
Call-ID: RQv-LXjxGNcrHxmHSBONHg...
CSeq: 104 NOTIFY.
User-Agent: Z 5.1.7 rv2.8.51.
Content-Length: 0.