Hi, I have two asterisk install, one 16.2.1 on ubuntu 20 (packages) and one Freepbx 14 Ubuntu 18 with version 16.26.1. While the incoming fax works from trunk on the Freepbx install, I cannot seem to get it to work to fax between the two systems.
config 16.26:
[custom-fax-receive]
exten => s,1,NoOp(Receiving fax in custom context)
same => n,ReceiveFAX(/var/spool/asterisk/fax/incoming-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}.tiff)
same => n,Hangup()
[fax-out]
; leg ;2 lands here first – place your Dial() exactly as you had it
exten => _X.,1,NoOp(Send fax to ${EXTEN})
same => n,Dial(PJSIP/${EXTEN}@voice_to_yate,60,r) ; ring up to 60 s
same => n,Return() ; hand control back to leg ;1
; leg ;1 drops in here once the Dial() is answered
exten => s,1,Wait(2)
same => n,SendFAX(/var/spool/asterisk/fax/out/test-fax.tiff) ; ‘d’ keeps ECM on
same => n,NoOp(FAXSTATUS=${FAXSTATUS} FAXERROR=${FAXERROR})
same => n,Hangup()
config 16.2:
exten => 99,1,NoOp(Receiving fax on ${EXTEN})
same => n,Answer()
same => n,Set(FAXFILE=/var/spool/asterisk/fax/fax-${UNIQUEID}.tiff)
same => n,Wait(2)
same => n,Verbose(1,Step: Waiting before ReceiveFAX)
same => n,ReceiveFAX(${FAXFILE},fT60)
same => n,Verbose(1,Step: Receiving FAX now…)
same => n,Verbose(1,FAXSTATUS: ${FAXSTATUS})
same => n,Verbose(1,FAXERROR: ${FAXERROR})
same => n,System(tiff2pdf -o /var/spool/asterisk/fax/fax-${UNIQUEID}.pdf ${FAXFILE})
same => n,System(echo “Fax received on $(date)” | mail -s “New Fax on $(date ‘+%Y-%m-%d %H:%M’)” -A /var/spool/asterisk/fax/fax-${UNIQUEID}.pdf somuser@something.net)
same => n,Hangup()
[fax-out]
; leg ;2 lands here first ?~@~S place your Dial() exactly as you had it
exten => _X.,1,NoOp(Send fax to ${EXTEN})
same => n,Dial(SIP/${EXTEN}@trunk2fpbx,60,r) ; ring up to 60?~@?s
same => n,Return() ; hand control back to leg ;1
; leg ;1 drops in here once the Dial() is answered
exten => s,1,Wait(2)
same => n,SendFAX(/var/spool/asterisk/fax/test-fax.tiff) ; ‘d’ keeps ECM on
same => n,NoOp(FAXSTATUS=${FAXSTATUS} FAXERROR=${FAXERROR})
same => n,Hangup()
I tried using PJSIP and SIP trunks, but the result is the same: the fax fails with Unexpected DCN while waiting for DCS or DIS. Either side exhibits the same issue when the sending direction is reversed. Dialling each of the fax extensions with a voice line triggers the fax receiver’s screech, but calling each other, they do not pick up each other’s signals. I tested for one-way voice, but that is not the case, since voice channels work just fine.
I was triggering the fax with:
channel originate Local/99@fax-out/n extension s@fax-out
A real fax connected to the Asterisk installation was also unable to establish a connection, despite sending the fax using the channel command.
Any tips of what I am doing wrong in my configuration or how to test sending a fax?
Log:
== Spawn extension (fax-to-email, 99, 12) exited non-zero on ‘PJSIP/voice_to_yate-00000145’
== Setting global variable ‘SIPDOMAIN’ to ‘10.168.121.12’
– Executing [99@from-voice:1] Goto(“PJSIP/voice_to_yate-00000146”, “fax-to-email,99,1”) in new stack
– Goto (fax-to-email,99,1)
– Executing [99@fax-to-email:1] NoOp(“PJSIP/voice_to_yate-00000146”, “Receiving fax on 99”) in new stack
– Executing [99@fax-to-email:2] Answer(“PJSIP/voice_to_yate-00000146”, “”) in new stack
– Executing [99@fax-to-email:3] Set(“PJSIP/voice_to_yate-00000146”, “FAXFILE=/var/spool/asterisk/fax/fax-1752914311.518.tiff”) in new stack
– Executing [99@fax-to-email:4] Wait(“PJSIP/voice_to_yate-00000146”, “2”) in new stack
– Executing [99@fax-to-email:5] Verbose(“PJSIP/voice_to_yate-00000146”, “1,Step: Waiting before ReceiveFAX”) in new stack
Step: Waiting before ReceiveFAX
– Executing [99@fax-to-email:6] ReceiveFAX(“PJSIP/voice_to_yate-00000146”, “/var/spool/asterisk/fax/fax-1752914311.518.tiff,fT60”) in new stack
– Channel ‘PJSIP/voice_to_yate-00000146’ receiving FAX ‘/var/spool/asterisk/fax/fax-1752914311.518.tiff’
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 000.220811 ], stack sent 10 frames (200 ms) of silence.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 001.494877 ], channel sent 74 frames (1480 ms) of silence.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 001.994961 ], channel sent 25 frames (500 ms) of energy.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 002.820322 ], stack sent 130 frames (2600 ms) of energy.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 002.880179 ], stack sent 3 frames (60 ms) of silence.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 004.960169 ], stack sent 104 frames (2080 ms) of energy.
Channel ‘PJSIP/voice_to_yate-00000146’ fax session ‘73’, [ 005.134894 ], channel sent 156 frames (3120 ms) of silence.
– Executing [99@fax-to-email:7] Verbose(“PJSIP/voice_to_yate-00000146”, “1,Step: Receiving FAX now…”) in new stack
Step: Receiving FAX now…
– Executing [99@fax-to-email:8] Verbose(“PJSIP/voice_to_yate-00000146”, “1,FAXSTATUS: FAILED”) in new stack
FAXSTATUS: FAILED
– Executing [99@fax-to-email:9] Verbose(“PJSIP/voice_to_yate-00000146”, “1,FAXERROR: Unexpected DCN while waiting for DCS or DIS”) in new stack
FAXERROR: Unexpected DCN while waiting for DCS or DIS
– Executing [99@fax-to-email:10] System(“PJSIP/voice_to_yate-00000146”, “tiff2pdf -o /var/spool/asterisk/fax/fax-1752914311.518.pdf /var/spool/asterisk/fax/fax-1752914311.518.tiff”) in new stack