<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'>
I believe the syntax is correct because,<BR>
<BR>
If I use <BR>
$dd=$dialstatus["code"];<BR>> > $agi->verbose("Status".$dd);<BR><BR>
it gives me: <BR>
<SIP/10036-000000b2>AGI Rx << GET VARIABLE DIALSTATUS<BR><SIP/10036-000000b2>AGI Tx >> 200 result=1 (ANSWER)<BR><STRONG><SIP/10036-000000b2>AGI Rx << VERBOSE "Status200" 1</STRONG><BR>
<BR>
If I use<BR>
$dd=$dialstatus["result"];<BR>> > $agi->verbose("Status".$dd);<BR><BR>
it gives me:<BR>
<BR>
<SIP/10036-000000b4>AGI Rx << GET VARIABLE DIALSTATUS<BR><SIP/10036-000000b4>AGI Tx >> 200 result=1 (CANCEL)<BR><STRONG><SIP/10036-000000b4>AGI Rx << VERBOSE "Status1" 1<BR></STRONG> <BR>
but if I use<BR>
$dd=$dialstatus["data"];<BR>> > $agi->verbose("Status".$dd);<BR><BR>
<SIP/10036-000000b6>AGI Rx << GET VARIABLE DIALSTATUS<BR><SIP/10036-000000b6>AGI Tx >> 200 result=1 (CANCEL)<BR><STRONG><SIP/10036-000000b6>AGI Rx << VERBOSE "Status" 1</STRONG><BR><BR>
Regards,<BR>
Kamlesh<BR>
<BR>
<BR>
<BR>
<DIV>
> To: asterisk-users@lists.digium.com<BR>> From: tony@softins.co.uk<BR>> Date: Fri, 2 Dec 2011 11:44:34 +0000<BR>> Subject: Re: [asterisk-users] DIALSTATUS Values<BR>> <BR>> In article <SNT142-W45A64E47437777DE653DA591B60@phx.gbl>,<BR>> Kamlesh Kumar <kamlesh_kmr@hotmail.com> wrote:<BR>> > I tried to search the answer of my problem but unable to get resolution so sending to you<BR>> > guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts using PHP. I'm unable to<BR>> > retrieve the DIALSTATUS value, during execution of AGI script, I get empty value.<BR>> > <BR>> > Extracts from AGI Script:<BR>> > <BR>> > #!/usr/bin/php -q<BR>> > #!/bin/bash<BR>> > <?php<BR>> > include_once ("phpagi-2.14/phpagi.php");<BR>> > $agi = new AGI();<BR>> > <BR>> > --------some codes for dial out------------<BR>> > <BR>> > $dialstatus=$agi->get_variable(DIALSTATUS);<BR>> <BR>> Shouldn't that be: $dialstatus=$agi->get_variable("DIALSTATUS");<BR>> <BR>> Having DIALSTATUS as a bare word might work in some versions of php,<BR>> but is likely to produce a warning. Although in your case, it does<BR>> appear to have worked.<BR>> <BR>> > $dd=$dialstatus["data"];<BR>> > $agi->verbose("Status".$dd);<BR>> > <BR>> > In AGI debug, I get: <BR>> > <SIP/10036-00000096>AGI Tx >> agi_channel: SIP/10036-00000096<BR>> > <SIP/10036-00000096>AGI Tx >> agi_language: en<BR>> > <SIP/10036-00000096>AGI Tx >> agi_type: SIP<BR>> > <SIP/10036-00000096>AGI Tx >> agi_uniqueid: 1322848927.172<BR>> > <SIP/10036-00000096>AGI Tx >> agi_version: 1.6.2.7<BR>> > <SIP/10036-00000096>AGI Tx >> agi_callerid: 10036<BR>> > <SIP/10036-00000096>AGI Tx >> agi_calleridname: 10036<BR>> > <SIP/10036-00000096>AGI Tx >> agi_dnid: 0012127773456<BR>> > <SIP/10036-00000096>AGI Tx >> agi_rdnis: unknown<BR>> > <SIP/10036-00000096>AGI Tx >> agi_context: privoip<BR>> > <SIP/10036-00000096>AGI Tx >> agi_extension: 0012127773456<BR>> > <SIP/10036-00000096>AGI Rx << GET VARIABLE DIALSTATUS<BR>> > <SIP/10036-00000096>AGI Tx >> 200 result=1 (ANSWER)<BR>> <BR>> This shows that AGI is indeed returning the value of DIALSTATUS,<BR>> which is ANSWER.<BR>> <BR>> > <SIP/10036-00000096>AGI Rx << VERBOSE "Status" 1<BR>> <BR>> But you are not picking it up.<BR>> <BR>> > <SIP/10036-00000096>AGI Tx >> 200 result=1<BR>> > <BR>> > Please help me in this.<BR>> <BR>> I'm not familiar with php-agi (I usualy write my AGI in C), but it<BR>> looks like $dialstatus["data"] is not the correct way to retrieve<BR>> the returned value. Or else there is a bug in php-agi.<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>