; extensions.conf - the Asterisk dial plan ; ; Many comments and latent configuration directives deleted... see ; .orig files for comments and original samples. ; ; Modified from the Distro, K. M. Peterson, May 2013 ; http://kmpeterson.com/special/bblisa-asterisk [localPlan] ;internal local extensions exten=>201,1,Dial(SIP/phone1,20) same=>n,VoiceMail(201@voiceMail,u) exten=>202,1,Dial(SIP/ata,20) same=>n,VoiceMail(202@voiceMail,u) exten=>500,1,answer(500) same=>n,VoiceMailMain(@voiceMail) ; Misc and Demos exten=>811,1,Answer(500) exten=>811,n,Playback(tt-monkeys) same=>n,Hangup() [localDialOut] ; External dialing exten=>_NXXNXXXXXX,1,Log(NOTICE,"Internal extension dialed out ${EXTEN}, ID=${SIPCALLID}") same=>n,Set(CALLERID(num)=6175551212) same=>n,Set(CALLERID(name)="K M PETERSON") same=>n,Dial(SIP/1${EXTEN}@trunkingProvider,75,r) [speedDial] ; Speed Dial Codes exten=>3,1,Set(CALLERID(num)=6175551212) same=>n,Set(CALLERID(name)="KMP Home") same=>n,Dial(SIP/16179361234@trunkingProvider,75,r) [localHome] include=>speedDial include=>localPlan include=>localDialOut [incomingTrunk] exten=>16175551212,1,Log(NOTICE,"Incoming call, Id=${CALLERID(num)}/${SIPCALLID}") exten=>16175551212,2,Goto(incomingTrunk,start,1) ; In case call came in without our number, log it… same=>n,Log(NOTICE,"Incoming call, Src=Uncaught, Id=${CALLERID(num)}") same=>n,Hangup() exten=>start,1,Goto(publicIncoming,start,1) [publicIncoming] ; Main menu for public incoming calls exten=>start,1,Background(local/welcome) same=>n,Log(NOTICE,"Playing welcome message.") exten=>retry,1,Background(local/msg-genMenu) same=>n,WaitExten(5) exten=>1,1,Goto(ringDeskPublic,start,1) exten=>8,1,VoiceMail(201@voiceMail,u) exten=>0,1,Goto(youHaveTheWrongGuy,start,1) exten=>i,1,Log(NOTICE,"Invalid response to main menu,") exten=>t,1,Log(NOTICE,"Timeout in main menu,") same=>n,Playback(invalid) same=>n,Hangup() [ringDeskPublic] ; Calls from public go here to ring desk/house phones exten=>start,1,Dial(SIP/phone1&SIP/ata,30) same=>n,Background(local/msg-voiceMail) same=>n,WaitExten(5) exten=>8,1,VoiceMail(201@voiceMail) exten=>i,1,VoiceMail(201@voiceMail) exten=>t,1,VoiceMail(201@voiceMail) [recordFile] exten=>start,1,Playback(vm-intro) same=>n,Set(FILENAME=${EPOCH}) same=>n,Log(NOTICE,"A recording is being stored, with the filename ${FILENAME}") same=>n,Record(/tmp/asterisk-message-${FILENAME}.wav) same=>n,Wait(2) same=>n,Playback(/tmp/asterisk-message-${FILENAME}) same=>n,Hangup [youHaveTheWrongGuy] exten=>start,1,Answer() same=>n,Log(NOTICE,"Info/explanation extension dialed.") same=>n,Playback(local/sorry-explanation) same=>n,Playback(silence/5) same=>n,Goto(publicIncoming,retry,1) same=>n,Hangup()