Richard,
Thanks for the tip on the local channel, but I’m not sure I completely understand. I do think I understand that you can use “local/extension” to manuever into any part of the dialplan. What I don’t understandis what I am doing that causes me to use the local channel.
Here is my complete dialplan. Please show me what I could do to avoid using the local channel. Thanks!
[globals]
; MATT - I define most of my variables here.
; Create variables for the phones.
ConniePhone=SIP/Connie
MattPhone=SIP/Matt
MikePhone=SIP/Mike
SarahPhone=SIP/Sarah
ShanePhone=SIP/Shane
; Create a list of all phones
AllPhoneList=${ConniePhone}&${MattPhone}&${MikePhone}&${SarahPhone}&${ShanePhone}
; Create a variable for the phones that should ring when an outside trunk rings in.
TrunkRinginPhoneList=${AllPhoneList}
; Create variables for the trunks.
Trunk1=Zap/1
Trunk2=Zap/2
Trunk3=Zap/3
Trunk4=Zap/4
; Create a variable for the general mailbox. Note that this should match the mailbox
; defined in voicemail.conf
VMGeneralMailbox=146
; **************************************
; This is the macro we use to define internal phone extensions.
; ${ARG1} - Device(s) to ring
[macro-InternalPhoneExtension]
exten => s,1,Dial(${ARG1},20,tT) ; Call the extension and let it ring 20
; seconds. Note that either party can
; transfer the call.
exten => s,2,VoiceMail(su${MACRO_EXTEN}) ; If they don’t answer, send the call
; to voicemail. The ‘u’ tells the
; VoiceMail application to play the
; unavailable greeting (‘b’ would tell
; the VoiceMail application to play
; the busy greeting). The ‘s’ tells
; the voicemail application to skip
; the “please leave your message, when
; you have finished…” prompt.
exten => s,3,Hangup() ; Always finish by hanging up just to
; be sure everything cleans up.
exten => s,102,VoiceMail(su${MACRO_EXTEN}) ; If we got to this step, the dial
; command failed, so the user must
; be busy. Note that busy means there
; are no more call appearances available
; on the phone, NOT that the user is
; on another call. Send the call to
; voicemail using the 'u’navailable
; greeting because the 'b’usy greeting
; might be mis-used. The ‘s’ tells
; the voicemail application to skip
; the “please leave your message, when
; you have finished…” prompt.
exten => s,103,Hangup() ; Always finish by hanging up just to
; be sure everything cleans up.
; **************************************
; This is the macro we use to define extensions for leaving voicemail without calling the
; person.
;
; ${ARG1} - voice mailbox number of the extension
[macro-LeaveVoicemail]
exten => s,1,Answer() ; Answer the call in case this is a
; transfer. This gives the party
; that is transferring the call the
; chance to hang up and complete the
; transfer before voice mail
; actually answers.
exten => s,2,Wait(3) ; Wait three seconds in case this is a
; transfer. This gives the party
; that is transferring the call a little
; time to hang up and complete the
; transfer before voice mail
; actually starts playing the greeting.
exten => s,3,VoiceMail(su${ARG1}) ; Call voice mail passing in the proper
; voice mailbox. The ‘u’ tells the
; VoiceMail application to play the
; unavailable greeting (‘b’ would tell
; the VoiceMail application to play
; the busy greeting). The ‘s’ tells
; the voicemail application to skip
; the “please leave your message, when
; you have finished…” prompt.
exten => s,4,Hangup() ; Always finish by hanging up just to
; be sure everything cleans up.
exten => s,104,Hangup() ; Always finish by hanging up just to
; be sure everything cleans up.
; **************************************
; Intercom extensions.
[Internal] ; This is the context we named in sip.conf
include => Outgoing ; Allow internal users to make outgoing
; calls.
; **************************************
; Create the extensions.
exten => 124,1,Macro(InternalPhoneExtension,${ConniePhone})
exten => 1124,1,Macro(LeaveVoicemail,124)
exten => 165,1,Macro(InternalPhoneExtension,${MattPhone})
exten => 1165,1,Macro(LeaveVoicemail,165)
exten => 169,1,Macro(InternalPhoneExtension,${MikePhone})
exten => 1169,1,Macro(LeaveVoicemail,169)
exten => 175,1,Macro(InternalPhoneExtension,${SarahPhone})
exten => 1175,1,Macro(LeaveVoicemail,175)
exten => 177,1,Macro(InternalPhoneExtension,${ShanePhone})
exten => 1177,1,Macro(LeaveVoicemail,177)
;***************************************
; Create an extension for voicemail main (for checking messages, changing options, etc).
exten => 186,1,VoiceMailMain(s${CALLERIDNUM}) ; The ‘s’ says to skip the voice mail
; prompt, and the CALLERIDNUM tells
; voice mail to log into the caller’s
; mailbox (note that the caller’s
; extension must match his voice
; mailbox number).
exten => 186,2,Hangup() ; Always finish by hanging up.
exten => 186,102,Hangup()
;***************************************
; Create another extension for voicemail main without the mailbox (for calling from
; a different phone or from outside).
exten => 178,1,VoiceMailMain()
exten => 178,2,Hangup() ; Always finish by hanging up.
exten => 178,102,Hangup()
; **************************************
; Public Network interface extensions.
[PublicNetworkRingin] ; This is the context we named in
; zapata.conf
exten => s,1,Dial(${TrunkRinginPhoneList}, 20, t) ; This is the action that takes place
; when a public network device rings in.
; We dial all of the destinaton devices
; for 20 seconds. If one answers,
; Asterisk bridges the caller to the
; answering device. The “t” option allows
; the answering device to transfer the
; call.
exten => s,2,Dial(Voicemail(su${VMGeneralMailbox})) ; After 20 seconds, send the call to the
; general mailbox. The ‘u’ tells the
; VoiceMail application to use the
; unavailable greeting, the ‘s’ tells
; the VoiceMail application to skip
; the built in prompt.
exten => s,3,Hangup() ; If we get here, something went wrong.
exten => s,102,Hangup() ; Terminate the call.
;********************************************************************************************
; Outgoing calls.
[Outgoing]
;********************************************************************************************
ignorepat => 9 ; When Asterisk is interpreting digits
; (such as during a transfer), this
; tells Asterisk to continue playing
; dialtone even after a ‘9’ is dialed.
;********************************************************************************************
; 911
exten => 911,1,Dial(${Trunk1}/w${EXTEN}&${Trunk2}/w${EXTEN}&${Trunk3}/w${EXTEN}&${Trunk4}/w${EXTEN},T)
; If somebody dials 911, we seize
; one of the outbound trunks and
; dial 911.
; Note the “w” before the number to
; dial. We put this in because the
; FXO channels on the TDM400 were
; dialing the digits before the central
; office was returning dialtone (so
; leading digits were being lost).
; Each “w” causes the TDM400 to “wait”
; 1/2 second, so we put in a
; 1/2 second wait to prevent the
; problem.
exten => 911,2,Hangup() ; Always finish by hanging up.
exten => _9X,102,congestion(5) ; All lines must be busy. Indicate
exten => _9x,103,Hangup() ; congestion for 5 seconds then hangup.
;********************************************************************************************
; 9 followed by a number
exten => _9X.,1,Dial(${Trunk1}/w${EXTEN:1}&${Trunk2}/w${EXTEN:1}&${Trunk3}/w${EXTEN:1}&${Trunk4}/w${EXTEN:1},T)
; Dialing 9 followed by at least one
; digit causes us to seize one of the
; outbound trunks and dial all of the
; numbers following the leading 9.
; Note the “w” before the number to
; dial. We put this in because the
; FXO channels on the TDM400 were
; dialing the digits before the central
; office was returning dialtone (so
; leading digits were being lost).
; Each “w” causes the TDM400 to “wait”
; 1/2 second, so we put in a
; 1/2 second wait to prevent the
; problem.
exten => _9X.,2,Hangup() ; Always finish by hanging up.
exten => _9X,102,congestion(5) ; All lines must be busy. Indicate
exten => _9x,103,Hangup() ; congestion for 5 seconds then hangup.