<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<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: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";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {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>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Luiz Gustavo Chiaretto<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, March 02, 2011
8:34 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] Doubt
about cdr on asterisk</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>I have the following situation....<br>
<br>
I'm using Action Originate to originate a call for a costumer. Originate goes
to a context that call the dial application. Before the application (Dial using
the G option) to be invoked i'm setting the variable cellphone like this:<br>
<br>
[firstcontext]<br>
&nbsp;&nbsp; exten =&gt; s,1,Set(CDR(cellphone)=${CELLPHONE})<br>
&nbsp;&nbsp; exten =&gt;
s,n,Dial(IAX2/user:pass@otherasterisk/${CELLPHONE},30,G(secondcontext^s^1))<br>
<br>
[secondcontext]<br>
&nbsp;&nbsp; exten =&gt; s,1,Hangup()&nbsp; <br>
&nbsp;&nbsp; exten =&gt; s,n,Playback(something)<br>
&nbsp;&nbsp; exten =&gt; s,n,NoOp(CDR(cellphone)<br>
&nbsp;&nbsp; exten =&gt; s,n,Hangup()&nbsp; <br>
<br>
When the costumer answer the call, caller party goes to secondcontex on
extension 1 and the called party goes to secondcontex on extension 2. On
firstcontext (before the Dial) i can see the value of variable cellphone, but
on my secondcontext (after Dial)&nbsp; the variable CDR(cellphone) is blank. <br>
<br>
Is there something that i can do to pass the value after Dial application?<br>
<br>
<span id=2147aaf4-535e-4e88-9c50-311f42c9b5ef></span></font><font color=navy><span
style='color:navy'>You can&#8217;t depend on CDR to hold this value because you create
a new CDR instance with the Dial application. &nbsp;You can set a local variable and
reload CDR(cellphone) after the Dial, like this</span></font><font color=black><span
style='color:black'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>[firstcontext]<br>
&nbsp;&nbsp; exten =&gt; s,1,Set(CDR(cellphone)=${CELLPHONE})<br>
&nbsp;&nbsp; exten =&gt; s,n,Set(holdcellphone=${CELLPHONE})<br>
&nbsp;&nbsp; exten =&gt;
s,n,Dial(IAX2/user:pass@otherasterisk/${CELLPHONE},30,G(secondcontext^s^1))<br>
<br>
[secondcontext]<br>
&nbsp;&nbsp; exten =&gt; s,1,Hangup()&nbsp; <br>
&nbsp;&nbsp; exten =&gt; s,n,Playback(something)<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 color=black face="Times New Roman"><span
style='font-size:12.0pt;color:black'>&nbsp;&nbsp; Exten =&gt;
s,n,Set(CDR(cellphone)=${holdcellphone})<br>
&nbsp;&nbsp; exten =&gt; s,n,NoOp(CDR(cellphone)<br>
&nbsp;&nbsp; exten =&gt; s,n,Hangup()&nbsp; <br>
<br>
</span></font><font size=2 color=navy face=Arial><span style='font-size:10.0pt;
font-family:Arial;color:navy'><o:p></o:p></span></font></p>

</div>

</div>

</body>

</html>