IVR and looping without voicemail

Hi, I have an asterisk-14.7.5 installation on fedora27 that I inherited from many years ago. I’m somewhat familiar with the configuration, but need help to configure it so it doesn’t drop to voicemail by default.

The problem is that we receive dozens of fax calls per day that just keep going through the voice prompts then leave a 2m voicemail. I think I’d like to have the system just loop once through the menu, allowing a real caller to make a selection, but then eventually hangup for those who don’t choose an option.

Below is my relevant extensions.conf settings.

[mainmenu-day]
exten           =>   _1NXXNXXXXXX,1,Answer
exten           =>   _1NXXNXXXXXX,2,Ringing
exten           =>   _1NXXNXXXXXX,3,Wait(1)     ; ring before IVR starts
exten           =>   _1NXXNXXXXXX,4,Set(TIMEOUT(digit)=2)
exten           =>   _1NXXNXXXXXX,5,Background(local-mainmenu-day)
exten           =>   _1NXXNXXXXXX,n,WaitExten(4)    ; Wait for an extension to be dialed.

exten           =>   _1NXXNXXXXXX,6,Set(CALLERID(all)=0 - ${CALLERID(name)} <${CALLERID(num)}>)
exten           =>   _1NXXNXXXXXX,9,Hangup

Is there something I need to insert before the Hangup line at the end to have it loop once?

What do other people do to solve this fax problem? They’re also calling on our 800 numbers, so it costs us money.

I thought it might be helpful to have a whole copy of our extensions.conf. Please find it below.

[general]
static		= yes
writeprotect	= no
[globals]
VOICEPULSE_TRUNK01	= voicepulse-primary
VOICEPULSE_TRUNK02	= voicepulse-secondary
[macro-stdexten]
exten		=> s,1,Dial(${ARG1},20,tr)
exten		=> s,2,Goto(s-${DIALSTATUS},1)
exten		=> s-NOANSWER,1,Voicemail(${ARG2}@local,u)	; No answer.
exten		=> s-NOANSWER,2,Hangup
exten		=> s-BUSY,1,Voicemail(${ARG2}@local,b)		; Phone busy.
exten		=> s-BUSY,2,Hangup
exten		=> _s-.,1,Playback(invalid)		; Channel unavailable.
exten		=> _s-.,2,Goto(incoming,_1NXXNXXXXXX,4)
[macro-shitlist]
exten		=> s,1,Answer
exten		=> s,2,Congestion
exten		=> s,3,Hangup
[local]
exten		=>  7000,1,Macro(stdexten,SIP/7003,7003)
exten		=>  7003,1,Macro(stdexten,SIP/7003,7003)
exten		=>  7004,1,Macro(stdexten,SIP/7004,7004)
exten		=>  8000,1,Goto(incoming,s,1)
exten		=> _8XXX,1,Playback(invalid)
exten		=> _8XXX,2,Goto(incoming,s,1)
exten		=> _9XXX,1,Playback(invalid)
exten		=> _9XXX,2,Goto(incoming,s,1)
exten		=> *86,1,Answer	
exten		=> *86,2,Wait(.5)
exten		=> *86,3,VoicemailMain(@local)
exten		=> *86,4,Hangup
exten		=> *87,1,Answer	
exten		=> *87,2,Wait(.5)
exten		=> *87,3,VoicemailMain(${CALLERID(num)}@local)
exten		=> *87,4,Hangup
exten		=> 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=> 9,2,Directory(local)
exten		=> 9,3,Hangup
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[macro-intercom]
exten		=> s,1,ChanIsAvail(${ARG1},js)
exten		=> s,2,SIPAddHeader(Alert-Info: Ring Answer)
exten		=> s,3,Dial(${ARG1},,)
exten		=> s,4,Hangup
exten		=> t,1,Hangup
exten		=> T,1,Hangup
[intercom]
exten		=> _X.,1,Macro(intercom,SIP/${EXTEN}) 
[testing]
exten		=> 200,1,Goto(mainmenu-day,_1NXXNXXXXXX,1)
exten		=> 201,1,Goto(mainmenu-night,_1NXXNXXXXXX,1)
exten		=> 202,1,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> 203,1,MusicOnHold()
exten		=> 300,1,Answer
exten		=> 300,2,Ringing
exten		=> 300,3,Wait(1)
exten		=> 300,4,Echo
exten		=> 300,5,Hangup
exten		=> 1102,1,Answer
exten		=> 1102,2,Ringing
exten		=> 1102,3,Wait(3)
exten		=> 1102,4,Milliwatt()
exten		=> 1102,5,Hangup
exten		=> 31337,1,ChanSpy(SIP,q)
exten		=> 31337,2,Hangup
[mainmenu-day]
exten		=>   _1NXXNXXXXXX,1,Answer
exten		=>   _1NXXNXXXXXX,2,Ringing
exten		=>   _1NXXNXXXXXX,3,Wait(1) 	; ring before IVR starts
exten		=>   _1NXXNXXXXXX,4,Set(TIMEOUT(digit)=2)
exten		=>   _1NXXNXXXXXX,5,Background(local-mainmenu-day)
exten		=>   _1NXXNXXXXXX,n,WaitExten(4) ; (3)                  ; Wait for an extension to be dialed.
exten		=>   _1NXXNXXXXXX,6,Set(CALLERID(all)=0 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   _1NXXNXXXXXX,9,Hangup
exten		=>   2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   2,2,Queue(sales,t,,,20) 
exten		=>   2,3,Voicemail(7000@local,b)
exten		=>   2,4,Hangup
exten		=>   2,104,Hangup
exten		=>   3,1,Set(CALLERID(all)=3 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   3,2,Queue(custservice,t,,,20) 
exten		=>   3,3,Voicemail(7003@local,b)
exten		=>   3,4,Hangup
exten		=>   3,104,Hangup
exten		=>   4,1,Set(CALLERID(all)=4 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   4,2,Queue(support,t,,,20) 
exten		=>   4,3,Voicemail(7003@local,b)
exten		=>   4,4,Hangup
exten		=>   4,104,Hangup
exten		=>   5,1,Set(CALLERID(all)=5 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   5,2,Queue(noc,t,,,20) 
exten		=>   5,3,Voicemail(7003@local,b)
exten		=>   5,4,Hangup
exten		=>   5,104,Hangup
exten		=>   6,1,Goto(incoming,s,1)
exten		=>   9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   9,2,Directory(local)
exten		=>   9,3,Hangup
exten		=> *86,1,Goto(local,*86,1)
exten		=>  _X,1,Playback(invalid)
exten		=>  _X,2,Goto(incoming,s,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[mainmenu-night]
exten		=> _1NXXNXXXXXX,1,Answer
exten		=> _1NXXNXXXXXX,2,Ringing
exten		=> _1NXXNXXXXXX,3,Wait(3)
exten		=> _1NXXNXXXXXX,4,Set(TIMEOUT(digit)=2)
exten		=> _1NXXNXXXXXX,5,Background(local-mainmenu-night)
exten		=> _1NXXNXXXXXX,n,WaitExten(5) ; (3)                  ; Wait for an extension to be dialed.
exten		=> _1NXXNXXXXXX,6,Wait(1)
exten		=> _1NXXNXXXXXX,7,Ringing
exten		=> _1NXXNXXXXXX,8,Wait(2)
exten		=> _1NXXNXXXXXX,9,Voicemail(7000@local,u)
exten		=> _1NXXNXXXXXX,10,Hangup
exten		=>   1,1,Goto(enterprise-support-auth,s,1)
exten		=>   9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   9,2,Directory(local)
exten		=>   9,3,Hangup
exten		=> *86,1,Goto(local,*86,1)
exten		=>  _X,1,Playback(invalid)
exten		=>  _X,1,Goto(incoming,s,1)
exten		=>  _X,2,Goto(incoming,s,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[incoming]
include		=> local
include		=> mainmenu-night,00:00-23:59,thu,01,jan	; New Years Day		2009
include		=> mainmenu-night,00:00-23:59,mon,25,may	; Memorial Day
include		=> mainmenu-night,00:00-23:59,fri,03,jul	; Independence Day
include		=> mainmenu-night,00:00-23:59,mon,07,sep	; Labor Day
include		=> mainmenu-night,00:00-23:59,thu,26,nov	; Thanksgiving Day
include		=> mainmenu-night,00:00-23:59,fri,25,dec	; Christmas Day		2009
include		=> mainmenu-night,00:00-23:59,fri,01,jan	; New Years Day		2010
include		=> mainmenu-day,09:00-20:00,mon-fri
include		=> mainmenu-night
exten		=> s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
exten		=> s,2,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[incoming-sales]
exten		=> s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
exten		=> s,2,Macro(stdexten,SIP/7004,7004)
exten		=> s,2,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> s,3,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> s,4,Hangup
[outgoing]
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
exten	=> _81NXXNXXXXXX,1,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${EXTEN}-${CALLERIDNUM}-${EXTEN:1})
exten	=> _81NXXNXXXXXX,2,Monitor(wav,${CALLFILENAME},m)
exten	=> _81NXXNXXXXXX,3,Goto(outgoing,${EXTEN:1},1);
exten	=> _91NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
exten	=> _91NXXNXXXXXX,2,Set(CALLERID(all)=)
exten	=> _91NXXNXXXXXX,3,Goto(outgoing,_1NXXNXXXXXX,3);
exten	=> _1NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
exten	=> _1NXXNXXXXXX,2,Set(CALLERID(all)=12119627300)
exten	=> _1NXXNXXXXXX,3,NoOp([outgoing] STARTING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})
exten	=> _1NXXNXXXXXX,4,Dial(DAHDI/${CHANNEL_OV}/${DIAL_OV})
exten	=> _1NXXNXXXXXX,7,Congestion
exten	=> _011.,1,Set(CALLERID(all)=12119627300)
exten	=> _011.,4,Congestion
[enterprise-support-auth]
exten		=> s,1,Authenticate(/etc/asterisk/enterprise-customers.txt,a)
exten		=> s,2,Goto(enterprise-support,s,1)
exten		=> s,3,Hangup
exten		=> i,1,Hangup
exten		=> h,1,Hangup
exten		=> t,1,Hangup
[enterprise-support]
exten		=> s,1,Voicemail(7999@local,)
exten		=> s,2,Hangup
exten		=> i,1,Hangup
exten		=> h,1,AGI(enterprise-support.agi,1)
exten		=> t,1,Hangup
[enterprise-support-callback]
exten		=> s,1,Background(local-enterprise-support-callback-dial-7999)
exten		=> s,2,Wait(1)
exten		=> s,3,Goto(enterprise-support-callback,s,1)
exten		=> s,4,Hangup
exten		=> i,1,Goto(enterprise-support-callback,s,1)
exten		=> *,1,Goto(local,*86,1)
[trusted]
include		=> local
include		=> outgoing
include		=> parkedcalls
include		=> testing
exten		=> _*7XXX,1,Answer
exten		=> _*7XXX,2,Ringing
exten		=> _*7XXX,3,Wait(30)
exten		=> _*7XXX,4,Voicemail(${EXTEN:1}@local,u)
exten		=> _*7XXX,5,Hangup
exten 		=> 8000,1,Set(TIMEOUT(absolute)=21)
exten		=> 8000,2,AGI(intercom.agi,${CALLERID(num)})
exten 		=> 8000,3,Page(${CANDIDATES}) 
exten		=> h,1,NoOp([trusted] CALL ENDING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})
[invalid]
exten		=> s,1,Hangup
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[network-outage]
exten		=> s,1,AGI(network-outage.agi,1)
exten		=> s,2,Answer
exten		=> s,3,Hangup
exten		=> i,1,Hangup
exten		=> h,1,Hangup
exten		=> t,1,Hangup
[network-outage-callback]
exten		=> s,1,Background(local-network-outage);
exten		=> s,2,Wait(1)
exten		=> s,3,Goto(network-outage-callback,s,1)
exten		=> s,4,Hangup
[default]
exten		=> s,1,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup

You have two priority 6’s; only one will be used.

The hangup is never reached, as you have neither priority 7, nor priority 8.

The easiest way is probably to have a subroutine that gets called twice, although you could set a first time flag, in a local variable, and use GotoIf.

Set a Response Timeout.

https://wiki.asterisk.org/wiki/display/AST/Function_TIMEOUT

Set(TIMEOUT(response)=15)

You may need to set autofallthrough=no in the general section of your extensions.conf for this to work

Apparently the one that’s chosen is the right one, because it does just hangup at the end.

I’ve tried to implement johnkiniston’s TIMEOUT suggestion by replacing the existing TIMEOUT for digit timeout with the response timeout instead, and it made no difference. Here is a call trace with the new configuration.

    -- Starting simple switch on 'DAHDI/1-1'
    -- Executing [s@incoming:1] NoOp("DAHDI/1-1", "CALLERID = ALEX - 2119216712") in new stack
    -- Executing [s@incoming:2] Goto("DAHDI/1-1", "incoming,_1NXXNXXXXXX,1") in new stack
    -- Goto (incoming,_1NXXNXXXXXX,1)
    -- Executing [_1NXXNXXXXXX@incoming:1] Answer("DAHDI/1-1", "") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:2] Ringing("DAHDI/1-1", "") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:3] Wait("DAHDI/1-1", "1") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:4] Set("DAHDI/1-1", "TIMEOUT(response)=15") in new stack
    -- Response timeout set to 15.000
    -- Executing [_1NXXNXXXXXX@incoming:5] BackGround("DAHDI/1-1", "local-mainmenu-day") in new stack
    -- <DAHDI/1-1> Playing 'local-mainmenu-day.slin' (language 'en')
    -- Executing [_1NXXNXXXXXX@incoming:6] WaitExten("DAHDI/1-1", "4") in new stack
    -- Timeout on DAHDI/1-1, continuing...
    -- Executing [_1NXXNXXXXXX@incoming:7] Ringing("DAHDI/1-1", "") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:8] Wait("DAHDI/1-1", "2") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:9] Hangup("DAHDI/1-1", "") in new stack
  == Spawn extension (incoming, _1NXXNXXXXXX, 9) exited non-zero on 'DAHDI/1-1'
    -- Executing [h@incoming:1] Hangup("DAHDI/1-1", "") in new stack
  == Spawn extension (incoming, h, 1) exited non-zero on 'DAHDI/1-1'
    -- Hanging up on 'DAHDI/1-1'
    -- Hungup 'DAHDI/1-1'

Anyone have any other ideas? How do I make the IVR loop?

I think I misunderstood your question earlier.

You can make a loop a number of ways using something like the While() command or the ExecIf/If command.

exten => s,1,NoOP()
 same => n,Set(LoopCount=1) ; Set up your counter
 same => n,Set(TIMEOUT(response=10)) ; Set up the Timeout
 same => n,Answer() ; Answer the call
 same => n(MENU),SayDigits(${LoopCount}) ; Normally we would have a Background here but for testing just say what number of loop we are on

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 4]?s,MENU) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call
1 Like

Thanks for your help. Would you look through the dial plan I’ve pasted in the beginning of this thread and give me an idea where this code should go?

I played around with it for more than an hour, and can’t figure it out. It appears all calls start in an ‘incoming’ queue then get redirected based on time of day and type of call. I tried adding the code there, and commenting out the duplicate pieces, but it just gets confused and hangs up.

[incoming]

exten=> s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
 same => n,Set(LoopCount=1) ; Set up your counter
 same => n,Set(TIMEOUT(response=10)) ; Set up the Timeout
 same => n(TOP),Goto(incoming,_1NXXNXXXXXX,1)

Replace your timeout extension in incoming with this code:

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 4]?s,TOP) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call

Get rid of the t extension definition in mainmenu-day and mainmenu-night

Thank you again for your help. I must not be understanding your instructions clearly. I’ve posted my resulting extensions.conf. Can I ask you to review and point out where I’m doing it wrong? You’ll notice your changes, but it still does not loop.

[general]
static		= yes
writeprotect	= no
autofallthrough	= no
[globals]
VOICEPULSE_TRUNK01	= voicepulse-primary
VOICEPULSE_TRUNK02	= voicepulse-secondary
[macro-stdexten]
exten		=> s,1,Dial(${ARG1},20,tr)
exten		=> s,2,Goto(s-${DIALSTATUS},1)
exten		=> s-NOANSWER,1,Voicemail(${ARG2}@local,u)	; No answer.
exten		=> s-NOANSWER,2,Hangup
exten		=> s-BUSY,1,Voicemail(${ARG2}@local,b)		; Phone busy.
exten		=> s-BUSY,2,Hangup
exten		=> _s-.,1,Playback(invalid)		; Channel unavailable.
exten		=> _s-.,2,Goto(incoming,_1NXXNXXXXXX,4)
[macro-shitlist]
exten		=> s,1,Answer
exten		=> s,2,Congestion
exten		=> s,3,Hangup
[local]
exten		=>  7000,1,Macro(stdexten,SIP/7003,7003)
exten		=>  7003,1,Macro(stdexten,SIP/7003,7003)
exten		=>  7004,1,Macro(stdexten,SIP/7004,7004)
exten		=>  8000,1,Goto(incoming,s,1)
exten		=> _8XXX,1,Playback(invalid)
exten		=> _8XXX,2,Goto(incoming,s,1)
exten		=> _9XXX,1,Playback(invalid)
exten		=> _9XXX,2,Goto(incoming,s,1)
exten		=> *86,1,Answer	
exten		=> *86,2,Wait(.5)
exten		=> *86,3,VoicemailMain(@local)
exten		=> *86,4,Hangup
exten		=> *87,1,Answer	
exten		=> *87,2,Wait(.5)
exten		=> *87,3,VoicemailMain(${CALLERID(num)}@local)
exten		=> *87,4,Hangup
exten		=> 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=> 9,2,Directory(local)
exten		=> 9,3,Hangup
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[macro-intercom]
exten		=> s,1,ChanIsAvail(${ARG1},js)
exten		=> s,2,SIPAddHeader(Alert-Info: Ring Answer)
exten		=> s,3,Dial(${ARG1},,)
exten		=> s,4,Hangup
exten		=> t,1,Hangup
exten		=> T,1,Hangup
[intercom]
exten		=> _X.,1,Macro(intercom,SIP/${EXTEN}) 
[testing]
exten		=> 200,1,Goto(mainmenu-day,_1NXXNXXXXXX,1)
exten		=> 201,1,Goto(mainmenu-night,_1NXXNXXXXXX,1)
exten		=> 202,1,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> 203,1,MusicOnHold()
exten		=> 300,1,Answer
exten		=> 300,2,Ringing
exten		=> 300,3,Wait(1)
exten		=> 300,4,Echo
exten		=> 300,5,Hangup
exten		=> 1102,1,Answer
exten		=> 1102,2,Ringing
exten		=> 1102,3,Wait(3)
exten		=> 1102,4,Milliwatt()
exten		=> 1102,5,Hangup
exten		=> 31337,1,ChanSpy(SIP,q)
exten		=> 31337,2,Hangup
[mainmenu-day]
exten		=>   _1NXXNXXXXXX,1,Answer
exten		=>   _1NXXNXXXXXX,2,Ringing
exten		=>   _1NXXNXXXXXX,3,Wait(1) 	; ring before IVR starts
exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 4]?s,TOP) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call
exten		=>   _1NXXNXXXXXX,5,Background(local-mainmenu-day)
exten		=>   _1NXXNXXXXXX,n,WaitExten(4) ; (3)                  ; Wait for an extension to be dialed.
exten		=>   _1NXXNXXXXXX,6,Set(CALLERID(all)=0 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   2,2,Queue(sales,t,,,20) ; dvw 01/26/2018 Extend ring time
exten		=>   2,3,Voicemail(7000@local,b)
exten		=>   2,4,Hangup
exten		=>   2,104,Hangup
exten		=>   3,1,Set(CALLERID(all)=3 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   3,2,Queue(custservice,t,,,20) ; dvw 01/26/2018 Extend ring time
exten		=>   3,3,Voicemail(7003@local,b)
exten		=>   3,4,Hangup
exten		=>   3,104,Hangup
exten		=>   4,1,Set(CALLERID(all)=4 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   4,2,Queue(support,t,,,20) ; dvw 01/26/2018 Extend ring time
exten		=>   4,3,Voicemail(7003@local,b)
exten		=>   4,4,Hangup
exten		=>   4,104,Hangup
exten		=>   5,1,Set(CALLERID(all)=5 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   5,2,Queue(noc,t,,,20) ; dvw 01/26/2018 Extend ring time
exten		=>   5,3,Voicemail(7003@local,b)
exten		=>   5,4,Hangup
exten		=>   5,104,Hangup
exten		=>   6,1,Goto(incoming,s,1)
exten		=>   9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   9,2,Directory(local)
exten		=>   9,3,Hangup
exten		=> *86,1,Goto(local,*86,1)
exten		=>  _X,1,Playback(invalid)
exten		=>  _X,2,Goto(incoming,s,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
[mainmenu-night]
exten		=> _1NXXNXXXXXX,1,Answer
exten		=> _1NXXNXXXXXX,2,Ringing
exten		=> _1NXXNXXXXXX,3,Wait(3)
exten		=> _1NXXNXXXXXX,4,Set(TIMEOUT(digit)=2)
exten		=> _1NXXNXXXXXX,5,Background(local-mainmenu-night)
exten		=> _1NXXNXXXXXX,n,WaitExten(5) ; (3)                  ; Wait for an extension to be dialed.
exten		=> _1NXXNXXXXXX,6,Wait(1)
exten		=> _1NXXNXXXXXX,7,Ringing
exten		=> _1NXXNXXXXXX,8,Wait(2)
exten		=> _1NXXNXXXXXX,9,Voicemail(7000@local,u)
exten		=> _1NXXNXXXXXX,10,Hangup
exten		=>   1,1,Goto(enterprise-support-auth,s,1)
exten		=>   9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten		=>   9,2,Directory(local)
exten		=>   9,3,Hangup
exten		=> *86,1,Goto(local,*86,1)
exten		=>  _X,1,Playback(invalid)
exten		=>  _X,1,Goto(incoming,s,1)
exten		=>  _X,2,Goto(incoming,s,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
[incoming]
include		=> local
include		=> mainmenu-night,00:00-23:59,thu,01,jan	; New Years Day		2009
include		=> mainmenu-night,00:00-23:59,mon,25,may	; Memorial Day
include		=> mainmenu-night,00:00-23:59,fri,03,jul	; Independence Day
include		=> mainmenu-night,00:00-23:59,mon,07,sep	; Labor Day
include		=> mainmenu-night,00:00-23:59,thu,26,nov	; Thanksgiving Day
include		=> mainmenu-night,00:00-23:59,fri,25,dec	; Christmas Day		2009
include		=> mainmenu-night,00:00-23:59,fri,01,jan	; New Years Day		2010
include		=> mainmenu-day,09:00-20:00,mon-fri
include		=> mainmenu-night
 ;same => n,Set(TIMEOUT(response=10)) ; Set up the Timeout
 ;same => n(incoming),SayDigits(${LoopCount}) ; Normally we would have a Background here but for testing just say what number of loop we are on
exten=> s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
 same => n,Set(LoopCount=1) ; Set up your counter
 same => n,Set(TIMEOUT(response=10)) ; Set up the Timeout
 same => n(TOP),Goto(incoming,_1NXXNXXXXXX,1)
exten		=> s,2,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[incoming-sales]
exten		=> s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
exten		=> s,2,Macro(stdexten,SIP/7004,7004)
exten		=> s,2,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> s,3,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> s,4,Hangup
[outgoing]
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
exten	=> _81NXXNXXXXXX,1,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${EXTEN}-${CALLERIDNUM}-${EXTEN:1})
exten	=> _81NXXNXXXXXX,2,Monitor(wav,${CALLFILENAME},m)
exten	=> _81NXXNXXXXXX,3,Goto(outgoing,${EXTEN:1},1);
exten	=> _91NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
exten	=> _91NXXNXXXXXX,2,Set(CALLERID(all)=)
exten	=> _91NXXNXXXXXX,3,Goto(outgoing,_1NXXNXXXXXX,3);
exten	=> _1NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
exten	=> _1NXXNXXXXXX,2,Set(CALLERID(all)=12015557300)
exten	=> _1NXXNXXXXXX,3,NoOp([outgoing] STARTING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})
exten	=> _1NXXNXXXXXX,4,Dial(DAHDI/${CHANNEL_OV}/${DIAL_OV})
exten	=> _1NXXNXXXXXX,7,Congestion
exten	=> _011.,1,Set(CALLERID(all)=12015557300)
exten	=> _011.,4,Congestion
[enterprise-support-auth]
exten		=> s,1,Authenticate(/etc/asterisk/enterprise-customers.txt,a)
exten		=> s,2,Goto(enterprise-support,s,1)
exten		=> s,3,Hangup
exten		=> i,1,Hangup
exten		=> h,1,Hangup
exten		=> t,1,Hangup
[enterprise-support]
exten		=> s,1,Voicemail(7999@local,)
exten		=> s,2,Hangup
exten		=> i,1,Hangup
exten		=> h,1,AGI(enterprise-support.agi,1)
exten		=> t,1,Hangup
[enterprise-support-callback]
exten		=> s,1,Background(local-enterprise-support-callback-dial-7999)
exten		=> s,2,Wait(1)
exten		=> s,3,Goto(enterprise-support-callback,s,1)
exten		=> s,4,Hangup
exten		=> i,1,Goto(enterprise-support-callback,s,1)
exten		=> *,1,Goto(local,*86,1)
[trusted]
include		=> local
include		=> outgoing
include		=> parkedcalls
include		=> testing
exten		=> _*7XXX,1,Answer
exten		=> _*7XXX,2,Ringing
exten		=> _*7XXX,3,Wait(30)
exten		=> _*7XXX,4,Voicemail(${EXTEN:1}@local,u)
exten		=> _*7XXX,5,Hangup
exten 		=> 8000,1,Set(TIMEOUT(absolute)=21)
exten		=> 8000,2,AGI(intercom.agi,${CALLERID(num)})
exten 		=> 8000,3,Page(${CANDIDATES}) 
exten		=> h,1,NoOp([trusted] CALL ENDING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})
[invalid]
exten		=> s,1,Hangup
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup
[network-outage]
exten		=> s,1,AGI(network-outage.agi,1)
exten		=> s,2,Answer
exten		=> s,3,Hangup
exten		=> i,1,Hangup
exten		=> h,1,Hangup
exten		=> t,1,Hangup
[network-outage-callback]
exten		=> s,1,Background(local-network-outage);
exten		=> s,2,Wait(1)
exten		=> s,3,Goto(network-outage-callback,s,1)
exten		=> s,4,Hangup
[default]
exten		=> s,1,Goto(incoming,_1NXXNXXXXXX,1)
exten		=> h,1,Hangup
exten		=> i,1,Hangup
exten		=> t,1,Hangup

Or maybe a better suggestion would be to more directly incorporate your changes into the first extensions.conf I posted?

I took some liberties with your code to make it easier to work with for me.

Note that the night menu will still fall through to voicemail, If you don’t want voicemail automatically at night then I’d define a new extension for your callers to enter to leave a voicemail

[incoming]
exten => s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
 same => n,Set(LoopCount=1) ; Set up your counter
 same => n,Set(TIMEOUT(response=10)
 same => n,Set(TIMEOUT(digit)=2)
 same => n,GotoIfTime(09:00-20:00,mon-fri,*,*?mainmenu-day,s,1)
 same => n,Goto(mainmenu-night,s,1)

[mainmenu-day]
exten => s,1,NoOP()
 same => n,Ringing()
 same => n,Wait(1)      ; ring before IVR starts
 same => n(MENU),Background(local-mainmenu-day)
 same => n,WaitExten(6) ; (3)                  ; Wait for an extension to be dialed.

exten => 2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(sales,t,,,20)
 same => n,Voicemail(7000@local,b)
 same => n,Hangup()

exten => 3,1,Set(CALLERID(all)=3 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(custservice,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 4,1,Set(CALLERID(all)=4 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(support,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 5,1,Set(CALLERID(all)=5 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(noc,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 6,1,Goto(incoming,s,1)

exten => 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Directory(local)
 same => n,Hangup()

exten => *86,1,Goto(local,*86,1)

exten => i,1,Playback(invalid)
 same => n,Goto(s,MENU)

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 4]?s,MENU) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call

[mainmenu-night]
exten => s,1,NoOP()
 same => n,Ringing()
 same => n,Wait(3)
 same => n,Answer()
 same => n(MENU),Background(local-mainmenu-night)
 same => n,WaitExten(6) ; Remove the below 5 lines to get rid of voicemail at night
 same => n,Ringing()
 same => n,Wait(2)
 same => n,Voicemail(7000@local,u)
 same => n,Hangup()

exten => 1,1,Goto(enterprise-support-auth,s,1)

exten => 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Directory(local)
 same => n,Hangup

exten => *86,1,Goto(local,*86,1)

exten => i,1,Playback(invalid)
 same => n,Goto(s,MENU)

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 4]?s,MENU) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call

You are amazing. Thank you so much. I’ve just now managed to take a look at this, and it still doesn’t work. In fact, it continues to do the same thing. Could one of these errors be the cause? Asterisk runs, but there looks to be a large number of warnings/errors. We only have one analog phone line connected to the Tiger3XX card. How can I disable the unused channel warnings?

# asterisk -f -C /etc/asterisk/asterisk.conf |grep -Ei 'error|warn|ami'
 Asterisk Dynamic Loader Starting:
  == Registered custom function 'AMI_CLIENT'
 Asterisk Dynamic Loader Starting:
[Feb 10 12:49:50] WARNING[18437]: loader.c:526 load_dynamic_module: Error loading module 'res_ari_mailboxes.so': /usr/lib64/asterisk/modules/res_ari_mailboxes.so: undefined symbol: stasis_app_mailbox_to_json
[Feb 10 12:49:50] WARNING[18437]: res_phoneprov.c:1231 get_defaults: Unable to find a valid server address or name.
[Feb 10 12:49:50] ERROR[18437]: ari/config.c:314 process_config: No configured users for ARI
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:7340 handle_alarms: Detected alarm on channel 2: Red Alarm
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:4132 dahdi_open: Unable to specify channel 3: No such device or address
[Feb 10 12:49:51] ERROR[18437]: chan_dahdi.c:12108 mkintf: Unable to open channel 3: No such device or address
[Feb 10 12:49:51] ERROR[18437]: chan_dahdi.c:17516 build_channels: Unable to register channel '3'
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:17723 process_dahdi: Channel '3' failure ignored: ignore_failed_channels.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:4132 dahdi_open: Unable to specify channel 4: No such device or address
[Feb 10 12:49:51] ERROR[18437]: chan_dahdi.c:12108 mkintf: Unable to open channel 4: No such device or address
[Feb 10 12:49:51] ERROR[18437]: chan_dahdi.c:17516 build_channels: Unable to register channel '4'
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:17723 process_dahdi: Channel '4' failure ignored: ignore_failed_channels.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:19032 process_dahdi: Ignoring any changes to 'userbase' (on reload) at line 23.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:19032 process_dahdi: Ignoring any changes to 'vmsecret' (on reload) at line 31.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:19032 process_dahdi: Ignoring any changes to 'hassip' (on reload) at line 35.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:19032 process_dahdi: Ignoring any changes to 'hasiax' (on reload) at line 39.
[Feb 10 12:49:51] WARNING[18437]: chan_dahdi.c:19032 process_dahdi: Ignoring any changes to 'hasmanager' (on reload) at line 47.
[Feb 10 12:49:51] ERROR[18437]: codec_dahdi.c:820 find_transcoders: Failed to open /dev/dahdi/transcode: No such file or directory

Okay, my apologies. I discovered my mistake. It works, but I have a few additional questions, if that’s okay.

  • How can I properly add another extension to send the user to voicemail? I’ve tried adding an extension from mainmenu-day but it produced the following error:
[Feb 10 15:07:18] WARNING[11610][C-00000001]: file.c:1684 waitstream_core: Unexpected control subclass '2'

I tried inserting this code:

exten => 2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(sales,t,,,20)
 same => n,Voicemail(7000@local,b)
 same => n,Hangup()

This code works, but I’m concerned about the warning.

  • How can I detect a fax call and hangup when received? We are inundated with junk fax calls on our toll-free voice lines. I’ve added a fax extension in mainmenu-day and mainmenu-night:
[mainmenu-day]
exten => s,1,NoOP()
 same => n,Ringing()
 same => fax,1,Hangup()
 same => n,Wait(1)      ; ring before IVR starts
 same => n(MENU),Background(local-mainmenu-day)
 same => n,WaitExten(6) ; (3)                  ; Wait for an extension to be dialed.

Is this correct?

  • How can I enable json logging?

The way you defined your fax extension won’t work and will show errors on a reload.

You define extensions as

exten => EXENSIONANME,PRIORITY,COMMAND

so

exten => fax,1,Hangup()

would be correct.

Also you don’t want to start defining an extension inside of another extension, you broke the ‘s’ extension when you tried to insert your fax extension in the middle of it.

You can define your extension to leave a voicemail like this:

exten => 7,1,Voicemail(7000@local,b)
same => n,Hangup()

Thank you again for your help. I really appreciate you sticking with me while I work through this.

I’m now unable to dial out. It appears my extension is recognized by the system. I can receive calls to my extension. I’ve added the “trusted” context to extensions.conf from my old version.

[Feb 12 15:40:31] NOTICE[758][C-00000001]: chan_sip.c:26455 handle_request_invite: Call from 'Dave' (192.168.1.107:5060) to extension '12015556712' rejected because extension not found in context 'trusted'.

I’ve included my entire extensions.conf here. Would you help me identify where the cause is for this problem? I also tried including the extension directly in the [trusted] section instead of relying on the ‘include’ statement.

[local]
exten           =>  7000,1,Macro(stdexten,SIP/7003,7003)
exten           =>  7003,1,Macro(stdexten,SIP/7003,7003)
exten           =>  7004,1,Macro(stdexten,SIP/7004,7004)

exten           =>  8000,1,Goto(incoming,s,1)
exten           => _8XXX,1,Playback(invalid)
exten           => _8XXX,2,Goto(incoming,s,1)

exten           => _9XXX,1,Playback(invalid)
exten           => _9XXX,2,Goto(incoming,s,1)

exten           => *86,1,Answer 
exten           => *86,2,Wait(.5)
exten           => *86,3,VoicemailMain(@local)
exten           => *86,4,Hangup

exten           => *87,1,Answer 
exten           => *87,2,Wait(.5)
exten           => *87,3,VoicemailMain(${CALLERID(num)}@local)
exten           => *87,4,Hangup

exten           => 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
exten           => 9,2,Directory(local)
exten           => 9,3,Hangup
exten           => h,1,Hangup
exten           => i,1,Hangup
exten           => t,1,Hangup

[incoming]
exten => s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
 same => n,Set(LoopCount=1) ; Set up your counter
 same => n,Set(TIMEOUT(response=6)
 same => n,Set(TIMEOUT(digit)=2)
 ;same => n,Goto(mainmenu-day,s,1)
 same => n,GotoIfTime(09:00-20:00,mon-fri,*,*?mainmenu-day,s,1)
 same => n,Goto(mainmenu-night,s,1)

[mainmenu-day]
exten => s,1,NoOP()
 same => n,Ringing()
 same => n,Wait(1)      ; ring before IVR starts
 same => n(MENU),Background(local-mainmenu-day)
 same => n,WaitExten(6) ; (3)                  ; Wait for an extension to be dialed.

exten => fax,1,Hangup()

exten => 2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(sales,t,,,20)
 same => n,Voicemail(7000@local,b)
 same => n,Hangup()

exten => 3,1,Set(CALLERID(all)=3 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(custservice,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 4,1,Set(CALLERID(all)=4 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(support,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 5,1,Set(CALLERID(all)=5 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Queue(noc,t,,,20)
 same => n,Voicemail(7003@local,b)
 same => n,Hangup()

exten => 6,1,Goto(incoming,s,1)

exten => 7,1,Voicemail(7000@local,b)
 same => n,Hangup()

exten => *86,1,Goto(local,*86,1)

exten => 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Directory(local)
 same => n,Hangup()

exten => i,1,Playback(invalid)
 same => n,Goto(s,MENU)

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 2]?s,MENU) ; If we have looped fewer than 2 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call

[mainmenu-night]
exten => s,1,NoOP()
 same => n,Ringing()
 same => n,Wait(5)
 same => n,Answer()
 same => n(MENU),Background(local-mainmenu-night)
 same => n,WaitExten(6) ; Remove the below 5 lines to get rid of voicemail at night
 ;same => n,Ringing()
 ;same => n,Wait(2)
 ;same => n,Voicemail(7000@local,u)
 ;same => n,Hangup()

exten => fax,1,Hangup()

exten => 1,1,Goto(enterprise-support-auth,s,1)

exten => 2,1,Set(CALLERID(all)=2 - ${CALLERID(name)} <${CALLERID(num)}>)
 ;same => n,Queue(sales,t,,,20)
 same => n,Voicemail(7000@local,b)
 same => n,Hangup()

exten => 9,1,Set(CALLERID(all)=9 - ${CALLERID(name)} <${CALLERID(num)}>)
 same => n,Directory(local)
 same => n,Hangup

exten => *86,1,Goto(local,*86,1)

exten => i,1,Playback(invalid)
 same => n,Goto(s,MENU)

exten => t,1,Set(LoopCount=${INC(LoopCount)}) ; Increment the counter
 same => n,GotoIf($[${LoopCount} < 2]?s,MENU) ; If we have looped fewer than 3 times jump back to the Menu
 same => n,Playback(goodbye) ; If we have looped 4 times then play Goodbye
 same => n,Hangup() ; Terminate the call

; [enterprise-support]
;
; This is the context for "enterprise emergency service" calls which come in
; after hours.  Calls are only thrown here from the mainmenu-night context.
;
[enterprise-support-auth]
exten           => s,1,Authenticate(/etc/asterisk/enterprise-customers.txt,a)
exten           => s,2,Goto(enterprise-support,s,1)
exten           => s,3,Hangup

exten           => i,1,Hangup
exten           => h,1,Hangup
exten           => t,1,Hangup

[enterprise-support]
exten           => s,1,Voicemail(7999@local,)
exten           => s,2,Hangup

exten           => i,1,Hangup
exten           => h,1,AGI(enterprise-support.agi,1)
exten           => t,1,Hangup

[enterprise-support-callback]
exten           => s,1,Background(local-enterprise-support-callback-dial-7999)
exten           => s,2,Wait(1)
exten           => s,3,Goto(enterprise-support-callback,s,1)
exten           => s,4,Hangup

exten           => i,1,Goto(enterprise-support-callback,s,1)
exten           => *,1,Goto(local,*86,1)

;[incoming-sales]
;exten           => s,1,NoOp(CALLERID = ${CALLERID(name)} - ${CALLERID(num)})
;exten           => s,2,Macro(stdexten,SIP/7004,7004)
;exten           => s,2,Goto(incoming,_1NXXNXXXXXX,1)
;exten           => s,3,Goto(incoming,_1NXXNXXXXXX,1)
;exten           => s,4,Hangup

[invalid]
exten           => s,1,Hangup
exten           => h,1,Hangup
exten           => i,1,Hangup
exten           => t,1,Hangup

;
; [network-outage]
;
; This is the context for "severly critical host or service outage"
; calls which come in via Nagios's escalation facility.
;
[network-outage] 
exten           => s,1,AGI(network-outage.agi,1)
exten           => s,2,Answer
exten           => s,3,Hangup

exten           => i,1,Hangup
exten           => h,1,Hangup
exten           => t,1,Hangup

[network-outage-callback]
exten           => s,1,Background(local-network-outage);
exten           => s,2,Wait(1)
exten           => s,3,Goto(network-outage-callback,s,1)
exten           => s,4,Hangup

;
; [default]
;
; This is the default context that calls will be thrown into if no other
; contexts are matched.  If this even happens, throw them into the main
; "incoming" context to initiate a new incoming call.
;
[default]
exten           => s,1,Goto(incoming,_1NXXNXXXXXX,1)
exten           => h,1,Hangup
exten           => i,1,Hangup
exten           => t,1,Hangup

[trusted]
include         => local
;include         => outgoing
;include         => parkedcalls
include         => testing

; Allow people to transfer calls directly into voicemail.
exten           => _*7XXX,1,Answer
exten           => _*7XXX,2,Ringing
exten           => _*7XXX,3,Wait(30)
exten           => _*7XXX,4,Voicemail(${EXTEN:1}@local,u)
exten           => _*7XXX,5,Hangup

; Our ad-hoc intercom ;)
exten           => 8000,1,Set(TIMEOUT(absolute)=21)
exten           => 8000,2,AGI(intercom.agi,${CALLERID(num)})
exten           => 8000,3,Page(${CANDIDATES}) 

; XXX
exten           => h,1,NoOp([trusted] CALL ENDING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})

;
; [testing]
;
; Miscellaneous testing extensions, this context should be included into
; [trusted] or [local] for debugging.
;
[testing]
exten           => 200,1,Goto(mainmenu-day,_1NXXNXXXXXX,1)
exten           => 201,1,Goto(mainmenu-night,_1NXXNXXXXXX,1)
exten           => 202,1,Goto(incoming,_1NXXNXXXXXX,1)
exten           => 203,1,MusicOnHold()

; Echo test
exten           => 300,1,Answer
exten           => 300,2,Ringing
exten           => 300,3,Wait(1)
exten           => 300,4,Echo
exten           => 300,5,Hangup

; T102 Milliwatt Test Number
exten           => 1102,1,Answer
exten           => 1102,2,Ringing
exten           => 1102,3,Wait(3)
exten           => 1102,4,Milliwatt()
exten           => 1102,5,Hangup

exten           => 31337,1,ChanSpy(SIP,q)
exten           => 31337,2,Hangup

You don’t have a extension that matches ‘12015556712’ in your trusted context.

Trusted includes Local that doesn’t have a match for that extension.

Trusted includes testing that doesn’t have a match for that extension.

You don’t have an outgoing context in the code you pasted so I can’t say if it’d match there, but if it does you’ll need to uncomment the include for outgoing in your trusted context.

It looks like I was missing the [outgoing] section of my extensions.conf. I didn’t know I needed that from your version. I’ve included it, but it’s producing the following warning:

[Feb 12 20:54:26] WARNING[417][C-00000002]: file.c:1684 waitstream_core: Unexpected control subclass '2'

Here is my outgoing section. Can you help me identify this warning?

[outgoing]
exten           => h,1,Hangup
exten           => i,1,Hangup
exten           => t,1,Hangup

;
; If the call is prefixed with an '8', then record it.
;
exten   => _81NXXNXXXXXX,1,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${EXTEN}-${CALLERIDNUM}-${EXTEN:1})
exten   => _81NXXNXXXXXX,2,Monitor(wav,${CALLFILENAME},m)
exten   => _81NXXNXXXXXX,3,Goto(outgoing,${EXTEN:1},1);

;
; If the call is prefixed with an '9', then don't send Caller*ID.
;
exten   => _91NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
;exten  => _91NXXNXXXXXX,2,Set(CALLERID(all)=,a)
exten   => _91NXXNXXXXXX,2,Set(CALLERID(all)=)
exten   => _91NXXNXXXXXX,3,Goto(outgoing,_1NXXNXXXXXX,3);

;
; Domestic Calls
;
exten   => _1NXXNXXXXXX,1,AGI(make-outgoing.agi,${CALLERID(num)},${EXTEN})
exten   => _1NXXNXXXXXX,2,Set(CALLERID(all)=12019627300)
exten   => _1NXXNXXXXXX,3,NoOp([outgoing] STARTING -- ${STRFTIME(${EPOCH},,%m/%d/%Y - %H:%M:%S)})
exten   => _1NXXNXXXXXX,4,Dial(DAHDI/${CHANNEL_OV}/${DIAL_OV})
; exten => _1NXXNXXXXXX,5,Dial(SIP/+${DIAL_VP}@${VOICEPULSE_TRUNK01})
; exten => _1NXXNXXXXXX,6,Dial(SIP/+${DIAL_VP}@${VOICEPULSE_TRUNK01})
exten   => _1NXXNXXXXXX,7,Congestion

;
; International Calls
;
exten   => _011.,1,Set(CALLERID(all)=12019627300)
; exten => _011.,2,Dial(SIP/+${EXTEN:3}@${VOICEPULSE_TRUNK01})
; exten => _011.,3,Dial(SIP/+${EXTEN:3}@${VOICEPULSE_TRUNK02})
exten   => _011.,4,Congestion

I do not know the reason behind the unexpected control subclass error.

I believe it to be a non critical warning that can usually be ignored.

Control 2 is Ring, That is what you might get on an unanswered incoming call.

1 Like

Thanks so much for your help. Do you have any suggestions for fixing this warning? Am I missing something in my configuration?