Hi all, Is it just me and not reading the docs right, or has anybody else had problems with the AbsoluteTimeout application and the 'T' extension when used inside a macro? [macro-attended] ; ARG1 is the device to dial out on, SIP or Zap, or whatever ; ARG2 is the extension to dial using 'attended' dialing exten => s,1,AbsoluteTimeout(30) exten => s,2,AGI(attended-extension,${ARG1},${ARG2}) ; attended-extension takes a device string and an extension ; and builds a dial string according to some crazy internal logic exten => s,3,Dial(${DIALSTRING},5,t) exten => s,4,Goto(s-${DIALSTATUS},1) exten => s-NOANSWER,1,Goto(s,1) exten => T,1,NoOp("i got here here") exten => T,2,Goto(s,1) The purpose of this macro is to be able to say something like exten => _8XX,1,Macro(attended,SIP,${EXTEN}) and have the the dialed extension rung, then, if no answer within 5 seconds, have the dialed extension plus an 'attendant' for that extension rung, (etc. etc. etc.). If nobody answers after 30 seconds, the caller is (read 'will be') offered the chance to leave a voicemail, otherwise re-enter the loop, ringing the 'full' attendant list for the requested extension. When I test this, everything works according to plan, except when AbsoluteTimeout expires, my T extension inside the macro is not executed, the call is simply hungup. What am I doing wrong? Thanks, Chris
Christopher L. Wade wrote:> Hi all, > > Is it just me and not reading the docs right, or has anybody else had > problems with the AbsoluteTimeout application and the 'T' extension when > used inside a macro? > > [macro-attended] > ; ARG1 is the device to dial out on, SIP or Zap, or whatever > ; ARG2 is the extension to dial using 'attended' dialing > exten => s,1,AbsoluteTimeout(30) > exten => s,2,AGI(attended-extension,${ARG1},${ARG2}) > ; attended-extension takes a device string and an extension > ; and builds a dial string according to some crazy internal logic > exten => s,3,Dial(${DIALSTRING},5,t) > exten => s,4,Goto(s-${DIALSTATUS},1) > > exten => s-NOANSWER,1,Goto(s,1) > > exten => T,1,NoOp("i got here here") > exten => T,2,Goto(s,1) > > The purpose of this macro is to be able to say something like > > exten => _8XX,1,Macro(attended,SIP,${EXTEN}) > > and have the the dialed extension rung, then, if no answer within 5 > seconds, have the dialed extension plus an 'attendant' for that > extension rung, (etc. etc. etc.). If nobody answers after 30 seconds, > the caller is (read 'will be') offered the chance to leave a voicemail, > otherwise re-enter the loop, ringing the 'full' attendant list for the > requested extension. > > When I test this, everything works according to plan, except when > AbsoluteTimeout expires, my T extension inside the macro is not > executed, the call is simply hungup. What am I doing wrong? > > > Thanks, > Chris > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersAnybody? Right now I'm considering doing this inside an AGI app, but I don't like the way Dial is 'blocking' (AGI or not). I guess I could use chan_local in my dial string inside the AGI to make it 'fork' but that just creates a whole new ball of ear wax to deal with. :( This 'bug' seams strange though, because I've seen examples that, at least to my eyes, appear exactly the same as my above code. Any help would be appreciated. Thanks, Chris
I guess the question to ask is... Is the macro function designed to execute one extension logic and then exit back to it's original context, or is it designed to allow you to run multiple extension logics before kicking back? -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com] On Behalf Of Christopher L. Wade Sent: Tuesday, August 10, 2004 2:23 PM To: asterisk-users@lists.digium.com Subject: Re: [Asterisk-Users] AbsoluteTimeout Inside A Macro Interesting thing... If I put my 'T' extension in the context that called the macro, yet put the AbsoluteTimeout command inside the macro, my 'T' extension from outside the macro gets called... Is this a bug? (Or a feature?) Thanks, Chris _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Okay, time for an update. I posted this as a bug. Very quickly got informed that it is not a bug, but instead, an undocumented 'feature'. AbsoluteTimeout is treated as an *exception* (ie it looks like a hangup) by most applications, including Macro, which makes most applications exit. This being said, this is why a 'T' extension in the calling context would run, but not a 'T' extension inside the macro. Once macro exists, the macro context no longer exists, and the 'T' extension inside the macro becomes 'inaccessible'. Oh well, I guess I'll have to implement my logic without macros. Hopefully variables aren't screwed up by AbsoluteTimeout. Thanks, Chris