====== Приложение 0000333 (Askozia) ====== Отправка факсимильного сообщения. get_variable($_varName); if(!$v['result'] == 0){ $agi->verbose($_varName.' ---> '.$v['data'], 10); return $v['data']; } else{ $agi->verbose($_varName.' not set', 10); return ""; } } $agi = new AGI(); $EXTEN = GetVarChannnel($agi, "EXTEN"); if($EXTEN == "h"){ // это особенность работы с Askozia, для избежания зацикливания // http://igorg.ru/2011/10/22/askozia-opyt-ispolzovaniya/ }else{ $chan = GetVarChannnel($agi, "chan"); $faxfile = GetVarChannnel($agi, "faxfile"); $faxcallerid = GetVarChannnel($agi, "faxcallerid"); $agi->exec("Playback", "press_start_to_receive_a_fax"); $agi->exec("Wait", "1"); $agi->exec("Playback", "vm-goodbye"); $disk = storage_service_is_active("faxarchive"); $ajamfaxfile= $disk['mountpoint']."/askoziapbx/tmp/$faxfile.tif"; $agi->exec("SendFAX", $ajamfaxfile); $FAXSTATUS = GetVarChannnel($agi, "FAXSTATUS"); if($FAXSTATUS == "SUCCESS"){ $agi->exec( "SET" , "CDR(userfield)=\"$faxfile.pdf\"" ); $agi->exec("UserEvent", "SendFaxStatusOk,Channel:$chan,CallerID:$faxcallerid"); }else{ $agi->exec("UserEvent", "SendFaxStatusFail,Channel:$chan,CallerID:$faxcallerid"); } $agi->exec( "SET" , 'CDR(InternalCalleridNum)="FAXout"' ); } $agi->Answer(); $agi->Hangup(); ?> [[handbook:miko_edition|Обратно к описанию...]] ===== Прочее ===== [[http://wiki.miko.ru/astpanel:ats:asterisk:faxsend|Пример приложения для прочих сборок Asterisk]]