<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Can anybody please reply on this?<BR>
&nbsp;<BR>
Regards,<BR>
Kamlesh<BR>&nbsp;<BR>
<DIV>
<DIV id=SkyDrivePlaceholder></DIV>
<HR id=stopSpelling>
From: kamlesh_kmr@hotmail.com<BR>To: asterisk-users@lists.digium.com<BR>Date: Tue, 27 Dec 2011 09:49:21 +0000<BR>Subject: Re: [asterisk-users] DIALSTATUS Values<BR><BR>
<META name=Generator content="Microsoft SafeHTML">
<STYLE>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</STYLE>

<DIV dir=ltr>Hello,<BR>&nbsp;<BR>After investing some time, I could come to know the reason for not getting the data value is that if I&nbsp;use system command with any of asterisk cli&nbsp;command as given below, data value is returned blank.<BR>&nbsp;<BR>$output=system("/usr/sbin/asterisk -rx 'sip show peers' | grep OK | cut -f 1 -d / | grep '100' ")<BR>&nbsp;<BR>Could you please suggest now how to rectify this?<BR>&nbsp;<BR>Regards,<BR>Kamlesh<BR>&nbsp;<BR>
<DIV>
<DIV id=ecxSkyDrivePlaceholder></DIV>&gt; To: asterisk-users@lists.digium.com<BR>&gt; From: tony@softins.co.uk<BR>&gt; Date: Fri, 2 Dec 2011 12:27:19 +0000<BR>&gt; Subject: Re: [asterisk-users] DIALSTATUS Values<BR>&gt; <BR>&gt; In article &lt;SNT142-W54267269808AFD17BCCD5891B60@phx.gbl&gt;,<BR>&gt; Kamlesh Kumar &lt;kamlesh_kmr@hotmail.com&gt; wrote:<BR>&gt; &gt; In addition to my reply:<BR>&gt; &gt; <BR>&gt; &gt; I used to fetch the value using print_r function but that also tells that there is no value<BR>&gt; &gt; in data section.<BR>&gt; &gt; $dialstatus=$agi-&gt;get_variable(DIALSTATUS);<BR>&gt; &gt; print_r($dialstatus);<BR>&gt; &gt; <BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; GET VARIABLE DIALSTATUS<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 200 result=1 (CANCEL)<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; Array<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<BR>&gt; &gt; [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; (<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<BR>&gt; &gt; [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; [code] =&gt; 200<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<BR>&gt; &gt; [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; [result] =&gt; 1<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Tx &gt;&gt; 510 Invalid or unknown command<BR>&gt; &gt; [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe<BR>&gt; &gt; &lt;SIP/10036-000000b8&gt;AGI Rx &lt;&lt; [data] =&gt;<BR>&gt; <BR>&gt; Well since the AGI return string does indeed contain the value, shown<BR>&gt; above as (CANCEL), that suggests there is definitely a bug in php-agi.<BR>&gt; It appears to be creating a ['data'] element, but not setting it.<BR>&gt; You will have to study the source code and work out how to fix it.<BR>&gt; I did a quick google for "php agi get variable" and found other reports<BR>&gt; of it not working properly, but I didn't see anyone offer a solution.<BR>&gt; It's only programming, so it shouldn't be hard to fix.<BR>&gt; <BR>&gt; Cheers<BR>&gt; Tony<BR>&gt; -- <BR>&gt; Tony Mountifield<BR>&gt; Work: tony@softins.co.uk - http://www.softins.co.uk<BR>&gt; Play: tony@mountifield.org - http://tony.mountifield.org<BR>&gt; <BR>&gt; --<BR>&gt; _____________________________________________________________________<BR>&gt; -- Bandwidth and Colocation Provided by http://www.api-digital.com --<BR>&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>&gt; http://www.asterisk.org/hello<BR>&gt; <BR>&gt; asterisk-users mailing list<BR>&gt; To UNSUBSCRIBE or update options visit:<BR>&gt; http://lists.digium.com/mailman/listinfo/asterisk-users<BR></DIV></DIV><BR>-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users</DIV>                                               </div></body>
</html>