Asterisk 20 Getting fax detect to work

Hi, I done a POC in one of our server in Asterisk 20, to detect fax , Receive Fax and SendFax.
All is working fine, but later I want to put that in to an actual server done everything same as POC server, the fax detection part is not working , Receiving part is working fine.

Steps I took

  1. Install spandsp module
  2. module load res_fax.so
    module load res_fax_spandsp.so
  3. pjsip.conf

[general]
faxdetect=yes
4. And in extension.conf

[from-twilio]

exten => fax,1,NoOp(Detected fax hureeeeee)
       same => n,ReceiveFAX(/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => _+X.,1,Verbose(Call from ${CALLERID(num)} to ${EXTEN})
        same => n,Answer()
        same => n,Ringing()
        same => n,Wait(5)  ; Wait for 3 second before hanging up
        same => n,MusicOnHold(default)

So this is working configuration I had in my POC server, done the same thing in my DEV server it is not working. I spend many hours going through source code of asterisk also for this.
Any help is very much appreciated.

    -- Executing [+14143865483@from-twilio:1] Verbose("PJSIP/twilio-00000000", "Call from +12064832469 to +14143865483") in new stack
Call from +12064832469 to +14143865483
    -- Executing [+14143865483@from-twilio:2] Answer("PJSIP/twilio-00000000", "") in new stack
       > 0x7f79c0013d60 -- Strict RTP learning after remote address set to: 168.86.137.234:13936
    -- Executing [+14143865483@from-twilio:3] Ringing("PJSIP/twilio-00000000", "") in new stack
    -- Executing [+14143865483@from-twilio:4] Wait("PJSIP/twilio-00000000", "5") in new stack
       > 0x7f79c0013d60 -- Strict RTP switching to RTP target address 168.86.137.234:13936 as source
  == Redirecting 'PJSIP/twilio-00000000' to fax extension due to CNG detection
  == Spawn extension (from-twilio, fax, 1) exited non-zero on 'PJSIP/twilio-00000000'
    -- Executing [fax@from-twilio:1] NoOp("PJSIP/twilio-00000000", "Detected fax hureeeeee") in new stack
    -- Executing [fax@from-twilio:2] ReceiveFAX("PJSIP/twilio-00000000", "/var/spool/asterisk/fax/1732282331.0.tif") in new stack

this is the log I am getting upon detection of fax.
Thank you in advance.

You can’t set “faxdetect” in the general direction of pjsip.conf, there is no general section. It is “fax_detect” on the PJSIP endpoint.

The provided console output shows fax detection happening and the call going to ReceiveFAX.

Is the console output the working or non-working case?

It is the working case

You should show the non-working case, otherwise there is nothing for us to really look at.

Thanks a LOTTTT , I changed the fax_detect in context part then it is working fine.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.