Вообщем пересобрал все с поддержкой spandsp? это оказалось проще, чем искать простые способы
Возникли другие вопросы:
Прием факса не обрабатывается до конца.
Код: Выделить всё
same => n,System(/usr/bin/tiff2pdf "/var/spool/asterisk/fax/${FAXOPT(headerinfo)}.tif" -o "/var/spool/asterisk/fax/${FAXOPT(headerinfo)}.pdf")
same => n,System(rm "/var/spool/asterisk/fax/${FAXOPT(headerinfo)}.tif")
same => n,System(echo "Subject: Получен факс от ${CALLERID(name)}" > msg)
same => n,System(echo "Content-Transfer-Encoding: base64" >> msg)
same => n,System(echo "Content-Description: ${FAXOPT(headerinfo)}.pdf" >> msg)
same => n,System(echo "Content-Disposition: attachment\; filename=${FAXOPT(headerinfo)}.pdf\n" >> msg)
same => n,System(base64 /var/spool/asterisk/fax/${FAXOPT(headerinfo)}.pdf >> msg)
same => n,System(ssmtp mail@mail.ru < msg)
same => n,System(rm msg)
same => n,System(rm "/var/spool/asterisk/fax/${FAXOPT(headerinfo)}.pdf")
Мыло приходит, но после отправки не стирает файлы.
В cli последняя строчка соответственно -- Executing [receive@fax-rx:24] System("SIP/0005-0000007b", "ssmtp
mail@mail.ru < msg") in new stack
Еще вопрос: В автоматическом режиме все проходит. т. е. ventafax набирает сам номер и отправляет, а астер автоматически поднимает трубку и принимает факс.
Но... Если я вручную поднимаю трубку и слышу слова венты "примите факс пожалуйста" и не успеваю нажать кнопку трасфер # до пикания факса, то астер ее вообще не обрабатывает и в cli пусто.
Если я вручную с другой стороны жду когда меня переведут на номер факса и вручную пытаюсь нажать старт венте, то ни как но получается, то ли момент поймать, то ли что, но не соединяется.
В cli в этот момент :
Код: Выделить всё
-- Executing [receive@fax-rx:1] NoOp("SIP/0005-0000007c", "------------------- FAX from 0005 ------------------") in new stack
-- Executing [receive@fax-rx:2] Answer("SIP/0005-0000007c", "") in new stack
-- Executing [receive@fax-rx:3] Set("SIP/0005-0000007c", "DT=--1413194085.254") in new stack
-- Executing [receive@fax-rx:4] Set("SIP/0005-0000007c", "FAXOPT(headerinfo)=Received_by_0005_2014-10-13_13-55") in new stack
-- Executing [receive@fax-rx:5] Set("SIP/0005-0000007c", "FAXOPT(localstationid)=Name") in new stack
-- Executing [receive@fax-rx:6] Set("SIP/0005-0000007c", "FAXOPT(maxrate)=14400") in new stack
-- Executing [receive@fax-rx:7] Set("SIP/0005-0000007c", "FAXOPT(minrate)=9600") in new stack
-- Executing [receive@fax-rx:8] NoOp("SIP/0005-0000007c", "FAXOPT(ecm) : yes") in new stack
-- Executing [receive@fax-rx:9] NoOp("SIP/0005-0000007c", "FAXOPT(headerinfo) : Received_by_0005_2014-10-13_13-55") in new stack
-- Executing [receive@fax-rx:10] NoOp("SIP/0005-0000007c", "FAXOPT(localstationid) : Name") in new stack
-- Executing [receive@fax-rx:11] NoOp("SIP/0005-0000007c", "FAXOPT(maxrate) : 14400") in new stack
-- Executing [receive@fax-rx:12] NoOp("SIP/0005-0000007c", "FAXOPT(minrate) : 9600") in new stack
-- Executing [receive@fax-rx:13] NoOp("SIP/0005-0000007c", "**** RECEIVING FAX : --1413194085.254 ****") in new stack
-- Executing [receive@fax-rx:14] Playback("SIP/0005-0000007c", "vm-press") in new stack
-- <SIP/0005-0000007c> Playing 'vm-press.gsm' (language 'ru')
-- Executing [receive@fax-rx:15] ReceiveFAX("SIP/0005-0000007c", "/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.tif") in new stack
-- Channel 'SIP/0005-0000007c' receiving FAX '/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.tif'
== Using UDPTL CoS mark 5
> 0x9c972c0 -- Probation passed - setting RTP source address to мой ип:5002
> 0x9c972c0 -- Probation passed - setting RTP source address to мой ип:5002
-- Executing [receive@fax-rx:16] System("SIP/0005-0000007c", "/usr/bin/tiff2pdf "/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.tif" -o "/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.pdf"") in new stack
-- Executing [receive@fax-rx:17] System("SIP/0005-0000007c", "rm "/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.tif"") in new stack
-- Executing [receive@fax-rx:18] NoOp("SIP/0005-0000007c", "**** SEND E-MAIL : --1413194085.254 ****") in new stack
-- Executing [receive@fax-rx:19] System("SIP/0005-0000007c", "echo "Subject: Получен факс от Home-fax" > msg") in new stack
-- Executing [receive@fax-rx:20] System("SIP/0005-0000007c", "echo "Content-Transfer-Encoding: base64" >> msg") in new stack
-- Executing [receive@fax-rx:21] System("SIP/0005-0000007c", "echo "Content-Description: Received_by_0005_2014-10-13_13-55.pdf" >> msg") in new stack
-- Executing [receive@fax-rx:22] System("SIP/0005-0000007c", "echo "Content-Disposition: attachment; filename=Received_by_0005_2014-10-13_13-55.pdf\n" >> msg") in new stack
-- Executing [receive@fax-rx:23] System("SIP/0005-0000007c", "base64 /var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.pdf >> msg") in new stack
-- Executing [receive@fax-rx:24] System("SIP/0005-0000007c", "ssmtp мой емайл < msg") in new stack
-- Executing [receive@fax-rx:25] System("SIP/0005-0000007c", "rm msg") in new stack
-- Executing [receive@fax-rx:26] System("SIP/0005-0000007c", "rm "/var/spool/asterisk/fax/Received_by_0005_2014-10-13_13-55.pdf"") in new stack
-- Executing [receive@fax-rx:27] NoOp("SIP/0005-0000007c", "**** Bye ****") in new stack
-- Executing [receive@fax-rx:28] Hangup("SIP/0005-0000007c", "") in new stack
И приходит письмо с пустым файлом.