вопрос вдогонку, можно ли как нибудь проверить имеется ли такой ${CONNECTEDLINE(num)} в ext-fax
Код: Выделить всё
exten => fax,1,Goto(ext-fax,${CONNECTEDLINE(num)},1)
и если не имеется, то направить звонок в app-fax,666
То есть, если факс для абонента не настроен, то отсылать на системный факс. Подскажите в какую сторону копать?
Код: Выделить всё
[ext-fax]
include => ext-fax-custom
exten => 301,1,Set(FAX_FOR=Name (301))
exten => 301,n,Noop(Receiving Fax for: ${FAX_FOR}, From: ${CALLERID(all)})
exten => 301,n,Set(FAX_RX_EMAIL=s@zakamye.ru)
exten => 301,n(receivefax),Goto(s,receivefax)
exten => 302,1,Set(FAX_FOR=Name (302))
exten => 302,n,Noop(Receiving Fax for: ${FAX_FOR}, From: ${CALLERID(all)})
exten => 302,n,Set(FAX_RX_EMAIL=a@zakamye.ru)
exten => 302,n(receivefax),Goto(s,receivefax)
exten => s,1,Macro(user-callerid,)
exten => s,n,Noop(Receiving Fax for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => s,n(receivefax),StopPlaytones
exten => s,n,ReceiveFAX(${ASTSPOOLDIR}/fax/${UNIQUEID}.tif,f)
exten => s,n,ExecIf($["${FAXSTATUS:0:6}"="FAILED" && "${FAXERROR}"!="INIT_ERROR"]?Set(FAXSTATUS="FAILED: error: ${FAXERROR} statusstr: ${FAXOPT(statusstr)}"))
exten => s,n,Hangup
exten => h,1,GotoIf($[${STAT(e,${ASTSPOOLDIR}/fax/${UNIQUEID}.tif)} = 0]?failed)
exten => h,n(process),GotoIf($[${LEN(${FAX_RX_EMAIL})} = 0]?noemail)
exten => h,n,System(${ASTVARLIBDIR}/bin/fax2mail.php --to "${FAX_RX_EMAIL}" --dest "${FROM_DID}" --callerid '${CALLERID(all)}' --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif --exten "${FAX_FOR}")
exten => h,n(end),Macro(hangupcall,)
exten => h,n(noemail),Noop(ERROR: No Email Address to send FAX: status: [${FAXSTATUS}], From: [${CALLERID(all)}])
exten => h,n,Macro(hangupcall,)
exten => h,process+101(failed),Noop(FAX ${FAXSTATUS} for: ${FAX_RX_EMAIL} , From: ${CALLERID(all)})
exten => h,n,Macro(hangupcall,)