<div>Yes. Jon is correct.</div>
<div> </div>
<div>$agi[str_replace("agi_","",$s[[0])] = trim($s[[1]);</div>
<div> </div>
<div>This line needs some work... Your brackets are mismatched.<br><br> </div>
<div><span class="gmail_quote">On 6/2/06, <b class="gmail_sendername">Jon Farmer</b> <<a href="mailto:viperdude_uk@yahoo.co.uk">viperdude_uk@yahoo.co.uk</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Yes you have a parse error in your PHP when I saved it locally and run it from the command line I got<br><br>
syntax error, unexpected '[', expecting ']' in test.php on line 33<br><br>Jon FarmerTelford, Shropshire, UK<br><br>----- Original Message ----<br>From: Matthew Warren <<a href="mailto:mwarren@ru-intouch.com">mwarren@ru-intouch.com
</a>><br>To: <a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a><br>Sent: Friday, 2 June, 2006 3:32:10 PM<br>Subject: [Asterisk-Users] PHP-AGI help<br><br>Can someone help me with this AGI script to send an email. It just isn't
<br>working. The file is being called in the dialplan and is saved as em.agi<br>but it isn't sending the email.<br>#!/usr/bin/php4 -q<br><?php<br>ob_implicit_flush(true);<br>set_time_limit(6);<br>$in = fopen("php://stdin","r");
<br>$stdlog = fopen("/var/log/asterisk/my_agi.log", "w");<br><br>// toggle debugging output (more verbose)<br>$debug = false;<br><br>// Do function definitions before we start the main loop<br>function read() {
<br> global $in, $debug, $stdlog;<br> $input = str_replace("\n", "", fgets($in, 4096));<br> if ($debug) fputs($stdlog, "read: $input\n");<br> return $input;<br>}<br><br>function errlog($line) {
<br> global $err;<br> echo "VERBOSE \"$line\"\n";<br>}<br><br>function write($line) {<br> global $debug, $stdlog;<br> if ($debug) fputs($stdlog, "write: $line\n");<br> echo $line."\n";
<br>}<br><br>// parse agi headers into array<br>while ($env=read()) {<br> $s = split(": ",$env);<br> $agi[str_replace("agi_","",$s[[0])] = trim($s[[1]);<br> if (($env == "") || ($env == "\n")) {
<br> break;<br> }<br>}<br><br><br> $sender = "<a href="mailto:prospect@talktomehomes.com">prospect@talktomehomes.com</a>";<br> $recipient = "<a href="mailto:mwarren@cwgo.com">mwarren@cwgo.com</a>";
<br> $subject = "call from someone";<br><br><br><br> $header = "From: " . $sender . "\r\n";<br> $header.= "Reply-to: " . $sender . "\r\n";<br><br><br> mail($recipient, $subject, $message, $header);
<br><br><br>fclose($in);<br>fclose($stdlog);<br><br>exit;<br>?><br><br>_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>
Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br><br><br><br><br>
_______________________________________________<br>--Bandwidth and Colocation provided by <a href="http://Easynews.com">Easynews.com</a> --<br><br>Asterisk-Users mailing list<br>To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>Origination that includes real support!<br>
<a href="http://www.VoIPStreet.com">http://www.VoIPStreet.com</a>