Сделал у себя также
Вообщем получилось сделать так:
в extensions_custom.conf прописал:
[ext-fax-new]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,StopPlayTones
exten => in_fax,2,GotoIf($["${FAX_RX}" = "system"]?3:analog_fax,1)
exten => in_fax,3,Macro(faxreceive)
exten => in_fax,4,Hangup
exten => analog_fax,1,GotoIf($["${FAX_RX}" = "disabled"]?4:2) ;if fax is disabled, just hang up
exten => analog_fax,2,Set(DIAL=${DB(DEVICE/${FAX_RX}/dial)});
exten => analog_fax,3,Dial(${DIAL},20,d)
exten => analog_fax,4,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME},caller)
exten => out_fax,2,Hangup
exten => h,1,system(/var/lib/asterisk/bin/fax-process.pl --to ${EMAILADDRFAX} --from ${FAX_RX_FROM} --subject "Fax from ${URIENCODE(${CALL
ERID(number)})} ${URIENCODE(${CALLERID(name)})}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${FA
XFILE});
exten => h,2,Hangup()
[fax-so]
exten => s,1,Set(EMAILADDRFAX=my@email)
exten => s,2,Goto(ext-fax-new,in_fax,1)
exten => h,1,Macro(hangupcall,)
Делее создаю в FreePBX -> Custom Destination
Custom Destination: fax-so,s,1
Description:fax-so
и в Ring Group
Ring-Group Number: 112233
Destination if no answer: fax-so
И теперь при звонке на 112233 сразу отвечает факс, и отсылает на нужный емаил.
Может это и криво но работает.
При попытке позвонить, просто короткие гудки.
Вот лог звонка:
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
-- Nobody picked up in 1000 ms
-- Executing [s@macro-dial:8] Set("SIP/340-b7b1bc20", "DIALSTATUS=NOANSWER") in new stack
-- Executing [s@macro-dial:9] GosubIf("SIP/340-b7b1bc20", "0?NOANSWER|1") in new stack
-- Executing [112233@from-internal:14] Set("SIP/340-b7b1bc20", "RingGroupMethod=") in new stack
-- Executing [112233@from-internal:15] GotoIf("SIP/340-b7b1bc20", "0?nodest") in new stack
-- Executing [112233@from-internal:16] Set("SIP/340-b7b1bc20", "__NODEST=") in new stack
-- Executing [112233@from-internal:17] DBdel("SIP/340-b7b1bc20", "BLKVM/112233/SIP/340-b7b1bc20") in new stack
-- DBdel: family=BLKVM, key=112233/SIP/340-b7b1bc20
-- Executing [112233@from-internal:18] Goto("SIP/340-b7b1bc20", "fax-so|s|1") in new stack
-- Goto (fax-so,s,1)
-- Executing [s@fax-so:1] Set("SIP/340-b7b1bc20", "EMAILADDRFAX=so-pbx@email") in new stack
-- Executing [s@fax-so:2] Set("SIP/340-b7b1bc20", "PATHPREFIXFAX=so") in new stack
-- Executing [s@fax-so:3] Goto("SIP/340-b7b1bc20", "ext-fax-new|in_fax|1") in new stack
-- Goto (ext-fax-new,in_fax,1)
-- Executing [in_fax@ext-fax-new:1] StopPlayTones("SIP/340-b7b1bc20", "") in new stack
-- Executing [in_fax@ext-fax-new:2] GotoIf("SIP/340-b7b1bc20", "0?3:analog_fax|1") in new stack
-- Goto (ext-fax-new,analog_fax,1)
-- Executing [analog_fax@ext-fax-new:1] GotoIf("SIP/340-b7b1bc20", "1?4:2") in new stack
-- Goto (ext-fax-new,analog_fax,4)
-- Executing [analog_fax@ext-fax-new:4] Hangup("SIP/340-b7b1bc20", "") in new stack
== Spawn extension (ext-fax-new, analog_fax, 4) exited non-zero on 'SIP/340-b7b1bc20'
-- Executing [h@ext-fax-new:1] System("SIP/340-b7b1bc20", "/var/lib/asterisk/bin/fax-process.pl --to so-pbx@email --from freepbx@regionspb.ru --subject "Fax from 340 Aleksandr%20Krylov" --attachment fax_340.pdf --type application/pdf --file ") in new stack
-- Executing [h@ext-fax-new:2] Hangup("SIP/340-b7b1bc20", "") in new stack
== Spawn extension (ext-fax-new, h, 2) exited non-zero on 'SIP/340-b7b1bc20'
== End MixMonitor Recording SIP/340-b7b1bc20
== Manager 'admin' logged off from 127.0.0.1
Подскажите пжлст, в чем может быть проблема.