<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Helvetica, Arial, sans-serif"> Hello<br>
<br>
I am trying to use the functions SHARED and IMPORT to share
variables across SIP-channels.<br>
<br>
During my use I encounter 2 problems/questions.<br>
<br>
<br>
Question 1. only 1 shared variable per channel ??<br>
<br>
When I set 2 shared variables on a channel, and I read them a bit
futher in the dialplan, there is only 1 variable that has its
value :<br>
<br>
<br>
Dialplan : <br>
exten => s,n,Set(SHARED(TheINPUT)=1)<br>
exten => s,n,Set(SHARED(MyVar)=222)<br>
...<br>
exten => s,n,Set(Import=${IMPORT(${CHANNEL},TheINPUT)})<br>
exten => s,n,Set(ImportAdv=${IMPORT(${CHANNEL},MyVar)})<br>
<br>
<br>
Execution :<br>
<br>
[Mar 2 14:19:20] -- Executing [s@routing:56]
Set("SIP/980419-00000016", "SHARED(TheINPUT)=1") in new stack<br>
[Mar 2 14:19:20] -- Executing [s@routing:57]
Set("SIP/980419-00000016", "SHARED(MyVar)=222") in new stack<br>
...<br>
[Mar 2 14:19:26] -- Executing [s@routing:80]
Set("SIP/980419-00000016", "Import=1") in new stack<br>
[Mar 2 14:19:26] -- Executing [s@routing:81]
Set("SIP/980419-00000016", "ImportAdv=") in new stack<br>
<br>
<br>
As you can see, only variable "TheINPUT" has its value ( 1 ).
Variable 'MyVar' is empty.<br>
<br>
<br>
How come ??<br>
<br>
<br>
<br>
<br>
Question 2 : how to set a variable on another channel ??<br>
<br>
<br>
I try to set a Shared Variable on 1 channel :<br>
<br>
exten => s,n,Set(SHARED(TheINPUT,${BRIDGECH})=1)<br>
<br>
And read the variable on another channel :<br>
<br>
exten => s,n,Set(Import=${IMPORT(${BRIDGECH},TheINPUT)})<br>
exten => s,n,Set(Hell=${IMPORT(TheINPUT)})<br>
<br>
<br>
Execution :<br>
<br>
(here the shared var is set)<br>
[Mar 2 14:58:44] -- Executing [s@routing:58]
NoOp("SIP/980419-00000025", "bridgech = SIP/SipT01-00000021") in
new stack<br>
[Mar 2 14:58:44] -- Executing [s@routing:59]
Set("SIP/980419-00000025",
"SHARED(TheINPUT,SIP/SipT01-00000021)=1") in new stack<br>
<br>
(here the hared var is read)<br>
[Mar 2 14:58:54] -- Executing [s@routing:42]
Set("SIP/SipT01-00000021", "Import=") in new stack<br>
[Mar 2 14:58:54] -- Executing [s@routing:43]
Set("SIP/SipT01-00000021", "Hell=") in new stack<br>
<br>
<br>
So why is the shared variable "TheINPUT" empty on the channel
SIP/SipT01-00000021 ?? It clealry has been set by the channel
SIP/980419-00000025.<br>
<br>
<br>
<br>
<br>
Thank you for answering these 2 questions of mine.<br>
<br>
<br>
<br>
<br>
Kind regards,<br>
<br>
Jonas.<br>
</font>
</body>
</html>