VoIP Study and Implementation Asterisk Installation and Configuration Part 2 Version 1.0 – Author : Marc PYBOURDIN / Julien BERTON Last Update : 15/05/2012
Course objectives Ring Groups Call Detail Records Music On Hold IVR Conferences and Text-to- Speech Call parking Interconnecting Asterisk Servers By completing this course, you will see: Asterisk Overview
RING GROUPS Asterisk Installation and Configuration – Part 2
Ring group A ring group is a extension that binds several phones together Multiple strategy can be configured Ring All Round Robin As call strategies are configured like usual extensions, other behavior can be made as well. Extensions.conf
Ring All Strategy 1. A telephone calls the ring group extension 2. All the members of the ring group rings 3. The first member to pick up the phone takes the call Extensions.conf
Round Robin Strategy 1. A telephone calls the ring group extension 2. First member of the ring group rings for a fixed time 3. Then if no answer, rings to another ring group member Can be looped(or not) Extensions.conf
Ring All Ring group configuration Example The administrator wants a number 6600 to be a ring group containing user 6000,6001 and 6002 during 20 seconds. If no answer, go to the voic number Inside the [my_context] context : 6600,1,Dial(SIP/6000&SIP/6001&SIP/6002,20) 6600,3,Hangup() Extensions.conf
Quiz The administrator wants a new ring group(Round Robin), number 6601, still including 6000, 6001, and 6002 inside the internal context. He wants to ring each phone sequentially during 20 seconds in a endlessly manner until someone in the ring group pick-up the phone Create new extension to answer to the question. Use the Goto() application to help you achieve this task. Extensions.conf
Quiz It’d give the following inside [my_context]: 6601,1,Dial(SIP/6000,20) 6601,2,Dial(SIP/6001,20) 6601,3,Dial(SIP/6002,20) 6601,4,Goto(my_context,6601,1) Take care about infinite loops here! If no phone are available(technically SIP registered to Asterisk), the extension will crash. Extensions.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
CALL DETAIL RECORDS Asterisk Installation and Configuration – Part 2
CDR (Call Detail Records) Track all calls made through Asterisk including details on them such as : Caller ID, duration of the call, called number,… Export is done by default on a.csv file /var/log/asterisk/cdr-csv/Master.csv Export can be done on MySQL database Configuration can be customized in the cdr.conf file. Cdr.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
MUSIC ON HOLD Asterisk Installation and Configuration – Part 2
Music on Hold Plays music to callers who have been placed on hold. Configured in the /etc/asterisk/musiconhold.conf file. Can plays multiple format(with dependencies) Encoded-codec files(µLaw,aLaw,gsm,…) Live stream (dependency on mpg123) MP3 Files (dependency on mpg123) Musiconhold.conf
Music on Hold [default] mode=files directory=moh [native-random] mode=files directory=moh digit=# sort=random Musiconhold.conf
Music on Hold [native-alphabetical] mode=files directory=moh sort=alpha [ulawstream] mode=custom application=/usr/bin/streamplayer format=ulaw Musiconhold.conf
Quiz Users wants to listen to SupRadio when calling 3000 number. Implement this solution using MoH. Define a new MoH context named « supradio » Use mono rate of 8000 and scale factor of Musiconhold.conf
Quiz Install mpg123 package(using Debian’s aptitude) –apt-get install mpg123 Make a streaming directory and a empty steaming file –mkdir /var/lib/asterisk/mohmp3/stream && touch /var/lib/asterisk/mohmp3/stream/stream.mp3 Musiconhold.conf
Quiz Create a MusicOnHold class named « supradio ». [supradio] mode=custom directory=/var/lib/asterisk/mohmp3/stream application=/usr/bin/mpg123 -q -r f s --mono Define extension 3000 in current extension context exten => 3000,1,Answer() exten => 3000,2,MusicOnHold(supradio) Musiconhold.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
IVR Asterisk Installation and Configuration – Part 2
IVR (Interactive Voice Response) Allows administrator to offer to callers an automated voice response system(very useful to guide automatically users in the right service). To configure this feature, it is important to have in mind the IVR scenario(what’ll be this behavior). Configuration can be done in the extensions.conf file. Extensions.conf
IVR The administrator wants to obtain an IVR that’ll do the following : An IVR number 7000 IVR scenario: 1. User call the IVR number 2. IVR plays the welcome message with propositions: –Press 1 to contact the IT service –Press 2 to contact the Accounting service –Press 3 to contact the Factory service 3. IVR listen for a digit and redirect the user 4. If user don’t press a digit or press the wrong digit, redirect him to the welcome message Extensions.conf
IVR In extensions.conf file, we’ll need to create two elements The IVR number in your internal context 7000,1,Goto(ivr_context,s,1) A new context for IVR [ivr_context] s,1,Answer() s,2, Set(TIMEOUT(response)=10) ;if answer >= 10s, goto ‘t’ ext. s,3,Playback(welcome-prompt) ;customized prompt if wished 1,1,Dial(SIP/6610) ;IT service ring group 2,1,Dial(SIP/6611) ;Accouting ring group 3,1,Dial(SIP/6612) ;Factory ring group _[04-9*#],1,Goto(ivr_context,s,1) ;incorrect digits t,1,Goto(ivr_context,s,1) ;if timeout, start again Extensions.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
VOICE PROMPTS AND TEXT-TO- SPEECH Asterisk Installation and Configuration – Part 2
Voice Prompt IVR needs to announce voice prompts to callers –Guide caller to the right service –Notify opening days and hours –Inform caller Voice prompt can be –recorded –live-generated Extensions.conf
Text-To-Speech Text-To-Speech is a technique of converting string of characters to voice element With Asterisk, you can use several ways to implement it such as –Festival –eSpeak –GoogleTTS Extensions.conf
GoogleTTS implementation GoogleTTS is a independant AGI/Perl- based script –render text to speech using Google’s voice synthesis engine –supports several languages(english, french, chinese, greek,…) Server needs to be connected to the Internet. Extensions.conf
GoogleTTS implementation Installation of dependencies on Debian –apt-get perl libwww-perl sox mpg123 Grab last version of the script –wget -o GoogleTTS.tar googletts/tarball/masterhttp://github.com/zaf/asterisk- googletts/tarball/master Decompress and install it in the right directory –tar –xvf GoogleTTS.tar && cd zaf-asterisk-googletts-51c2db5 && cp googletts.agi /var/lib/asterisk/agi-bin/ Extensions.conf
GoogleTTS implementation Extension call syntax –agi(googletts.agi,text,[language],[intkey]) Sample extension –[internal_context] exten => 1337,1,Answer() exten => 1337,2,agi(googletts.agi,"Space Court. For people in space. Judge space sun presiding!",en) exten => 1337,3,agi(googletts.agi,"Bam. Guilty. Of being in space. I’m in space.",en) exten => 1337,4,Hangup() Extensions.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
CONFERENCES WITH ASTERISK Asterisk Installation and Configuration – Part 2
MeetMe MeetMe is a conference room system integrated with Asterisk It allows administrator to offer to callers conference rooms to organize meeting, brainstorming, … To use this feature, keep in mind that DAHDI is mandatory(even if you don’t have hardware cards). Configuration can be done in the meetme.conf and extensions.conf files. Meetme.conf
MeetMe To configure MeetMe, you’ll need to create two elements : The conference room in meetme.conf file(under the already existing [rooms] context) conf => 7100 ;open conference conf => 7101,1234 ;conf. with a login password of 1234 conf => 7102,1234,9876; conf. with an admin pass The extension associated with the MeetMe conference in extensions.conf file into your internal context exten => 7100,1,MeetMe(7100) exten => 7101,1,MeetMe(7101) exten => 7102,1,MeetMe(7102) Meetme.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?
CALL PARKING Asterisk Installation and Configuration – Part 2
Call parking Call parking is a feature that can put on hold callers and allow callees to retake the call from every phone Sample scenario can be as described 1. A callee take a call from his desk SIP phone Callee needs to move from his desk to the datacenter in the basement 2. Callee transfer call to parking number which return by synthetised voice the attributed call place 3. Callee got just to call the attributed call place to take again the call Features.conf
Call parking Configured in features.conf and extensions.conf In features.conf, define parking extension and available parking lots [general] parkext => 700 parkpos => context => parkedcalls In extensions.conf, include parking context in your extension context include => parkedcalls Features.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
INTERCONNECTING ASTERISK SERVERS Asterisk Installation and Configuration – Part 2
IAX (Inter-Asterisk eXchange) Allows the administrator to interconnect Asterisk servers to Form trunk between Asterisk server Allow communication between users of differents sites The configuration of this feature can be found in the iax.conf file. Iax.conf
IAX configuration IAX topology that we wants to implement is the following Main objective here is to configure Asterisk servers to allow dial between sites Iax.conf Internet AST-PAR1AST-LIL users users Internet VPN
IAX configuration On Asterisk servers, we’ll have to configure two elements : The IAX configuration itself that include Iogin informations for the remote server register statement for login into the remote server The extension to call the remote site through IAX trunk Iax.conf
IAX configuration On AST-PAR1 : In iax.conf file register => [AST-LIL-1] type=friend host= trunk=yes context=my_context qualify=yes In extensions.conf file in [my_context] _61XX,1,Dial(IAX2/AST-LIL-1/${EXTEN}) _61XX,2,Playtones(congestion) _61XX,3,Congestion() Iax.conf
IAX configuration On AST-LIL1 : In iax.conf file register => [AST-PAR-1] type=friend host= trunk=yes context=my_context qualify=yes In extensions.conf file in [my_context] _60XX,1,Dial(IAX2/AST-PAR-1/${EXTEN}) _60XX,2,Playtones(congestion) _60XX,3,Congestion() Iax.conf
IAX configuration Once you’ve configured the IAX trunk, you’ll able to place calls between sites using the IAX trunk. You can verify the IAX trunk status in the Asterisk console with commands : iax show peers iax show registry Iax.conf
Demonstration Show how to implement this solution on Asterisk and test it Extensions.conf
Any questions?