Detecting A Fax

Home » Asterisk Users » Detecting A Fax
Asterisk Users 5 Comments

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@31.13.156.183:5060
Timeout: 60000
Async: True

Can anyone offer any insight into why this isn’t working?

Neil Youngman

Neil Youngman Developer Wirefast Limited

Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/
Please consider the environment. Does this email or attachment need to be printed?
This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.

Any views or opinions are solely those of the author and do not necessarily represent those of Wirefast Limited

Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England & Wales Company number: 03865860
Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ

Wirefast definitions of classification can be found here: www.wirefast.com/classifications

5 thoughts on - Detecting A Fax

  • Le 11/01/2019 à 10:12, Neil Youngman a écrit :

    You didn’t ANSWER() the call


    Daniel

  • It’s an outgoing call. I wouldn’t expect to answer an outgoing call?

    Neil

    Neil Youngman Developer Wirefast Limited

    Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/
    Please consider the environment. Does this email or attachment need to be printed?
    This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.

    Any views or opinions are solely those of the author and do not necessarily represent those of Wirefast Limited

    Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England & Wales Company number: 03865860
    Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ

    Wirefast definitions of classification can be found here: http://www.wirefast.com/classifications

  • I would guess from your explanation that the “outgoing” call somehow ends up in your Asterisk machine again, either at the voicetest or fax extension. You don’t answer it in either of the extensions. That’s what TOOTAI meant.

    If this is done in another extension, than this part of the Dialplan is missing in your post. So we can only guess what’s going on. Either post the full dialplan or add some log or cli output (with verbose set to at least 1) so we can have a chance of seeing what’s going on.

    With best regards

    Florian Floimair Innovation – Software-Development

    COMMEND INTERNATIONAL GMBH
    A-5020 Salzburg, Saalachstraße 51
    http://www.commend.com <http://www.commend.com/>

    Security and Communication by Commend

    FN 178618z | LG Salzburg

    Am 11.01.19, 10:23 schrieb “asterisk-users im Auftrag von Neil Youngman” :

    > 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@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?

    Neil

    Neil Youngman
    Developer
    Wirefast Limited

    Wirefast provides secure corporate messaging services.
    See our messaging solutions at http://www.wirefast.com/
    Please consider the environment.
    Does this email or attachment need to be printed?
    This message contains confidential information and is intended only
    for the individual named. If you are not the named addressee you
    should not disseminate, distribute or copy this email. Please
    notify the sender immediately by email if you have received this
    email by mistake and delete this email from your system.

    Any views or opinions are solely those of the author
    and do not necessarily represent those of Wirefast Limited

    Email transmission cannot be guaranteed to be secure or error-free
    as information could be intercepted, corrupted, lost, destroyed,
    arrive late or incomplete, or contain viruses. The sender therefore
    does not accept liability for any errors or omissions in the contents
    of this message which arise as a result of email transmission.
    Wirefast Limited is registered in England & Wales
    Company number: 03865860
    Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ

    Wirefast definitions of classification can be found here: http://www.wirefast.com/classifications

  • Le 11/01/2019 à 10:23, Neil Youngman a écrit :

    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

  • I’m attempting to deliver a voice message. If the message has been mistakenly sent to a fax I want to detect that it’s a fax and report that.

    Neil Youngman

    Neil Youngman Developer Wirefast Limited

    Wirefast provides secure corporate messaging services. See our messaging solutions at http://www.wirefast.com/
    Please consider the environment. Does this email or attachment need to be printed?
    This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system.

    Any views or opinions are solely those of the author and do not necessarily represent those of Wirefast Limited

    Email transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. Wirefast Limited is registered in England & Wales Company number: 03865860
    Registered Office: 7/10 Chandos Street, Cavendish Square, London, W1G 9DQ

    Wirefast definitions of classification can be found here: http://www.wirefast.com/classifications