Question : Passing values between asterisk servers

Hi Experts,
I am fairly new to asterisk pbx and sip technology. We have a setup of two asterisk servers connected by a WAN link. Just wondering whether it is possible to define variables in one dial plan and retrieve the value from the dial plan of the other asterisk server as below:
Code Snippet:
1:
2:
3:
4:
5:
6:
Asterisk 1
exten => s,1,Set(MyVariable=5)
exten => s,n,Dial(IAX2/Asterisk2/@default,30,r)
 
Asterisk 2
exten => ,1, Retrieve the value for MyVariable

Answer : Passing values between asterisk servers

I do it by prefixing the number with some extra digits that contain the information, then strip off those extra digits at the receiving server. It means you are quite restricted in what can be sent, but is useful for transmitting a small amount of "data". For example:

Asterisk 1
exten => s,1,Set(MYVARIABLE=5)                  ; must be a single digit piece of data
exten => s,n,Dial(IAX2/Asterisk2/${MYVARIABLE},30,r)
 
Asterisk 2
exten => _X,1,Set(MYvariable2=${EXTEN:0:1})
exten => _X,n,Goto(${EXTEN:1},1)

exten => ,1,GotoIf(${MYVariable2}=5?finish)
exten => ,n,Dial(....)
Random Solutions  
 
programming4us programming4us