[asterisk-users] Passing a variable from one Asterisk box to another

Watkins, Bradley Bradley.Watkins at compuware.com
Tue Feb 20 15:38:09 MST 2007


________________________________

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at 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. 


More information about the asterisk-users mailing list