Detect then drop incoming fax calls

Hi,
For some reason we are receiving an influx of fax calls on a line that doesn’t accept faxes. It goes right to our general mailbox, typically on our 800 number, costing us money.

How can I detect and disable incoming fax calls?

I’m using fedora15 with asterisk-1.8.12.2-1 and dahdi-tools-2.4.1-1.

I’d appreciate any pointers to information on how to do this!
Thanks so much,
Alex

Is this analogue or DAHDI? If so, detecting faxes will require you to answer the call, and therefore incur some charges.

I haven’t used fax, but basically you would do the same as for auto-detecting and handling fax, but instead of calling a fax application in your fax extension, you’d invoke Hangup.

[quote=“david55”]Is this analogue or DAHDI? If so, detecting faxes will require you to answer the call, and therefore incur some charges.

I haven’t used fax, but basically you would do the same as for auto-detecting and handling fax, but instead of calling a fax application in your fax extension, you’d invoke Hangup.[/quote]

This is a cable modem connected to a Tiger3XX 4-port card.

Does this mean it’s not possible to auto-detect incoming fax calls?

Thanks,
Alex

No. For SIP, if the upstream system has detected fax, that fact may be in the initial SIP INVITE, so it may not require Asterisk to answer, although, if the upstream system is still within your local environment, the chargeable call may still have been answered by that.

If the upstream equipment can’t detect fax, it may use a codec that distorts the fax calling tone so much that it is no longer recognizable. More generally, I’m not sure whether or not Asterisk can auto-detect fax over SIP when the upstream system doesn’t use T.38.

[quote=“david55”]No. For SIP, if the upstream system has detected fax, that fact may be in the initial SIP INVITE, so it may not require Asterisk to answer, although, if the upstream system is still within your local environment, the chargeable call may still have been answered by that.

If the upstream equipment can’t detect fax, it may use a codec that distorts the fax calling tone so much that it is no longer recognizable. More generally, I’m not sure whether or not Asterisk can auto-detect fax over SIP when the upstream system doesn’t use T.38.[/quote]

Unfortunately, I don’t really understand what you are saying. I don’t really have any control over the incoming stream - it’s just a cable modem connected to my SIP card.

Do you know what this means in practical terms for me using asterisk? How can I determine if the info to detect this is in the initial SIP invite?

Thanks,
Alex

Run a a SIP trace on the call (sip set debug on).

Okay, I’ve set up (I think) a SIP trace and sent a fax via our online fax service. It didn’t result in a voicemail, however. Maybe the fax service was intelligent enough to not continuing trying after a reasonable period and before our general voicemail mailbox took over?

Does this give us the information we need to determine what’s happening?

<--- SIP read from UDP:192.168.1.23:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.2:5060;branch=z9hG4bK744c3a09;rport
From: "asterisk" <sip:asterisk@192.168.1.2>;tag=as4cb91b7d
To: <sip:7000@192.168.1.23>;tag=EE64947F-2704901C
CSeq: 102 OPTIONS
Call-ID: 7ea402ee3d52af8361cdcf0633b92ff4@192.168.1.2:5060
Contact: <sip:7000@192.168.1.23>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_500-UA/1.6.2.0041
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '7ea402ee3d52af8361cdcf0633b92ff4@192.168.1.2:5060' Method: OPTIONS
    -- Starting simple switch on 'DAHDI/1-1'
    -- Executing [s@incoming:1] NoOp("DAHDI/1-1", "CALLERID = SNDG SNDG, CA - 6193301897") in new stack
    -- Executing [s@incoming:2] Goto("DAHDI/1-1", "incoming,_1NXXNXXXXXX,1") in new stack
    -- Goto (incoming,_1NXXNXXXXXX,1)
    -- Executing [_1NXXNXXXXXX@incoming:1] Answer("DAHDI/1-1", "") in new stack
[Nov 18 18:18:01] WARNING[16536]: chan_dahdi.c:4925 dahdi_train_ec: Unable to request echo training on channel 1: Invalid argument
    -- Executing [_1NXXNXXXXXX@incoming:2] Ringing("DAHDI/1-1", "") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:3] Wait("DAHDI/1-1", "3") in new stack
    -- Executing [_1NXXNXXXXXX@incoming:4] Set("DAHDI/1-1", "TIMEOUT(digit)=2") in new stack
    -- Digit timeout set to 2.000
    -- Executing [_1NXXNXXXXXX@incoming:5] BackGround("DAHDI/1-1", "local-mainmenu-night") in new stack
    -- <DAHDI/1-1> Playing 'local-mainmenu-night.slin' (language 'en')
  == Spawn extension (incoming, _1NXXNXXXXXX, 5) exited non-zero on 'DAHDI/1-1'
    -- Executing [h@incoming:1] Hangup("DAHDI/1-1", "") in new stack
  == Spawn extension (incoming, h, 1) exited non-zero on 'DAHDI/1-1'
    -- Hanging up on 'DAHDI/1-1'
    -- Hungup 'DAHDI/1-1'
Reliably Transmitting (NAT) to 192.168.1.20:5060:
OPTIONS sip:7003@192.168.1.20 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.2:5060;branch=z9hG4bK34799d3e;rport
Max-Forwards: 70
From: "asterisk" <sip:asterisk@192.168.1.2>;tag=as698bb96f
To: <sip:7003@192.168.1.20>
Contact: <sip:asterisk@192.168.1.2:5060>
Call-ID: 0dd8db6162fec93224cd0ca319f457b5@192.168.1.2:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.12.2
Date: Mon, 18 Nov 2013 23:18:30 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0

No.

There is no call in that trace. Also you have given the answer before the question (i.e. not from the same exchange).

[quote=“david55”]No.

There is no call in that trace. Also you have given the answer before the question (i.e. not from the same exchange).[/quote]

The log is the result of a call received by prompting our Internet fax service to send a fax to our main number. Is it possible asterisk just dropped it because of the “Unable to request echo training on channel 1” message?

I don’t understand what you mean about the answer before the question?

I’m obviously confused. Thanks so much for your patience explaining this to me.
Thanks,
Alex

Your incoming call isn’t SIP.