[asterisk-users] Detecting a fax

Administrator TOOTAI admin at tootai.net
Fri Jan 11 04:08:16 CST 2019


Le 11/01/2019 à 10:23, Neil Youngman a écrit :
> On 11/01/2019 09:19, Administrator TOOTAI wrote:
>> Le 11/01/2019 à 10:12, Neil Youngman a écrit :
>>> A while back, I posted about detecting when a call was picked up by 
>>> a fax machine. It was suggested that having a "fax" extension and 
>>> "faxdetect=yes" would cause it to jump to the "fax" extension. This 
>>> was not something I could get to work.
>>>
>>> I have now created a very simple example. In sip.conf I have 
>>> "faxdetect = yes". My example extension is:
>>>
>>> [test]
>>> ;
>>> ; Voice test extension
>>> ;
>>> exten => voicetest,1,NoOp()
>>>      same => n,LOG(Notice,${CHANNEL}: Extension voiceout starting)
>>>      same => n,LOG(Notice,${CHANNEL}: Starting Answer Machine Detection)
>>>      same => n,AMD()
>>>      same => n,LOG(Notice,${CHANNEL}: Answer Machine Detection 
>>> ${AMDSTATUS}/${AMDCAUSE})
>>>      same => n,Playback(/var/lib/asterisk/sounds/en/demo-congrats)
>>>      same => n,LOG(Notice,${CHANNEL}: Voice out extension complete)
>>>      same => n(hangup),Hangup()
>>>
>>>
>>> ;
>>> ; Fax detected extension
>>> ;
>>> exten => fax,1,NoOp()
>>>      same => n,LOG(Notice,${CHANNEL}: Extension fax starting)
>>>      same => n,LOG(Notice,${CHANNEL}: Fax Machine Detected)
>>>      same => n,Playback(/var/lib/asterisk/sounds/en/silence/2)
>>>      same => n,LOG(Notice,${CHANNEL}: Fax extension complete)
>>>      same => n(hangup),Hangup()
>>>
>>> and the logs show that calling a fax using the voiceout extension in 
>>> context test does not result in the fax extension being triggered.
>>>
>>> [Jan 11 08:55:10] NOTICE[18073][C-00000115] Ext. voicetest: 
>>> SIP/31.13.156.183:5060-000000f4: Extension voiceout starting
>>> [Jan 11 08:55:10] NOTICE[18073][C-00000115] Ext. voicetest: 
>>> SIP/31.13.156.183:5060-000000f4: Starting Answer Machine Detection
>>> [Jan 11 08:55:13] NOTICE[18073][C-00000115] Ext. voicetest: 
>>> SIP/31.13.156.183:5060-000000f4: Answer Machine Detection 
>>> MACHINE/LONGGREETING-1500-1500
>>> [Jan 11 08:55:44] NOTICE[18073][C-00000115] Ext. voicetest: 
>>> SIP/31.13.156.183:5060-000000f4: Voice out extension complete
>>>
>>> Just for completeness this is how the call is originated, with a 
>>> different phone number:
>>>
>>> Action: Originate
>>> ActionId: 1234567W001-125
>>> Context: test
>>> Exten: voicetest
>>> Priority: 1
>>> Channel: SIP/+441632660987 at 31.13.156.183:5060
>>> Timeout: 60000
>>> Async: True
>>>
>>> Can anyone offer any insight into why this isn't working?
>>>
>>> Neil Youngman
>>>
>>>
>>
>> You didn't ANSWER() the call
> 
> It's an outgoing call. I wouldn't expect to answer an outgoing call?

I don't understand your goal. You want to send or receive fax?

On our side, dialplan very simplified on incoming calls (receive fax):

. in CLI> fax show settings ; output FAX For Asterisk Settings: blabla
. Set(FAXOPT(faxdetect)=yes); or faxdetect=yes in sip.conf
. Answer()
; if a fax is detected, go to fax extension
. exten => fax,n,ReceiveFAX(${FAXPATHTOFILE}/${FAXFILE},fs)

and done.
-- 
Daniel



More information about the asterisk-users mailing list