Share variable between 2 channels

How can shared variable between to channel. please help.

Try using global variables: either in extensions.conf or by SetGlobalVar() dialplan function (or by Shared() dialplan function, starting from asterisk 1.6.1).

Details in references, of course.

[quote=“prod_user”]Try using global variables: either in extensions.conf or by SetGlobalVar() dialplan function (or by Shared() dialplan function, starting from asterisk 1.6.1).

Details in references, of course.[/quote]

Thanks, but i can not use global variable bcz variable value is changing dynamically. i am using asterisk-1.6.1.13 version so please help me to configure shared variable.

I don’t see any problems with value changing.

   [FooTest] 
   exten => 100,1,GotoIf($[${FOO} < 100]?3:)
   exten => 100,2,SetGlobalVar(FOO=1)
   exten => 100,3,SetGlobalVar(FOO=${FOO}+1)
   exten => 100,4,NoOp(${FOO}) 

Within this sample no additional configuration needed (though, somewhere you have to set initial value of FOO variable or maybe to check value of this variable for existance and then to set initial value).

p.s. We’re using global variables, so I’m close to working examples. If you want to use shared variables (as I see it’s reasonable if you want to restrict access to such variables for different channels), you have to try it on your own. As I said - Internets are full of samples and references, just try to find one you need.