Re: [asterisk-users] DIALSTATUS Values

2012-01-04 Thread Kamlesh Kumar

Can anybody please reply on this?
 
Regards,
Kamlesh
 



From: kamlesh_...@hotmail.com
To: asterisk-users@lists.digium.com
Date: Tue, 27 Dec 2011 09:49:21 +
Subject: Re: [asterisk-users] DIALSTATUS Values





Hello,
 
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.
 
$output=system(/usr/sbin/asterisk -rx 'sip show peers' | grep OK | cut -f 1 -d 
/ | grep '100' )
 
Could you please suggest now how to rectify this?
 
Regards,
Kamlesh
 


 To: asterisk-users@lists.digium.com
 From: t...@softins.co.uk
 Date: Fri, 2 Dec 2011 12:27:19 +
 Subject: Re: [asterisk-users] DIALSTATUS Values
 
 In article snt142-w54267269808afd17bccd5891...@phx.gbl,
 Kamlesh Kumar kamlesh_...@hotmail.com wrote:
  In addition to my reply:
  
  I used to fetch the value using print_r function but that also tells that 
  there is no value
  in data section.
  $dialstatus=$agi-get_variable(DIALSTATUS);
  print_r($dialstatus);
  
  SIP/10036-00b8AGI Rx  GET VARIABLE DIALSTATUS
  SIP/10036-00b8AGI Tx  200 result=1 (CANCEL)
  SIP/10036-00b8AGI Rx  Array
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  (
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [code] = 200
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [result] = 1
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [data] =
 
 Well since the AGI return string does indeed contain the value, shown
 above as (CANCEL), that suggests there is definitely a bug in php-agi.
 It appears to be creating a ['data'] element, but not setting it.
 You will have to study the source code and work out how to fix it.
 I did a quick google for php agi get variable and found other reports
 of it not working properly, but I didn't see anyone offer a solution.
 It's only programming, so it shouldn't be hard to fix.
 
 Cheers
 Tony
 -- 
 Tony Mountifield
 Work: t...@softins.co.uk - http://www.softins.co.uk
 Play: t...@mountifield.org - http://tony.mountifield.org
 
 --
 _
 -- 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

-- _ -- 
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   
 --
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2012-01-04 Thread Zohair Raza
This works fine for me,

$dialstatus = $agi-get_variable(DIALSTATUS);
$cdr['dialstatus'] = $dialstatus['data'];

Try as it is, I believe it's because of concatenation.

Regards,
Zohair Raza




On Fri, Dec 2, 2011 at 4:27 PM, Tony Mountifield t...@softins.co.uk wrote:

 In article snt142-w54267269808afd17bccd5891...@phx.gbl,
 Kamlesh Kumar kamlesh_...@hotmail.com wrote:
  In addition to my reply:
 
  I used to fetch the value using print_r function but that also tells
 that there is no value
  in data section.
  $dialstatus=$agi-get_variable(DIALSTATUS);
  print_r($dialstatus);
 
  SIP/10036-00b8AGI Rx  GET VARIABLE DIALSTATUS
  SIP/10036-00b8AGI Tx  200 result=1 (CANCEL)
  SIP/10036-00b8AGI Rx  Array
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write()
 returned error: Broken pipe
  SIP/10036-00b8AGI Rx  (
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write()
 returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [code] = 200
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write()
 returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [result] = 1
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write()
 returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [data] =

 Well since the AGI return string does indeed contain the value, shown
 above as (CANCEL), that suggests there is definitely a bug in php-agi.
 It appears to be creating a ['data'] element, but not setting it.
 You will have to study the source code and work out how to fix it.
 I did a quick google for php agi get variable and found other reports
 of it not working properly, but I didn't see anyone offer a solution.
 It's only programming, so it shouldn't be hard to fix.

 Cheers
 Tony
 --
 Tony Mountifield
 Work: t...@softins.co.uk - http://www.softins.co.uk
 Play: t...@mountifield.org - http://tony.mountifield.org

 --
 _
 -- 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

--
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-27 Thread Kamlesh Kumar

Hello,
 
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.
 
$output=system(/usr/sbin/asterisk -rx 'sip show peers' | grep OK | cut -f 1 -d 
/ | grep '100' )
 
Could you please suggest now how to rectify this?
 
Regards,
Kamlesh
 

 To: asterisk-users@lists.digium.com
 From: t...@softins.co.uk
 Date: Fri, 2 Dec 2011 12:27:19 +
 Subject: Re: [asterisk-users] DIALSTATUS Values
 
 In article snt142-w54267269808afd17bccd5891...@phx.gbl,
 Kamlesh Kumar kamlesh_...@hotmail.com wrote:
  In addition to my reply:
  
  I used to fetch the value using print_r function but that also tells that 
  there is no value
  in data section.
  $dialstatus=$agi-get_variable(DIALSTATUS);
  print_r($dialstatus);
  
  SIP/10036-00b8AGI Rx  GET VARIABLE DIALSTATUS
  SIP/10036-00b8AGI Tx  200 result=1 (CANCEL)
  SIP/10036-00b8AGI Rx  Array
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  (
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [code] = 200
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [result] = 1
  SIP/10036-00b8AGI Tx  510 Invalid or unknown command
  [Dec 3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
  returned error: Broken pipe
  SIP/10036-00b8AGI Rx  [data] =
 
 Well since the AGI return string does indeed contain the value, shown
 above as (CANCEL), that suggests there is definitely a bug in php-agi.
 It appears to be creating a ['data'] element, but not setting it.
 You will have to study the source code and work out how to fix it.
 I did a quick google for php agi get variable and found other reports
 of it not working properly, but I didn't see anyone offer a solution.
 It's only programming, so it shouldn't be hard to fix.
 
 Cheers
 Tony
 -- 
 Tony Mountifield
 Work: t...@softins.co.uk - http://www.softins.co.uk
 Play: t...@mountifield.org - http://tony.mountifield.org
 
 --
 _
 -- 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
  --
_
-- 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

[asterisk-users] DIALSTATUS Values

2011-12-02 Thread Kamlesh Kumar

Hello,
 
I tried to search the answer of my problem but unable to get resolution so 
sending to you guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts 
using PHP. I'm unable to retrieve the DIALSTATUS value, during execution of AGI 
script, I get empty value.
 
Extracts from AGI Script:
 
#!/usr/bin/php -q
#!/bin/bash
?php
include_once (phpagi-2.14/phpagi.php);
$agi = new AGI();

some codes for dial out
 
   $dialstatus=$agi-get_variable(DIALSTATUS);
   $dd=$dialstatus[data];
   $agi-verbose(Status.$dd);
 
In AGI debug, I get: 
SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
SIP/10036-0096AGI Tx  agi_language: en
SIP/10036-0096AGI Tx  agi_type: SIP
SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
SIP/10036-0096AGI Tx  agi_callerid: 10036
SIP/10036-0096AGI Tx  agi_calleridname: 10036
SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
SIP/10036-0096AGI Tx  agi_rdnis: unknown
SIP/10036-0096AGI Tx  agi_context: privoip
SIP/10036-0096AGI Tx  agi_extension: 0012127773456
SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-0096AGI Tx  200 result=1 (ANSWER)
SIP/10036-0096AGI Rx  VERBOSE Status 1
SIP/10036-0096AGI Tx  200 result=1
 
Please help me in this.
 
Thanks,
Kamlesh
 
 

  --
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Sammy Govind
Hi,
How are you calling this AGI in your dialplan !!?

Regards,
Sammy.

On Fri, Dec 2, 2011 at 3:18 PM, Kamlesh Kumar kamlesh_...@hotmail.comwrote:

  Hello,

 I tried to search the answer of my problem but unable to get resolution so
 sending to you guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts
 using PHP. I'm unable to retrieve the DIALSTATUS value, during execution of
 AGI script, I get empty value.

 Extracts from AGI Script:

 #!/usr/bin/php -q
 #!/bin/bash
 ?php
 include_once (phpagi-2.14/phpagi.php);
 $agi = new AGI();

 some codes for dial out

$dialstatus=$agi-get_variable(DIALSTATUS);
$dd=$dialstatus[data];
$agi-verbose(Status.$dd);

 In AGI debug, I get:
 SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
 SIP/10036-0096AGI Tx  agi_language: en
 SIP/10036-0096AGI Tx  agi_type: SIP
 SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
 SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
 SIP/10036-0096AGI Tx  agi_callerid: 10036
 SIP/10036-0096AGI Tx  agi_calleridname: 10036
 SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
 SIP/10036-0096AGI Tx  agi_rdnis: unknown
 SIP/10036-0096AGI Tx  agi_context: privoip
 SIP/10036-0096AGI Tx  agi_extension: 0012127773456
 *SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
 SIP/10036-0096AGI Tx  200 result=1 (ANSWER)
 SIP/10036-0096AGI Rx  VERBOSE Status 1
 SIP/10036-0096AGI Tx  200 result=1*
 **
 Please help me in this.

 Thanks,
 Kamlesh
 **
 *


 *

 --
 _
 -- 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

--
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Kamlesh Kumar

Hello,
 
in /etc/extension.conf
 
[privoip]
exten = _00X.,n,AGI(isdcall.php)

Regards,
Kamlesh
 



Date: Fri, 2 Dec 2011 16:16:27 +0500
From: govoi...@gmail.com
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] DIALSTATUS Values

Hi,
How are you calling this AGI in your dialplan !!? 


Regards,
Sammy.


On Fri, Dec 2, 2011 at 3:18 PM, Kamlesh Kumar kamlesh_...@hotmail.com wrote:



Hello,
 
I tried to search the answer of my problem but unable to get resolution so 
sending to you guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts 
using PHP. I'm unable to retrieve the DIALSTATUS value, during execution of AGI 
script, I get empty value.
 
Extracts from AGI Script:
 
#!/usr/bin/php -q
#!/bin/bash
?php
include_once (phpagi-2.14/phpagi.php);
$agi = new AGI();

some codes for dial out
 
   $dialstatus=$agi-get_variable(DIALSTATUS);
   $dd=$dialstatus[data];
   $agi-verbose(Status.$dd);
 
In AGI debug, I get: 
SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
SIP/10036-0096AGI Tx  agi_language: en
SIP/10036-0096AGI Tx  agi_type: SIP
SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
SIP/10036-0096AGI Tx  agi_callerid: 10036
SIP/10036-0096AGI Tx  agi_calleridname: 10036
SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
SIP/10036-0096AGI Tx  agi_rdnis: unknown
SIP/10036-0096AGI Tx  agi_context: privoip
SIP/10036-0096AGI Tx  agi_extension: 0012127773456
SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-0096AGI Tx  200 result=1 (ANSWER)
SIP/10036-0096AGI Rx  VERBOSE Status 1
SIP/10036-0096AGI Tx  200 result=1
 
Please help me in this.
 
Thanks,
Kamlesh
 
 



--
_
-- 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


-- _ -- 
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   
 --
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Sammy Govind
Can you also paste the Asterisk Console logs around the part where AGI is
dialing and after the dialing part ! make sure AGi debug is enabled as well.


On Fri, Dec 2, 2011 at 4:24 PM, Kamlesh Kumar kamlesh_...@hotmail.comwrote:

  Hello,

 in /etc/extension.conf

 [privoip]
 exten = _00X.,n,AGI(isdcall.php)

 Regards,
 Kamlesh

  --
 Date: Fri, 2 Dec 2011 16:16:27 +0500
 From: govoi...@gmail.com
 To: asterisk-users@lists.digium.com
 Subject: Re: [asterisk-users] DIALSTATUS Values


 Hi,
 How are you calling this AGI in your dialplan !!?

 Regards,
 Sammy.

 On Fri, Dec 2, 2011 at 3:18 PM, Kamlesh Kumar kamlesh_...@hotmail.comwrote:

  Hello,

 I tried to search the answer of my problem but unable to get resolution so
 sending to you guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts
 using PHP. I'm unable to retrieve the DIALSTATUS value, during execution of
 AGI script, I get empty value.

 Extracts from AGI Script:

 #!/usr/bin/php -q
 #!/bin/bash
 ?php
 include_once (phpagi-2.14/phpagi.php);
 $agi = new AGI();

 some codes for dial out

$dialstatus=$agi-get_variable(DIALSTATUS);
$dd=$dialstatus[data];
$agi-verbose(Status.$dd);

 In AGI debug, I get:
 SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
 SIP/10036-0096AGI Tx  agi_language: en
 SIP/10036-0096AGI Tx  agi_type: SIP
 SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
 SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
 SIP/10036-0096AGI Tx  agi_callerid: 10036
 SIP/10036-0096AGI Tx  agi_calleridname: 10036
 SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
 SIP/10036-0096AGI Tx  agi_rdnis: unknown
 SIP/10036-0096AGI Tx  agi_context: privoip
 SIP/10036-0096AGI Tx  agi_extension: 0012127773456
 *SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
 SIP/10036-0096AGI Tx  200 result=1 (ANSWER)
 SIP/10036-0096AGI Rx  VERBOSE Status 1
 SIP/10036-0096AGI Tx  200 result=1*
 **
 Please help me in this.

 Thanks,
 Kamlesh
 **
 *


 *

 --
 _
 -- 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



 -- _
 -- 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

 --
 _
 -- 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

--
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Kamlesh Kumar

Here it is:
 
SIP/10036-00a8AGI Tx  agi_request: isdcall.php
SIP/10036-00a8AGI Tx  agi_channel: SIP/10036-00a8
SIP/10036-00a8AGI Tx  agi_language: en
SIP/10036-00a8AGI Tx  agi_type: SIP
SIP/10036-00a8AGI Tx  agi_uniqueid: 1322853473.198
SIP/10036-00a8AGI Tx  agi_version: 1.6.2.7
SIP/10036-00a8AGI Tx  agi_callerid: 10036
SIP/10036-00a8AGI Tx  agi_calleridname: 10036
SIP/10036-00a8AGI Tx  agi_callingpres: 0
SIP/10036-00a8AGI Tx  agi_callingani2: 0
SIP/10036-00a8AGI Tx  agi_callington: 0
SIP/10036-00a8AGI Tx  agi_callingtns: 0
SIP/10036-00a8AGI Tx  agi_dnid: 0012127773456
SIP/10036-00a8AGI Tx  agi_rdnis: unknown
SIP/10036-00a8AGI Tx  agi_context: privoip
SIP/10036-00a8AGI Tx  agi_extension: 0012127773456
SIP/10036-00a8AGI Tx  agi_priority: 3
SIP/10036-00a8AGI Tx  agi_enhanced: 0.0
SIP/10036-00a8AGI Tx  agi_accountcode: 10036
SIP/10036-00a8AGI Tx  agi_threadid: -1220478064
SIP/10036-00a8AGI Rx  VERBOSE 10036 1
SIP/10036-00a8AGI Tx  200 result=1
SIP/10036-00a8AGI Rx  VERBOSE 0012127773456 1
SIP/10036-00a8AGI Tx  200 result=1
SIP/10036-00a8AGI Rx  VERBOSE 10036 1
SIP/10036-00a8AGI Tx  200 result=1
SIP/10036-00a8AGI Rx  VERBOSE Dialling 1
SIP/10036-00a8AGI Tx  200 result=1
SIP/10036-00a8AGI Tx  200 result=1
SIP/10036-00a8AGI Rx  EXEC Dial SIP/202.89.78.21/12127773456
SIP/10036-00a8AGI Tx  200 result=-1
SIP/10036-00a8AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00a8AGI Tx  200 result=1 (ANSWER)
SIP/10036-00a8AGI Rx  VERBOSE Status 1
SIP/10036-00a8AGI Tx  200 result=1
 
Regards,
Kamlesh
 
 



Date: Fri, 2 Dec 2011 16:26:50 +0500
From: govoi...@gmail.com
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] DIALSTATUS Values

Can you also paste the Asterisk Console logs around the part where AGI is 
dialing and after the dialing part ! make sure AGi debug is enabled as well.



On Fri, Dec 2, 2011 at 4:24 PM, Kamlesh Kumar kamlesh_...@hotmail.com wrote:



Hello,
 
in /etc/extension.conf
 
[privoip]
exten = _00X.,n,AGI(isdcall.php)

Regards,
Kamlesh
 



Date: Fri, 2 Dec 2011 16:16:27 +0500
From: govoi...@gmail.com
To: asterisk-users@lists.digium.com
Subject: Re: [asterisk-users] DIALSTATUS Values



Hi, 
How are you calling this AGI in your dialplan !!? 


Regards,
Sammy.


On Fri, Dec 2, 2011 at 3:18 PM, Kamlesh Kumar kamlesh_...@hotmail.com wrote:



Hello,
 
I tried to search the answer of my problem but unable to get resolution so 
sending to you guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts 
using PHP. I'm unable to retrieve the DIALSTATUS value, during execution of AGI 
script, I get empty value.
 
Extracts from AGI Script:
 
#!/usr/bin/php -q
#!/bin/bash
?php
include_once (phpagi-2.14/phpagi.php);
$agi = new AGI();

some codes for dial out
 
   $dialstatus=$agi-get_variable(DIALSTATUS);
   $dd=$dialstatus[data];
   $agi-verbose(Status.$dd);
 
In AGI debug, I get: 
SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
SIP/10036-0096AGI Tx  agi_language: en
SIP/10036-0096AGI Tx  agi_type: SIP
SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
SIP/10036-0096AGI Tx  agi_callerid: 10036
SIP/10036-0096AGI Tx  agi_calleridname: 10036
SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
SIP/10036-0096AGI Tx  agi_rdnis: unknown
SIP/10036-0096AGI Tx  agi_context: privoip
SIP/10036-0096AGI Tx  agi_extension: 0012127773456
SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-0096AGI Tx  200 result=1 (ANSWER)
SIP/10036-0096AGI Rx  VERBOSE Status 1
SIP/10036-0096AGI Tx  200 result=1
 
Please help me in this.
 
Thanks,
Kamlesh
 
 



--
_
-- 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


-- _ -- 
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
--
_
-- 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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Tony Mountifield
In article snt142-w45a64e4743de653da591...@phx.gbl,
Kamlesh Kumar kamlesh_...@hotmail.com wrote:
 I tried to search the answer of my problem but unable to get resolution so 
 sending to you
 guys. I'm using asterisk 1.6.2.7 and writing the AGI scripts using PHP. I'm 
 unable to
 retrieve the DIALSTATUS value, during execution of AGI script, I get empty 
 value.
  
 Extracts from AGI Script:
  
 #!/usr/bin/php -q
 #!/bin/bash
 ?php
 include_once (phpagi-2.14/phpagi.php);
 $agi = new AGI();
 
 some codes for dial out
  
$dialstatus=$agi-get_variable(DIALSTATUS);

Shouldn't that be: $dialstatus=$agi-get_variable(DIALSTATUS);

Having DIALSTATUS as a bare word might work in some versions of php,
but is likely to produce a warning. Although in your case, it does
appear to have worked.

$dd=$dialstatus[data];
$agi-verbose(Status.$dd);
  
 In AGI debug, I get: 
 SIP/10036-0096AGI Tx  agi_channel: SIP/10036-0096
 SIP/10036-0096AGI Tx  agi_language: en
 SIP/10036-0096AGI Tx  agi_type: SIP
 SIP/10036-0096AGI Tx  agi_uniqueid: 1322848927.172
 SIP/10036-0096AGI Tx  agi_version: 1.6.2.7
 SIP/10036-0096AGI Tx  agi_callerid: 10036
 SIP/10036-0096AGI Tx  agi_calleridname: 10036
 SIP/10036-0096AGI Tx  agi_dnid: 0012127773456
 SIP/10036-0096AGI Tx  agi_rdnis: unknown
 SIP/10036-0096AGI Tx  agi_context: privoip
 SIP/10036-0096AGI Tx  agi_extension: 0012127773456
 SIP/10036-0096AGI Rx  GET VARIABLE DIALSTATUS
 SIP/10036-0096AGI Tx  200 result=1 (ANSWER)

This shows that AGI is indeed returning the value of DIALSTATUS,
which is ANSWER.

 SIP/10036-0096AGI Rx  VERBOSE Status 1

But you are not picking it up.

 SIP/10036-0096AGI Tx  200 result=1
  
 Please help me in this.

I'm not familiar with php-agi (I usualy write my AGI in C), but it
looks like $dialstatus[data] is not the correct way to retrieve
the returned value. Or else there is a bug in php-agi.

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

--
_
-- 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


Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Kamlesh Kumar

I believe the syntax is correct because,
 
If I use 
$dd=$dialstatus[code];
  $agi-verbose(Status.$dd);

it gives me: 
SIP/10036-00b2AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b2AGI Tx  200 result=1 (ANSWER)
SIP/10036-00b2AGI Rx  VERBOSE Status200 1
 
If I use
$dd=$dialstatus[result];
  $agi-verbose(Status.$dd);

it gives me:
 
SIP/10036-00b4AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b4AGI Tx  200 result=1 (CANCEL)
SIP/10036-00b4AGI Rx  VERBOSE Status1 1
 
but if I use
$dd=$dialstatus[data];
  $agi-verbose(Status.$dd);

SIP/10036-00b6AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b6AGI Tx  200 result=1 (CANCEL)
SIP/10036-00b6AGI Rx  VERBOSE Status 1

Regards,
Kamlesh
 
 
 

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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Kamlesh Kumar

In addition to my reply:
 
I used to fetch the value using print_r function but that also tells that there 
is no value in data section.
$dialstatus=$agi-get_variable(DIALSTATUS);
print_r($dialstatus);
 
SIP/10036-00b8AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b8AGI Tx  200 result=1 (CANCEL)
SIP/10036-00b8AGI Rx  Array
SIP/10036-00b8AGI Tx  510 Invalid or unknown command
[Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned 
error: Broken pipe
SIP/10036-00b8AGI Rx  (
SIP/10036-00b8AGI Tx  510 Invalid or unknown command
[Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned 
error: Broken pipe
SIP/10036-00b8AGI Rx  [code] = 200
SIP/10036-00b8AGI Tx  510 Invalid or unknown command
[Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned 
error: Broken pipe
SIP/10036-00b8AGI Rx  [result] = 1
SIP/10036-00b8AGI Tx  510 Invalid or unknown command
[Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() returned 
error: Broken pipe
SIP/10036-00b8AGI Rx  [data] =

Regards,
Kamlesh

 



From: kamlesh_...@hotmail.com
To: asterisk-users@lists.digium.com
Subject: RE: [asterisk-users] DIALSTATUS Values
Date: Fri, 2 Dec 2011 11:58:26 +





I believe the syntax is correct because,
 
If I use 
$dd=$dialstatus[code];
  $agi-verbose(Status.$dd);

it gives me: 
SIP/10036-00b2AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b2AGI Tx  200 result=1 (ANSWER)
SIP/10036-00b2AGI Rx  VERBOSE Status200 1
 
If I use
$dd=$dialstatus[result];
  $agi-verbose(Status.$dd);

it gives me:
 
SIP/10036-00b4AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b4AGI Tx  200 result=1 (CANCEL)
SIP/10036-00b4AGI Rx  VERBOSE Status1 1
 
but if I use
$dd=$dialstatus[data];
  $agi-verbose(Status.$dd);

SIP/10036-00b6AGI Rx  GET VARIABLE DIALSTATUS
SIP/10036-00b6AGI Tx  200 result=1 (CANCEL)
SIP/10036-00b6AGI Rx  VERBOSE Status 1

Regards,
Kamlesh
 
 
 

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

Re: [asterisk-users] DIALSTATUS Values

2011-12-02 Thread Tony Mountifield
In article snt142-w54267269808afd17bccd5891...@phx.gbl,
Kamlesh Kumar kamlesh_...@hotmail.com wrote:
 In addition to my reply:
  
 I used to fetch the value using print_r function but that also tells that 
 there is no value
 in data section.
 $dialstatus=$agi-get_variable(DIALSTATUS);
 print_r($dialstatus);
  
 SIP/10036-00b8AGI Rx  GET VARIABLE DIALSTATUS
 SIP/10036-00b8AGI Tx  200 result=1 (CANCEL)
 SIP/10036-00b8AGI Rx  Array
 SIP/10036-00b8AGI Tx  510 Invalid or unknown command
 [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
 returned error: Broken pipe
 SIP/10036-00b8AGI Rx  (
 SIP/10036-00b8AGI Tx  510 Invalid or unknown command
 [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
 returned error: Broken pipe
 SIP/10036-00b8AGI Rx  [code] = 200
 SIP/10036-00b8AGI Tx  510 Invalid or unknown command
 [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
 returned error: Broken pipe
 SIP/10036-00b8AGI Rx  [result] = 1
 SIP/10036-00b8AGI Tx  510 Invalid or unknown command
 [Dec  3 01:18:47] ERROR[24839]: utils.c:1128 ast_carefulwrite: write() 
 returned error: Broken pipe
 SIP/10036-00b8AGI Rx  [data] =

Well since the AGI return string does indeed contain the value, shown
above as (CANCEL), that suggests there is definitely a bug in php-agi.
It appears to be creating a ['data'] element, but not setting it.
You will have to study the source code and work out how to fix it.
I did a quick google for php agi get variable and found other reports
of it not working properly, but I didn't see anyone offer a solution.
It's only programming, so it shouldn't be hard to fix.

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

--
_
-- 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