Факс в астериск
Добавлено: 10 фев 2014, 16:30
Добрый день господа форумчане. Вот решил заняться наконец факсами на астере.
Делаю по мануалу
Собственно пока нахожусь на этапе попытки принять факс. Имеем:
Исходя из ИВР я хочу получить возможность получить факс при тональном донаборе по цифре 4.
Звоним - делаем переход на цифру 4 и пробую отправить факс. В ответ получаю:
Делаю по мануалу
Собственно пока нахожусь на этапе попытки принять факс. Имеем:
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Диалплан
[incoming]
include => incoming-fax
include => dongle-incoming
exten => 000XXXX,1,Goto(IVR,444,1)
exten => h,n,Hangup()
;=======================================================IVR меню====================================================================
[IVR] ; голосовое меню
include => intercom
exten => 444,1,Wait(1)
exten => 444,n,Answer()
exten => 444,n,Set(VOLUME(TX)=10)
exten => 444,n,Wait(1)
exten => 444,n,Set(home="/home/menu")
exten => 444,n,Wait(1)
exten => 444,n,Background(${home}/welcome)
exten => 444,n,WaitExten(1)
exten => 444,n,Background(${home}/menu)
exten => 444,n,WaitExten(4)
exten => 444,n,Goto(kommersant,1,1) ; Коммерческий отдел.
exten => 1,1,Goto(kommersant,1,1)
exten => 2,1,Goto(support,2,1)
exten => 4,1,Goto(incoming-fax,4,1)
exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(IVR,444,9)
exten => h,n,Hangup()
;=====================================================FAX========================================================================
[incoming-fax] ; Входящий Fax
exten => 4,1,WaitExten(10)
exten => fax,n,NoOp(-------------------Call from ${CALLERID(number)} to ${EXTEN}------------------)
exten => fax,n,Goto(fax-rx,receive,1)
[fax-rx] ; Читаем и отправляем Fax на email
exten => receive,1,NoOP(------------------- FAX from ${CALLERID(number)} ------------------)
exten => receive,n,Answer()
exten => receive,n,Set(FILENAME=fax-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(number)})
exten => receive,n,Set(FAXFILE=/var/spool/asterisk/fax/receive/${FILENAME}.tif)
exten => receive,n,Set(FAXOPT(headerinfo)=Received by ${CALLERID(number)} ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M)})
exten => receive,n,Set(FAXOPT(localstationid)=OFFICE)
exten => receive,n,Set(FAXOPT(maxrate)=14400)
exten => receive,n,Set(FAXOPT(minrate)=2400)
exten => receive,n,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => receive,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)})
exten => receive,n,NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)})
exten => receive,n,NoOp(FAXOPT(maxrate) : ${FAXOPT(maxrate)})
exten => receive,n,NoOp(FAXOPT(minrate) : ${FAXOPT(minrate)})
exten => receive,n,NoOp(**** RECEIVING FAX : ${FAXFILE} ****)
exten => receive,n,ReceiveFAX(${FAXFILE})
exten => receive,n,Hangup()
exten => h,1,NoOP(------------------- FAX from ${CALLERID(number)} ------------------)
exten => h,n,NoOP(------------------- STATUS ${FAXSTATUS} ${FAXERROR} ------------------)
exten => h,n,system(/var/lib/asterisk/agi-bin/fax-process.pl --to support@bitcom32.ru --from asterisk@asterisk.org --subject "Fax prineat s ${URIENCODE(${CALLERID(number)})} ${URIENCODE(${CALLERID(name)})}" --attachment ${FILENAME}.pdf --type application/pdf --file ${FAXFILE});
include => incoming-fax
include => dongle-incoming
exten => 000XXXX,1,Goto(IVR,444,1)
exten => h,n,Hangup()
;=======================================================IVR меню====================================================================
[IVR] ; голосовое меню
include => intercom
exten => 444,1,Wait(1)
exten => 444,n,Answer()
exten => 444,n,Set(VOLUME(TX)=10)
exten => 444,n,Wait(1)
exten => 444,n,Set(home="/home/menu")
exten => 444,n,Wait(1)
exten => 444,n,Background(${home}/welcome)
exten => 444,n,WaitExten(1)
exten => 444,n,Background(${home}/menu)
exten => 444,n,WaitExten(4)
exten => 444,n,Goto(kommersant,1,1) ; Коммерческий отдел.
exten => 1,1,Goto(kommersant,1,1)
exten => 2,1,Goto(support,2,1)
exten => 4,1,Goto(incoming-fax,4,1)
exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(IVR,444,9)
exten => h,n,Hangup()
;=====================================================FAX========================================================================
[incoming-fax] ; Входящий Fax
exten => 4,1,WaitExten(10)
exten => fax,n,NoOp(-------------------Call from ${CALLERID(number)} to ${EXTEN}------------------)
exten => fax,n,Goto(fax-rx,receive,1)
[fax-rx] ; Читаем и отправляем Fax на email
exten => receive,1,NoOP(------------------- FAX from ${CALLERID(number)} ------------------)
exten => receive,n,Answer()
exten => receive,n,Set(FILENAME=fax-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${CALLERID(number)})
exten => receive,n,Set(FAXFILE=/var/spool/asterisk/fax/receive/${FILENAME}.tif)
exten => receive,n,Set(FAXOPT(headerinfo)=Received by ${CALLERID(number)} ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M)})
exten => receive,n,Set(FAXOPT(localstationid)=OFFICE)
exten => receive,n,Set(FAXOPT(maxrate)=14400)
exten => receive,n,Set(FAXOPT(minrate)=2400)
exten => receive,n,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)})
exten => receive,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)})
exten => receive,n,NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)})
exten => receive,n,NoOp(FAXOPT(maxrate) : ${FAXOPT(maxrate)})
exten => receive,n,NoOp(FAXOPT(minrate) : ${FAXOPT(minrate)})
exten => receive,n,NoOp(**** RECEIVING FAX : ${FAXFILE} ****)
exten => receive,n,ReceiveFAX(${FAXFILE})
exten => receive,n,Hangup()
exten => h,1,NoOP(------------------- FAX from ${CALLERID(number)} ------------------)
exten => h,n,NoOP(------------------- STATUS ${FAXSTATUS} ${FAXERROR} ------------------)
exten => h,n,system(/var/lib/asterisk/agi-bin/fax-process.pl --to support@bitcom32.ru --from asterisk@asterisk.org --subject "Fax prineat s ${URIENCODE(${CALLERID(number)})} ${URIENCODE(${CALLERID(name)})}" --attachment ${FILENAME}.pdf --type application/pdf --file ${FAXFILE});
Звоним - делаем переход на цифру 4 и пробую отправить факс. В ответ получаю:
PRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER: Выхлоп
[Feb 10 16:24:41] WARNING[14534]: pbx.c:9977 pbx_builtin_waitexten: Timeout but no rule 't' or 'e' in context 'incoming-fax'