<div dir="ltr">thanks a lot for your help and support <br><br>
<div class="gmail_quote">2011/5/20 A J Stiles <span dir="ltr"><<a href="mailto:asterisk_list@earthshod.co.uk">asterisk_list@earthshod.co.uk</a>></span><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im">On Friday 20 May 2011, salaheddine elharit wrote:<br>> Ok thank you so much for all advice<br><br></div>This might help you a bit, too:<br><br><?php<br>$spool = "/var/spool/asterisk/outgoing/"; # outgoing callfile folder<br>
<br>$filename = "asterisk-" . date("U") . "-" . $_SERVER["REMOTE_PORT"] . ".call";<br># this should end up being fairly unique. (if logging to a database with an<br># auto increment field, you can also use mysql_insert_id() as a unique<br>
# reference)<br><br>$src = ... ; # source extension<br># you can determine this based on $_SERVER["REMOTE_ADDR"], which is the<br># IP address of the requesting client, by looking up in an array or a database<br>
$ctxt = ... ; # context<br>$dest = ... ; # destination number<br># you probably want to get this from $_REQUEST<br><br>$callfile = "Channel: SIP/$src\nContext: $ctxt\nExtension: $dest\nPriority:<br>1\nCallerId: $src\n"; # line break added by email, not used in real life!<br>
if ($fh = fopen("/tmp/$filename", "w")) {<br> fwrite($fh, $callfile);<br> fclose($fh);<br> system("mv /tmp/$filename $spool");<br>}<br>else {<br> die("Call file creation failed");<br>
};<br>?><br><font color="#888888"><br>--<br></font>
<div>
<div></div>
<div class="h5">AJS<br><br>Answers come *after* questions.<br><br>--<br>_____________________________________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com/" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br> <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</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" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></div></div></blockquote></div><br></div>