Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] [AGI 1.4] Why doesn't Asterisk complain?


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
vincent.delporte at bi...
Guest





PostPosted: Mon Jan 28, 2008 2:08 am    Post subject: [asterisk-users] [AGI 1.4] Why doesn't Asterisk complain? Reply with quote

Hello

I've read in the documentation that we should use the CLI
version of PHP when using it to write scripts called by AGI, because
the prepended HTML bits would confuse Asterisk when it got a reply
from the script through STDIN.

And still, the following works OK, although the CLI version available
in AstLinux prepends some HTML:

===================
pbx tmp # cat /tmp/test.php
#/tmp/php-cli -q
<?php
echo "SET CALLERID \"Derf <123>\"\n";
?>

pbx tmp # ./test.php
X-Powered-By: PHP/5.2.5
Content-type: text/html

pbx tmp # /tmp/php-cli -q test.php
SET CALLERID "Derf <123>"
======== /etc/asterisk/extensions.conf ====
[inside]
exten => 9999,1,Verbose(Name=${CALLERID(name)}
number=${CALLERID(num)})
exten => 9999,n,AGI(/tmp/test.php)
exten => 9999,n,Verbose(Name=${CALLERID(name)}
number=${CALLERID(num)})
======== Calling in ====
pbx*CLI>
-- Executing [9999 at inside:1] Verbose("SIP/2000-081da3a0",
"Name=Fred number=2000") in new stack
Name=Fred number=2000
-- Executing [9999 at inside:2] AGI("SIP/2000-081da3a0",
"/tmp/test.php") in new stack
-- Launched AGI Script /tmp/test.php
-- AGI Script /tmp/test.php completed, returning 0
-- Executing [9999 at inside:3] Verbose("SIP/2000-081da3a0",
"Name=Derf number=456") in new stack
Name=Derf number=456
== Auto fallthrough, channel 'SIP/2000-081da3a0' status is 'UNKNOWN'
pbx*CLI>
===================

=> How come Asterisk accepts the reply from the PHP script, even
though it's a mix of HTML and a valid AGI command ("SET CALLERID")?

Thank you.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services