<div dir="ltr"><div>This works fine for me,</div><div><br></div><div>            $dialstatus     = $agi-&gt;get_variable(&quot;DIALSTATUS&quot;);</div><div>            $cdr[&#39;dialstatus&#39;]     = $dialstatus[&#39;data&#39;];</div>

<br class="Apple-interchange-newline"><div dir="ltr">Try as it is, I believe it&#39;s because of concatenation.</div><div dir="ltr"><br></div><div dir="ltr">Regards,<br>Zohair Raza<div><br></div></div><br>
<br><br><div class="gmail_quote">On Fri, Dec 2, 2011 at 4:27 PM, Tony Mountifield <span dir="ltr">&lt;<a href="mailto:tony@softins.co.uk">tony@softins.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

In article &lt;SNT142-W54267269808AFD17BCCD5891B60@phx.gbl&gt;,<br>
<div class="im">Kamlesh Kumar &lt;<a href="mailto:kamlesh_kmr@hotmail.com">kamlesh_kmr@hotmail.com</a>&gt; wrote:<br>
&gt; In addition to my reply:<br>
&gt;<br>
&gt; I used to fetch the value using print_r function but that also tells that there is no value<br>
&gt; in data section.<br>
&gt; $dialstatus=$agi-&gt;get_variable(DIALSTATUS);<br>
&gt; print_r($dialstatus);<br>
&gt;<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; GET VARIABLE DIALSTATUS<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 200 result=1 (CANCEL)<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; Array<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<br>
&gt; [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; (<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<br>
&gt; [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt;     [code] =&gt; 200<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<br>
&gt; [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt;     [result] =&gt; 1<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<br>
&gt; [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<br>
&gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt;     [data] =&gt;<br>
<br>
</div>Well since the AGI return string does indeed contain the value, shown<br>
above as (CANCEL), that suggests there is definitely a bug in php-agi.<br>
It appears to be creating a [&#39;data&#39;] element, but not setting it.<br>
You will have to study the source code and work out how to fix it.<br>
I did a quick google for &quot;php agi get variable&quot; and found other reports<br>
of it not working properly, but I didn&#39;t see anyone offer a solution.<br>
It&#39;s only programming, so it shouldn&#39;t be hard to fix.<br>
<div class="HOEnZb"><div class="h5"><br>
Cheers<br>
Tony<br>
--<br>
Tony Mountifield<br>
Work: <a href="mailto:tony@softins.co.uk">tony@softins.co.uk</a> - <a href="http://www.softins.co.uk" target="_blank">http://www.softins.co.uk</a><br>
Play: <a href="mailto:tony@mountifield.org">tony@mountifield.org</a> - <a href="http://tony.mountifield.org" target="_blank">http://tony.mountifield.org</a><br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
               <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br></div>