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 [EMAIL PROTECTED]:1] Verbose("SIP/2000-081da3a0",
"Name=Fred number=2000") in new stack
Name=Fred number=2000
    -- Executing [EMAIL PROTECTED]: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 [EMAIL PROTECTED]: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.


_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to