Kris Boutilier
2004-Aug-27 01:28 UTC
[Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits?
Consider this dialplan fragment, where the call is being dialed into [macro-process-routing] over an iax2 channel from another (same build) Asterisk server: [macro-process-routing] ; This is the entrypoint of the debug call but is also refered to by Macro(process-routing) elsewhere in the dialplan ; XXX-NNN-6800 exten => _6800,1,Macro(6800-interceptor) ; This is matched when 8 is dialed during macro-6800-interceptor,s,4 exten => _8,1,Playback(welcome) exten => _8,2,Hangup [macro-6800-interceptor] exten => s,1,DigitTimeout,2 exten => s,2,ResponseTimeout,7 exten => s,3,Answer exten => s,4,Background(autoattendant-ivr/grtg-6) ; Play full after-hours greeting exten => t,1,Goto(s,1) exten => i,1,Goto(s,1) ; However, this is never be matched if 8 is dialed during (s,4) above exten => _8,1,Playback(typhoon) exten => _8,2,Hangup So, why does the DTMF detect jump out to [macro-process-routing] instead of staying within [macro-6800-interceptor]? The output of '-vvv' during the event (with macro-process-routing,_8 removed) goes something like: -- Accepting AUTHENTICATED call from 10.0.40.140, requested format = 2, actual format = 2 -- Executing Answer("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "") in new stack -- Executing Macro("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "6800-interceptor") in new stack -- Executing DigitTimeout("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "2") in new stack -- Set Digit Timeout to 2 -- Executing ResponseTimeout("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "7") in new stack -- Set Response Timeout to 7 -- Executing Answer("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "") in new stack -- Executing BackGround("IAX2/astpbx-woodbay@astpbx-wharfrd/1", "autoattendant-ivr/grtg-6") in new stack Aug 27 01:13:06 DEBUG[68621]: channel.c:1101 ast_settimeout: Scheduling timer at 160 sample intervals -- Playing 'autoattendant-ivr/grtg-6' (language 'en') Aug 27 01:13:06 DEBUG[7175]: chan_iax2.c:5156 socket_read: Ooh, voice format changed to 2 Aug 27 01:13:09 DEBUG[68621]: channel.c:1101 ast_settimeout: Scheduling timer at 0 sample intervals Aug 27 01:13:09 DEBUG[68621]: app_macro.c:145 macro_exec: Oooh, got something to jump out with ('8')! Aug 27 01:13:09 DEBUG[68621]: pbx.c:1811 ast_pbx_run: Oooh, got something to jump out with ('8')! Aug 27 01:13:10 WARNING[68621]: pbx.c:1913 ast_pbx_run: Invalid extension '8', but no rule 'i' in context 'macro-process-routing' Aug 27 01:13:10 DEBUG[68621]: chan_iax2.c:2335 iax2_hangup: We're hanging up IAX2/astpbx-woodbay@astpbx-wharfrd/1 now... -- Hungup 'IAX2/astpbx-woodbay@astpbx-wharfrd/1' Bug, feature or other suggestions? Build is 'Asterisk CVS-HEAD-08/13/04-10:37:13' Kris Boutilier Information Systems Coordinator Sunshine Coast Regional District
el Flynn
2004-Aug-27 01:38 UTC
[Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits?
Kris Boutilier wrote:> > [macro-process-routing] > ; This is the entrypoint of the debug call but is also refered to by > Macro(process-routing) elsewhere in the dialplan > > ; XXX-NNN-6800 > exten => _6800,1,Macro(6800-interceptor) > > ; This is matched when 8 is dialed during macro-6800-interceptor,s,4 > exten => _8,1,Playback(welcome) > exten => _8,2,Hangup > > > [macro-6800-interceptor] > exten => s,1,DigitTimeout,2 > exten => s,2,ResponseTimeout,7 > exten => s,3,Answer > exten => s,4,Background(autoattendant-ivr/grtg-6) > ; Play full after-hours greeting >if the 6800-interceptor is only referenced within the process-routing macro, and nowhere else in the dialplan, couldn't you just create a new context called [6800-interceptor] and change the process-routing macro to: exten => _6800,1,Goto(6800-interceptor,s,1) That might work. Flynn
Kris Boutilier
2004-Aug-27 01:59 UTC
[Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits?
Alas, the dialplan itself is more complicated than I quoted in the problem case below: There is an outer context that gathers digits from DID trunks, pads the patter to comply with the corporate dial plan and then goes into [macro-process-routing], thus: [infrom-did] exten => s,1,DigitTimeout,2 exten => s,2,ResponseTimeout,5 exten => s,3,Answer exten => s,4,Ringing exten => _XXX,1,Macro(process-routing,6${EXTEN}) ; This turns the 3 digits coming down the DID trunk into 4 digit dialplan numbers Then, inside [macro-process-routing] there are a reasonably large (<100) number of different patterns which each handle custom routing strategies for each DID number - they're seperated out from the [infrom-did] context because [macro-process-routing] is itself a target for incoming calls from other internal Asterisk servers, who're using 4 digit dialing. Those DIDs with IVRs are intended to be spun off into seperate macros with self contained logics (such as [macro-6800-interceptor]) so their digit collection strategies don't collide. However, I'm limited to one IVR at the moment because the digit collection entries have to be back up in the [macro-process-routing] routing context. So, no - unwrapping the submacros isn't really feasable. :-) -----Original Message----- From: el Flynn [mailto:el_flynn@lanvik-icu.com] Sent: August 27, 2004 1:38 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits? Kris Boutilier wrote:> > [macro-process-routing]{clip}> > [macro-6800-interceptor]{clip}> exten => s,4,Background(autoattendant-ivr/grtg-6) >if the 6800-interceptor is only referenced within the process-routing macro, and nowhere else in the dialplan, couldn't you just create a new context called [6800-interceptor] and change the process-routing macro to: exten => _6800,1,Goto(6800-interceptor,s,1) That might work. Flynn
Kris Boutilier
2004-Aug-27 18:07 UTC
[Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits?
To answer my own question: Macro(macroname|arg1|arg2...): Executes a macro using the context 'macro-<macroname>', jumping to the 's' extension of that context and executing each step, then returning when the steps end. So, having logic outside the 's' priority isn't supported. I've updated the Wiki to be more obvious on this point. -----Original Message----- From: Kris Boutilier [mailto:Kris.Boutilier@scrd.bc.ca] Sent: August 27, 2004 1:28 AM To: 'asterisk-users@lists.digium.com' Subject: [Asterisk-Users] Digit detect during a Background() inside a Macro wrongly jumps b ack to the calling context to match digits? Consider this dialplan fragment, where the call is being dialed into [macro-process-routing] over an iax2 channel from another (same build) Asterisk server: [macro-process-routing] {clip} So, why does the DTMF detect jump out to [macro-process-routing] instead of staying within [macro-6800-interceptor]? {clip}