Asterisk PBX

Posted by admin on Sep 25, 2009 in Asterisk |

Well, I’ve got my simple PBX running Asterisk up and running.

First, I used colinux to install Ubuntu on Windows so that I can share the server. Colinux is really a great system and I’m impressed how stable it is.

I installed Asterisk 1.4 using apt-get and decided against a GUI since there were only 3 files to change. extensions.conf, voicemail.conf and sip.conf.

My dialplan looks like this which allows incoming calls to extension 1000 and if not answered, prompt for 5 to transfer to my mobile or hang on for voicemail.

[globals]

[general]
autofallthrough=yes

[default]
exten => s,1,Verbose(1|Incoming call handler)
exten => s,n,Dial(SIP/1000,20)
exten => s,n,Background(ivr)
exten => s,n,WaitExten(5)
exten => s,n,Voicemail(1000)
exten => s,n,HangUP()

exten => 5,1,Verbose(1|Diversion to mobile)
exten => 5,n,Dial(SIP/sip_proxy/mymobilenumber)
exten => 5,n,HangUP()
exten => t,1,Voicemail(1000)
exten => t,n,HangUP()

exten => i,1,Voicemail(1000)
exten => i,n,HangUP()

[outgoing_calls]
exten => _X.,1,NoOp()
exten => _X.,n,Dial(SIP/sip_proxy/${EXTEN})

[internal]
exten => 1000,1,Verbose(1|Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()

exten => 2000,1,Verbose(1|Extension 2000)
exten => 2000,n,Dial(SIP/2000,30)
exten => 2000,n,Hangup()

exten => 9999,1,Verbose(1|Listen to voicemail)
exten => 9999,n,VoiceMailMain(1000)
exten => 9999,n,Hangup()

[phones]
include => internal
include => outgoing_calls

I have 2 ATAs configured as the extensions 1000 (Linksys 3102) and 2000 (Grandstream Handytone 486) and these are on my engin VoIP service. sip.conf looks like this.

[1000]
; Office (Linksys 3102)
disallow=all
allow=ulaw
allow=alaw
canreinvite=no
context=phones
dtmfmode=rfc2833
host=dynamic
incominglimit=1
nat=never
;port=5060 ; we could use port 5061 rather than 5060
qualify=yes
secret=password
type=friend
username=1000 

[2000]
; Home phone (Grandstream)
disallow=all
allow=ulaw
canreinvite=no
context=phones
dtmfmode=rfc2833
host=dynamic
incominglimit=1
nat=never
qualify=yes
secret=password
type=friend
username=2000 

[sip_proxy]
context=default
type = peer
allow=ulaw
allow=alaw
canreinvite=no
dtfmmode=rfc2833
fromuser=myphonenumber
host=apollo.engin.com.au
fromdomain=apollo.engin.com.au
outboundproxy=apollo.engin.com.au
realm=voice.mibroadband.com.au
insecure=invite,port
secret=password
username=myphonenumber

Voicemail is the default IVR which didn’t need much except I’m using ssmtp instead of sendmail.

Leave a Reply

XHTML: You can use these tags:' <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Copyright © 2008-2018 Brinsmead Data Services All rights reserved.