Robert Rozman
2005-Mar-03 14:11 UTC
[Asterisk-Users] Why ${EXTEN} variable changes after Goto ?
Hi, I'm trying to implement dynamic routing of incoming calls to local extension if previous outgoing call was unanswered. But after I do Goto to s-NOANSWER, variable ${EXTEN} changes to 's-NOANSWER'. I guess this is normal, but I don't understand why ? How to workaround on this one ? Thanks in advance, regards, Rob. [outbound-capi-ISDN] exten => _0.,1,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104370 from ${CALLERIDNUM}) exten => _0.,2,Dial,CAPI/7104370:b${EXTEN:1}|10|Tt exten => _0.,3,Goto(s-${DIALSTATUS},1) exten => _0.,103,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104371) exten => _0.,104,Dial,CAPI/7104371:b${EXTEN:1}|30|Tt exten => _0.,105,Goto(s-${DIALSTATUS},1) exten => _0.,205,Macro(outisbusy) exten => s-NOANSWER,1,NoOp(NOANSWER - Setting dynamic autoroute for ISDN number ${EXTEN:1} to local ext. ${CALLERIDNUM}) exten => s-NOANSWER,2,DBput(DYNAMIC/${EXTEN}=${CALLERIDNUM}) exten => s-NOANSWER,3,Congestion exten => _s-.,1,Congestion exten => _s-.,2,Macro(hangupcall)
Matthew Boehm
2005-Mar-03 14:29 UTC
[Asterisk-Users] Why ${EXTEN} variable changes after Goto ?
${EXTEN} is the extension you are currently at. exten => s,1,Goto(444) ; ${EXTEN} = s exten => 444,1,NoOp(bleh) ; ${EXTEN} = 444 exten => someotherextension,1,NoOp() ; $EXTEN = someotherextension -Matthew ----- Original Message ----- From: "Robert Rozman" <rozman@fri.uni-lj.si> To: "Asterisk Users Mailing List - Non-Commercial Discussion" <asterisk-users@lists.digium.com> Sent: Thursday, March 03, 2005 3:11 PM Subject: [Asterisk-Users] Why ${EXTEN} variable changes after Goto ?> Hi, > > I'm trying to implement dynamic routing of incoming calls to localextension> if previous outgoing call was unanswered. > But after I do Goto to s-NOANSWER, variable ${EXTEN} changes to > 's-NOANSWER'. I guess this is normal, but I don't understand why ? How to > workaround on this one ? > > Thanks in advance, > > regards, > > Rob. > > [outbound-capi-ISDN] > exten => _0.,1,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104370 from > ${CALLERIDNUM}) > exten => _0.,2,Dial,CAPI/7104370:b${EXTEN:1}|10|Tt > exten => _0.,3,Goto(s-${DIALSTATUS},1) > exten => _0.,103,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104371) > exten => _0.,104,Dial,CAPI/7104371:b${EXTEN:1}|30|Tt > exten => _0.,105,Goto(s-${DIALSTATUS},1) > exten => _0.,205,Macro(outisbusy) > > exten => s-NOANSWER,1,NoOp(NOANSWER - Setting dynamic autoroute for ISDN > number ${EXTEN:1} to local ext. ${CALLERIDNUM}) > exten => s-NOANSWER,2,DBput(DYNAMIC/${EXTEN}=${CALLERIDNUM}) > exten => s-NOANSWER,3,Congestion > > exten => _s-.,1,Congestion > exten => _s-.,2,Macro(hangupcall) > > _______________________________________________ > 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
Umar Sear
2005-Mar-03 15:01 UTC
[Asterisk-Users] Why ${EXTEN} variable changes after Goto ?
On Thu, 3 Mar 2005 22:11:23 +0100, Robert Rozman <rozman@fri.uni-lj.si> wrote:> Hi, > > I'm trying to implement dynamic routing of incoming calls to local extension > if previous outgoing call was unanswered. > But after I do Goto to s-NOANSWER, variable ${EXTEN} changes to > 's-NOANSWER'. I guess this is normal, but I don't understand why ? How to > workaround on this one ? > > Thanks in advance, > > regards, > > Rob. > > [outbound-capi-ISDN] > exten => _0.,1,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104370 from > ${CALLERIDNUM}) > exten => _0.,2,Dial,CAPI/7104370:b${EXTEN:1}|10|Tt > exten => _0.,3,Goto(s-${DIALSTATUS},1) > exten => _0.,103,NoOp(Calling ISDN number ${EXTEN:1} on CAPI/7104371) > exten => _0.,104,Dial,CAPI/7104371:b${EXTEN:1}|30|Tt > exten => _0.,105,Goto(s-${DIALSTATUS},1) > exten => _0.,205,Macro(outisbusy) > > exten => s-NOANSWER,1,NoOp(NOANSWER - Setting dynamic autoroute for ISDN > number ${EXTEN:1} to local ext. ${CALLERIDNUM}) > exten => s-NOANSWER,2,DBput(DYNAMIC/${EXTEN}=${CALLERIDNUM}) > exten => s-NOANSWER,3,Congestion > > exten => _s-.,1,Congestion > exten => _s-.,2,Macro(hangupcall) >Save the original extension to a variable like ... exten => _0.,1,SetVar(myvar=${EXTEN})
Eric Wieling
2005-Mar-04 03:45 UTC
[Asterisk-Users] Why ${EXTEN} variable changes after Goto ?
On Thursday 03 March 2005 04:11 pm, Robert Rozman wrote:> Hi, > > I'm trying to implement dynamic routing of incoming calls to local > extension if previous outgoing call was unanswered. > But after I do Goto to s-NOANSWER, variable ${EXTEN} changes to > 's-NOANSWER'. I guess this is normal, but I don't understand why ? How to > workaround on this one ?exten => 42,1,SetVar(SAVED_EXTEN=${EXTEN}) exten => 42,2,Goto(marvin,27,1)