<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 09/09/2010 04:12 PM, Danny Nicholas wrote:
<blockquote cite="mid:201009091340.o89DeFiZ003071@mail.debsinc.com"
type="cite">
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:smarttagtype
namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<div>
<div class="MsoNormal" style="text-align: center;" align="center"><font
size="3" color="black" face="Times New Roman"><span
style="font-size: 12pt; color: windowtext;">
<hr tabindex="-1" size="2" width="100%" align="center"></span></font></div>
<p class="MsoNormal"><b><font size="2" color="black" face="Tahoma"><span
style="font-size: 10pt; font-family: Tahoma; color: windowtext; font-weight: bold;">From:</span></font></b><font
size="2" color="black" face="Tahoma"><span
style="font-size: 10pt; font-family: Tahoma; color: windowtext;">
<a class="moz-txt-link-abbreviated" href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a>
[<a class="moz-txt-link-freetext" href="mailto:asterisk-users-bounces@lists.digium.com">mailto:asterisk-users-bounces@lists.digium.com</a>] <b><span
style="font-weight: bold;">On Behalf Of </span></b>Jonas Kellens<br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday,
September 09, 2010
8:56 AM<br>
<b><span style="font-weight: bold;">To:</span></b> <st1:personname
w:st="on">Asterisk Users Mailing List - Non-Commercial Discussion</st1:personname><br>
<b><span style="font-weight: bold;">Subject:</span></b>
[asterisk-users] Set
channel variable from within other channel</span></font><font
color="black"><span style="color: windowtext;"><o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="3" color="black"
face="Times New Roman"><span style="font-size: 12pt;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="3" color="black" face="Helvetica"><span
style="font-size: 12pt; font-family: Helvetica;">Hello list,<br>
<br>
is it possible to set a variable (channel variable) from within another
channel
?!<br>
<br>
I'm currently working with 2 channels that I bridge afterwards. It
would be
good to set a variable in one channel when something occurs in the
other
channel.<br>
<br>
If some variable is not set in channel 1, then this means something for
channel
2. But from within channel 2 I can not see the variables that are set
in
channel 1.<br>
<br>
The suggestion of using global variables I think will create
difficulties with
simultaneous calls...<br>
<br>
<br>
Kind regards,<br>
<br>
Jonas.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">AFAIK, it is
not possible to set a local
variable for 1 call from another. If GLOBAL variables are a concern,
why
not use the ASTDB to store/retrieve these values?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">exten =>
1234,1,Set(DB(passval/${EXTEN}/val1)=1)
will create a key passval/channelname/val with value 1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">on further
reflection<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">exten =>
1234,1,Set(DB(passval/${EXTEN:0:7}/val1)=1)
might create a better reference key<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">For a call
on SIP/170, line 1 would create
passval/SIP-170abcdefg/val1, line 2 would create passval/SIP-170/val1<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">To see what
the channel wrote, you would
need to get the bridged channel value (perhaps core show channels
verbose?) and
do<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">Exten =>
3456,1,Set(CHAN2=bridged
channel)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">Exten =>
3456,n,Set(TEST2=${DB(passval/${CHAN2}/val1)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">Regards,<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span
style="font-size: 10pt; font-family: Arial; color: navy;">Danny
Nicholas</span></font></p>
</div>
</o:smarttagtype></blockquote>
<br>
Danny,<br>
<br>
the wiki mentions :<br>
<br>
Set(DB(family/key)=${foo})<br>
<br>
What is this 'passval' you are talking about ?!<br>
<br>
<br>
Kind regards,<br>
<br>
Jonas.<br>
</body>
</html>