I think I may have this close to working. But need help with the Dial function. I simply want to dial a number on my phone and when the fax answers, Asterisk should start sending the fax using SendFax / spandsp. I’ve tried every possible permutation of the dial command I’ve been able to figure out. If I build it one way it enters the faxsend routine and starts sending fax tones but then stops doing anything else. If I configure it another way it doesn’t even try to connect. Just dials then hangs up. Attaching my very basic extensions.conf
[general]
autofallthrough=no
[default]
exten => s,1,Zapateller(answer)
same => n,Hangup()
[inbound_calls]
exten => s,1,Dial(PJSIP/nnnnnnn@obi_110)
same => n,Hangup()
[outbound_calls]
exten => _**1NXXNXXXXXX,1,Set(pnum={EXTEN:2})
same => n,GotoIf([{REGEX("^18(00|33|44|55|66|77|88)" {pnum})}]?tollFreeCall)
same => n,Set(JITTERBUFFER(adaptive)=default)
same => n,Set(CALLERID(num)=nnnnnnnnnnn)
same => n,Dial(PJSIP/{pnum}@circlenet)
same => n,GoTo(GetOut)
same => n(tollFreeCall),Set(JITTERBUFFER(adaptive)=default)
same => n,Set(CALLERID(num)=nnnnnnnnnnn)
same => n,Dial(PJSIP/{pnum}@flowroute)
same => n(GetOut),Hangup()
exten => _**2NXXNXXXXXX,1,Set(CALLERID(num)=16301234567)
same => 2,Dial(PJSIP/1${EXTEN:3}@flowroute,30,G(3))
same => 3,GoTo(8)
same => 4,Verbose(Sending Fax)
same => 5,SendFax(/var/opt/fax/g4fax.tif,fs)
same => 6,Verbose({FAXOPT(statusstr)})
same => 7,Verbose(Disconnect code: [DIALSTATUS])
same => 8,Verbose(Do Nothing)