; extensions.conf - the Asterisk dial plan ; ; Static extension configuration file, used by ; the pbx_config module. This is where you configure all your ; inbound and outbound calls in Asterisk. ; ; This configuration file is reloaded ; - With the "extensions reload" command in the CLI ; - With the "reload" command (that reloads everything) in the CLI ; ; The "General" category is for certain variables. ; [general] ; static=yes writeprotect=no [globals] NPX=0131 ; local area code [default] ; the reason i break these out in to separate [sections] ; is so that they can be excluded/included by commenting out ; one line. Makes debugging a lot easier. include => util_numbers include => internal_phones include => voipfone include => sipgate include => inbound ;include => fromvoipfone include => test [internal_phones] exten => 1006,1,Dial(SIP/james2, 20) exten => 1005,1,Dial(SIP/james, 20) exten => 1007,1,Dial(SIP/line1, 20, wWm) exten => 121, 1, VoiceMailMain(1007) exten => 121, 2, Hangup() [voipfone] exten => ._,1,Dial(SIP/james) [sipgate] ;exten => _9|[2-9].,1,Goto(${NPX}Dial(SIP/${EXTEN:1}@sipgate,30,tr) ;exten => _9|[2-9].,2,Playback(invalid) ;exten => _9|[2-9].,3,Hangup exten => _9.,1,Dial(SIP/${EXTEN:1}@sipgate,30,tr) exten => _9.,2,Playback(invalid) exten => _9.,3,Hangup [inbound] ;[fromvoipfone] ;exten=>work,1,Answer ;exten=>work,2,Wait(2) ;exten=>work,3,Monitor(wav, myfile) ;exten=>work,4,Playback(connecting) ;exten=>work,5,SetCallerID("Work Calling") ;exten=>work,6,Wait(1) ;exten=>work,7,Goto(inbound,calls,1) exten=>calls,1,Dial(SIP/james&SIP/james2&SIP/line1,30) ;exten=>calls,2,Monitor(wav,/var/spool/asterisk/monitor/inside,b) exten=>calls,3,Answer exten=>s,4,Playback(beep) exten=>calls,5,Wait(1) exten=>calls,6,Voicemail(u1007) exten=>calls,7,Hangup exten=>s,1,SetCallerID("Main Line ${CALLERIDNUM}" <${CALLERIDNUM}>) exten=>s,2,Goto(inbound,calls,1) exten=>_X.,1,SetCallerID("Main Line ${EXTEN}" <${CALLERIDNUM}>) exten=>_X.,2,Goto(inbound,calls,1) [test] extension=>100,1,AGI(hello.php) extension->100,2,Hangup() ;[general] ;static=yes ;writeprotect=no ;[default] ; the reason i break these out in to separate [sections] ; is so that they can be excluded/included by commenting out ; one line. Makes debugging a lot easier. ;include => external_sip ;include => util_numbers ;include => internal_phones ;include => voicemailboxes ;[internal_phones] ;My internal phones ;exten => 5010,1,Dial(SIP/5010,30) ;exten => 5010,2,Voicemail(u5010) ; SIP Hardphone 5010: rings for 30 seconds, then ; goes to voicemailbox 5010 ;exten => 5012,1,Dial(SIP/5012,30) ;exten => 5012,2,Voicemail(u5012) ; SIP ATA 5012: rings for 30 seconds, then ; goes to voicemailbox 5012 [voicemailboxes] ;main mailbox menu exten => 5000,1,VoicemailMain exten => 5000,2,Hangup ; dial 5000 for voicemail [outgoing_sipgate] include => default ; dial 9 for an outside line (via Sipgate) ; needs to be in its own context for security porpoises exten => _9.,1,Dial(SIP/${EXTEN:1}@sipgate,30,tr) exten => _9.,2,Playback(invalid) exten => _9.,3,Hangup [external_sip] ; dial 5014 to speak to Jasper Ragworth, over SIP exten => 5014,1,Dial(SIP/jasrag@examplename.plus.com) exten => 5014,2,Playback(invalid) exten => 5014,3,Hangup ;sipgate stuff... [daytime_sipgate] ; replace 1234567 with your sipgate ID exten => 1234567,1,NoOp(--- ${CALLERID} calling on sipgate (${EXTEN}) ---) exten => 1234567,2,Dial(SIP/5010&SIP/5012,30) ; extensions 5010 and 5012 ring on incoming calls from sipgate. ; Goes to voicemail after 30 seconds exten => 1234567,3,Answer exten => 1234567,4,Wait,1 exten => 1234567,5,Voicemail(u5010) ; voicemail goes to 5010's mailbox exten => 1234567,6,hangup [night_sipgate] ; diverts all calls to voicemail exten => 1234567,1,NoOp(--- ${CALLERID} calling on sipgate (${EXTEN}) ---) exten => 1234567,2,Answer exten => 1234567,3,Wait,1 ; need to record night message and play here exten => 1234567,4,Voicemail(u5010) exten => 1234567,5,hangup [incoming_sipgate] include => daytime_sipgate|7:00-23:00 ; between 0700 and 2300, uses daytime_sipgate include => night_sipgate|23:01-6:59 ; between 2301 and 0659, use night_sipgate. ; Can specify days/weeks/months also. ; Extension for handling SMS. [smsdial] exten => _X.,1,SMS(${CALLERIDNUM},s,${EXTEN},${CALLERIDNAME }) exten => _X.,2,SMS(${CALLERIDNUM},s) exten => _X.,3,Hangup ; I have a small CGI page that lets me send SMS to one of the external ; extensions ; utility numbers ; various utilities, as a demo of asterisk's capabilities. ; Probably irrelevant in this digital telephony age. [util_numbers] include => onesevenohsevenoh include => onetwothree include => onetwofour ; this bit is here so that one only has to include => one thing ; up in [default] ^ [onesevenohsevenoh] ; 17070 is bt's line test facility, reads out your number ; we don't need line test, but this is here to say what extension is calling ; pointless but nice exten => 17070,1,Answer exten => 17070,2,Wait(1) exten => 17070,3,SayDigits(${CALLERIDNUM}) exten => 17070,4,Hangup [onetwothree] ; 123 is the uk speaking clock exten => 123,1,Answer exten => 123,2,Wait(1) exten => 123,3,SayUnixTime( | | k) exten => 123,4,SayUnixTime( | | M) exten => 123,5,Playback(vm-and) exten => 123,6,SayUnixTime( | | S) exten => 123,7,Playback(seconds) ; downloaded seconds.gsm [amongst others] from ; http://www.loligo.com/asterisk/sounds/ ; tip: search google with filetype:gsm to find .gsm files exten => 123,8,Hangup [onetwofour] ; 124 is the uk speaking hello extension => 124,1,AGI(hello.php) extension => 124,2,Hangup