Hello all, I'm having trouble getting variables to work the way I want them to, let me begin with a simple explanation of the problem, I'm using something like this in my extensions.conf: [default] exten => 5000,1,SetVar(Recipient=test@test.com) exten => 5000,2,Goto(mailexten,s,1) exten => 6000,1,SetVar(Recipient=test@test.com) exten => 6000,2,Goto(mailexten,s,1) [mailexten] exten => s,1,System(/mail.sh ${Recipient}) exten => s,2,Hangup As an unsuspecting user, I thought this would work - the variable Recipient should be available in the [mailexten] context, but apparently this is not the case. I'm using Asterisk 1.0.9, is this a known problem or am I just expecting the wrong thing? Sincerely, Frank
On Mon, 11 Jul 2005, Frank Schoep wrote:> Hello all, > > I'm having trouble getting variables to work the way I want them to, let me > begin with a simple explanation of the problem, I'm using something like this > in my extensions.conf: > > [default] > exten => 5000,1,SetVar(Recipient=test@test.com) > exten => 5000,2,Goto(mailexten,s,1) > > exten => 6000,1,SetVar(Recipient=test@test.com) > exten => 6000,2,Goto(mailexten,s,1) > > [mailexten] > exten => s,1,System(/mail.sh ${Recipient}) > exten => s,2,Hangup > > As an unsuspecting user, I thought this would work - the variable Recipient > should be available in the [mailexten] context, but apparently this is not > the case. I'm using Asterisk 1.0.9, is this a known problem or am I just > expecting the wrong thing?Try SetGlobalVar() Armin
Try prepending two _'s like this. exten => 5000,1,SetVar(__Recipient=test@test.com) exten => 5000,2,Goto(mailexten,s,1 It allows the variable to be exported.> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com > [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of > Frank Schoep > Sent: Monday, July 11, 2005 4:40 AM > To: Asterisk-Users@lists.digium.com > Subject: [Asterisk-Users] Sharing variables between contexts > > Hello all, > > I'm having trouble getting variables to work the way I want > them to, let me begin with a simple explanation of the > problem, I'm using something like this in my extensions.conf: > > [default] > exten => 5000,1,SetVar(Recipient=test@test.com) > exten => 5000,2,Goto(mailexten,s,1) > > exten => 6000,1,SetVar(Recipient=test@test.com) > exten => 6000,2,Goto(mailexten,s,1) > > [mailexten] > exten => s,1,System(/mail.sh ${Recipient}) exten => s,2,Hangup > > As an unsuspecting user, I thought this would work - the > variable Recipient should be available in the [mailexten] > context, but apparently this is not the case. I'm using > Asterisk 1.0.9, is this a known problem or am I just > expecting the wrong thing? > > Sincerely, > > Frank > _______________________________________________ > 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 > >