Eric Bishop
2007-Feb-20 15:10 UTC
[asterisk-users] Passing a variable from one Asterisk box to another
Hi all, We currently have 2 Asterisk boxes and we pass calls to a fro. All works great except we now need to pass variables between them. For example now on box 1 we have: exten => _23XX,1,SetVar(Foo=1234) exten => _23XX,2,Dial(SIP/${EXTEN:0}@Box2) When the call dials into Box 2 the variable Foo does not get passed... Does anyone have any clever ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070220/57a962b9/attachment.htm
Richard Lyman
2007-Feb-20 15:22 UTC
[asterisk-users] Passing a variable from one Asterisk box to another
Eric Bishop wrote:> Hi all, > > We currently have 2 Asterisk boxes and we pass calls to a fro. All works > great except we now need to pass variables between them. > > For example now on box 1 we have: > > exten => _23XX,1,SetVar(Foo=1234) > exten => _23XX,2,Dial(SIP/${EXTEN:0}@Box2) > > When the call dials into Box 2 the variable Foo does not get passed... > > Does anyone have any clever ideas?as noted in asterisk/docs/README.variables (iirc) you should see that variable inheritance can occur by prefacing the variable with '_' or '__' also, depending on the age of your asterisk you might want to start using 'Set' vice 'SetVar' also, having ${EXTEN:0} , the :0 doesn't do anything, so you should not use it and just have ${EXTEN} i hope this helps
Watkins, Bradley
2007-Feb-20 15:38 UTC
[asterisk-users] Passing a variable from one Asterisk box to another
________________________________ From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Eric Bishop Sent: Tuesday, February 20, 2007 5:11 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Passing a variable from one Asterisk box to another Hi all, We currently have 2 Asterisk boxes and we pass calls to a fro. All works great except we now need to pass variables between them. For example now on box 1 we have: exten => _23XX,1,SetVar(Foo=1234) exten => _23XX,2,Dial(SIP/${EXTEN:0}@Box2) When the call dials into Box 2 the variable Foo does not get passed... Does anyone have any clever ideas? The correct way using SIP is to add X headers before the Dial and then pulling them in and assigning them to channel variables on the ingress box. Here's a snippet that shows the idea: On the box dialing out: exten => _23XX,1,Set(Foo=1234) <--- Use Set here not SetVar exten => _23XX,2,SIPAddHeader(X-Foo: ${FOO}) exten => _23XX,3,Dial(SIP/${EXTEN:0}@Box2) On the ingress box: exten => _23XX,1,Set(Foo=${SIP_HEADER(X-Foo)}) exten => _23XX,2,Answer() ...yada yada Regards, - Brad The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
Justin Newman
2007-Feb-20 22:00 UTC
[asterisk-users] Re: Passing a variable from one Asterisk box to another
Use SIP headers... you could also use the SIP headers to store a ID/key for lookups against a database (e.g., store your call associated data in the database, for use by multiple machines). Justin Newman ____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html
C F
2007-Feb-21 16:41 UTC
[asterisk-users] Passing a variable from one Asterisk box to another
You could also use Set(CALLERID(name)=1234*${CALLERID(name)}) and then on the other astereisk server use app_cut to reformat CID and extract the Var. On 2/20/07, Eric Bishop <asterisk.eric@gmail.com> wrote:> Hi all, > > We currently have 2 Asterisk boxes and we pass calls to a fro. All works > great except we now need to pass variables between them. > > For example now on box 1 we have: > > exten => _23XX,1,SetVar(Foo=1234) > exten => _23XX,2,Dial(SIP/${EXTEN:0}@Box2) > > When the call dials into Box 2 the variable Foo does not get passed... > > Does anyone have any clever ideas? > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > >