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