ASterisk 外呼文件的创建**** <?php function cw_outgoing($Time,$Channel,$CallerID,$MAXRetry,$RetryTime,$WaitTime,$Context,$Extension,$Priority,$Set,$Application="",$Date="",$wait_before_callback) { if(date("s") >= (60-$wait_before_callback)) { $tmp=date("s")+$wait_before_callback-60; $minute=date("i")+1; } else { $tmp=date("s")+$wait_before_callback; $minute=date("i"); } if(is_null($Time)) { $Time=date("H").":".$minute.":".$tmp." ".date("m")."/".date("d")."/".date("Y"); } $mobilephone=substr($CallerID,0,11); $Filename=$mobilephone."-".date("Y-m-dH:i:s"); $file=fopen("/var/spool/asterisk/tmp/$Filename.call","a"); fwrite($file,"Channel:".$Channel); fwrite($file,"/n"); fwrite($file,"CallerID:".$CallerID); fwrite($file,"/n"); fwrite($file,"MaxRetries:".$MAXRetry); fwrite($file,"/n"); fwrite($file,"RetryTime:".$RetryTime); fwrite($file,"/n"); fwrite($file,"WaitTime:".$WaitTime); fwrite($file,"/n"); fwrite($file,"Context:".$Context); fwrite($file,"/n"); fwrite($file,"Extension:".$Extension); fwrite($file,"/n"); fwrite($file,"Priority:".$Priority); fwrite($file,"/n"); fwrite($file,"Set:".$Set); fwrite($file,"/n"); //$Application="playback"; fwrite($file,"Application:".$Application); fwrite($file,"/n"); //$Date="huangping"; fwrite($file,"Data:".$Date); fwrite($file,"/n"); fclose($file); exec("touch -d '$Time' /var/spool/asterisk/tmp/$Filename.call"); exec("mv //var//spool//asterisk//tmp//$Filename.call //var//spool//asterisk//outgoing//$Filename.call"); } ?>