Configuration
Getting Started
My first goal with Asterisk was to try and get two softphones working, calling each other. I had a quick search and decided, for no particular reason, on the free X-lite SIP softphone from the confusingly URL-ed CounterPath Solutions. I have a decent Logitech USB headset on one PC and regular speakers on another so this should work fine for testing.
Supporting Analog Phones
I also decided on getting a Sipura SPA-3000 for AU$153. The SPA-3000 has a FXS socket (for plugging analog phones into) a FXO socket (for plugging into the PSTN wall socket) and an Ethernet port. The idea is that your regular analog phone can be connected to a VoIP provider with SIP for making some calls, and when that fails, or if the regular copper wire PSTN telco has better rates then it can make use of the FXO connection to dial out. Another advantage is that it may provide some capability to obtain emergency 000 access if VoIP providers don’t offer it.
I have an old Telstra “Access 35″ analog speakerphone, which I plugged into the SPA-3000. I plugged the SPA-3000 into the WRT54G and it obtained an IP address. I configured the router to allocate the SPA a static IP address and a hostname and power-cycled the SPA. All good.
A VoIP Service Provider
After shopping around for 10 minutes on the web, I decided on risking AU$20 with OzTell (www.oztralia.com)
First Steps with Asterisk
Running FreeBSD, it doesn’t look like there is a convenient port of AMP for the platform, so I hunkered down and started working on understanding the *.conf files.
I configured Asterisk so that the Sipura could call the Softphone and vice versa. This took a long time of researching options within the *.conf files, and hunting and grepping around them. The problem is mostly to do with the wealth of examples and very verbose comments in the default set of configuration files. I recommend deleting pretty much everything and starting from scratch. Once I did this, and hunted around the net for some examples, then things sped up somewhat.
Now I have two extensions, 2000 for the Sipura and 2001 for the softphone. Calls incoming through OzTell arrive at an IVR menu, where callers are asked to press 1 to ring the phone, 2 to leave a message to me and 3 to leave a message for my spouse. Extension 205 is used for recording messages to use in IVR options.
I need to go back and find/remember who I owe thanks for stealing some of these dialplans and macros. I also need to do more research into making the addition of extensions and voice mailboxes more automated.
More Tasks
[TBD] I’d like to get a caller guard going on, to ward off pesky telemarketers. The call flow would be like this:
Receive call and say "Please type the secret code now or say your name after the beep"
Wait 5 seconds
If the person enters 1234
then
ring the phone and fall through to voice mail if there is no answer.
Else
record the person saying their name
thank them and play them hold music
if it's core phone-answering hours
then
ring the phone
read the name out to the person answering and let them choose whether to talk to the caller or hangup
else
drop the call into voice mail
fi
fi
sip.conf
[general]
context=default
port=5060
bindaddr=0.0.0.0
srvlookup=yes
[2001]
type=friend
secret=password
host=dynamic
canreinvite=no
callgroup=1
pickupgroup=1
username=myname
context=localsip
[2000]
type=friend
secret=password
host=dynamic
canreinvite=no
callgroup=1
pickupgroup=1
canreinvite=no
username=sipura
context=localsip
iax.conf
XXXXXXXX = the “OzNumber”
YYYYYY = the PIN
[general]
disallow=all
allow=ilbc
allow=g729
allow=ulaw
allow=g726
register => 899060XXXXXXXX:YYYYYY@iax.oztralia.com
[899060XXXXXXXX]
type=friend
context=fromoztel
host=iax.oztralia.com
extensions.conf
[globals]
OZTELUSER=899060XXXXXXXX
OZTELPASS=YYYYYY
[oztel]
; send all numbers starting with 899 to oztel
exten => _899.,1,Macro(oztel,${EXTEN},70)
[macro-oztel]
exten => s,1,SetCallerID(”${OZTELUSER}” < ${OZTELUSER}>)
exten => s,2,Dial(IAX2/${OZTELUSER}:${OZTELPASS}@iax.oztralia.com/${ARG1},${ARG2})
exten => s,3,Hangup
[outgoing-pstn-oztel]
; send 10 digit numbers starting with 02 or 03 to oztel
; also send 13 and 1800 numbers to oztel
exten => _0[23478]XXXXXXXX,1,Macro(oztel,61${EXTEN:1},70)
exten => _9XXXXXXX,1,Macro(oztel,612${EXTEN},70)
exten => _1800.,1,Macro(oztel,61${EXTEN},70)
exten => _13.,1,Macro(oztel,61${EXTEN},70)
exten => _09.,1,Macro(oztel,${EXTEN},70)
[outgoing-international]
; send international calls to oztel
exten => _0011ZXXXX.,1,Macro(oztel,${EXTEN:4},70)
[internal]
exten => _2000,1,Goto(mainmenu,s,1)
exten => _2001,1,Dial(SIP/2001)
exten => _3000,1,VoiceMailMain(2000@default)
; UTILITY: Record voice file to /tmp directory
exten => 205,1,Wait(2) ; Call 205 to Record new Sound Files
exten => 205,2,Record(/tmp/asterisk-recording:gsm) ; Press # to stop recording
exten => 205,3,Wait(2)
exten => 205,4,Playback(/tmp/asterisk-recording) ; Listen to your voice
exten => 205,5,wait(2)
exten => 205,6,Hangup
[fromoztel]
exten => s,1,Goto(mainmenu,s,1)
[localsip]
; context for the local sip phones
include => oztel
include => outgoing-pstn-oztel
include => outgoing-international
include => internal
[mainmenu]
exten => s,1,Answer
exten => s,2,SetMusicOnHold(default)
exten => s,3,DigitTimeout,5
exten => s,4,ResponseTimeout,10
;Personal Menu - 1 to ring phone, 2 for voicemail, 3 SO vm
exten => s,5,Background(my-welcome)
exten => s,6,Background(my-options)
; Timeout and invalid conditions
exten => t,1,Goto(s,6)
exten => i,1,Goto(s,6)
; Ring phone
exten => 1,1,Dial(SIP/2000,30,t)
exten => 1,2,Goto(s,6)
; Leave Voicemail for chris
exten => 2,1,VoiceMail(2000@default)
exten => 2,2,Hangup()
; Leave Voicemail for SO
exten => 3,1,VoiceMail(2001@default)
exten => 3,2,Hangup()
voicemail.conf
;
; Voicemail Configuration
;
[general]
format=wav49|gsm|wav
serveremail=asterisk
review=yes
attach=yes
maxmessage=180
minmessage=3
maxgreet=60
skipms=3000
maxsilence=10
silencethreshold=128
maxlogins=3
; Replace sendmail with ssmtp at Girtby’s recommendation…
mailcmd=/usr/local/sbin/ssmtp -t
sendvoicemail=yes
; I haven't been brave enough to delete these yet...
[zonemessages]
eastern=America/New_York|’vm-received’ Q ‘digits/at’ IMp
central=America/Chicago|’vm-received’ Q ‘digits/at’ IMp
central24=America/Chicago|’vm-received’ q ‘digits/at’ H ‘digits/hundred’ M ‘hours’
[default]
; YYYYY = PIN/password for VM
2000 => YYYYY,Myname,Myname@gmail.com,,attach=yes
2001 => YYYYY,SOname,SOname@gmail.com,,attach=yes






A VoIP Solution is undoubtledly the wave for the
Roy King | 5-Nov-2007A VoIP Solution is undoubtledly the wave for the future to catch onto. I believe that the majority of possible future user’s are somewhat concerned with some advantages that a VoIP phone system presently offers.
For a VoIP solution to reach the next level, I believe that infrastructure engineers must converge software technology that will allow end user’s to seamlessly switch back temporary to a POTS system when either a decrease in quality of service is noticed or a slow Internet connection has resided. With availabilty to a temporary back-up POTS line, the end user will have the option to activate this service and enjoy the benefits a VoIP solution offers. Finally, a VoIP Phone system will now be able to provide immediate access to 911 emergency service that is a standard on POTS.