Add 0 to number for fax machine?

Ok, I’ve seen lots of different solutions to parts of my problem but not something from end to end that makes logical sense and solves it (even after trying to put together the work from 2-3 different articles). We have Asterisk 1.4.20rc1 and FreePBX 2.6.0RC2.1.

I’m trying to get asterisk to either dial 0 as soon as a FXS port ( Digium TDM880EF) is activated by a fax machine attached to it or add the 0 to the number that the dialled after it sends it.

We don’t want people having to add a 0 to the number when they use the fax machine and the fax machine itself doesn’t seem to support adding this number for us.

From what I can tell there are two ways to go about this. PLAR or ‘Hot line’ the 0 digit before on the number is sent from the fax on the zap channel that it is on OR setting up the dial plan to added the 0 to the number that it tries to dial.

If someone could provide instructions on either method or even links to where the steps are already as I can’t find anything that is clear about how to solve the issue using either method.

Thanks heaps!!

Hi Psyhco52,

I had a similar problem also for a fax but I needed a 1 prefix. This is what I managed to do.

Firstly, it seems that an include and a gosub respond differently to GotoIf’s (someone may be able to clear this up for me), but if I put all my logic into the from-internal-additional-custom context, then any Goto or GotoIf with a target of the same context seems to confuse the system and the call gets hung up. By using the Gosub, this confusion seems to disappear.

Anyway, my solution is as follows (added to the end of extensions_custom.conf

[try-dial]
exten => _.,1,Noop(---- START SUB ----)
exten => _.,n,GotoIf($[“Z${AlreadyFixed}” = “ZYes”]?Skip
exten => _.,n,Set(AlreadyFixed=“Yes”)
exten => _.,n,GotoIf($[“Z${CALLERID(num)}” != “Z100”]?Skip)
exten => _.,n,Noop(-- Fixup Called Number --)
exten => _.,n,Goto(from-internal-additional,0${EXTEN},1)
exten => _.,n,Hangup
exten => _.,n,Return
exten => _.,n(Skip),Noop(-- All Done --)
exten => _.,n,Return

[from-internal-additional-custom]
exten => _.,1,Gosub(try-dial,${EXTEN},1)

You’ll need to change a variable to suit your situaltion.

Where you see the number 100 you’ll need to change this to the extension of your fax

It should prefix the number dialled with a 0. I have tested it on my setup and it seems to work, but I YMMV

Regard,
Andrew

I tried it thismorning on our live asterisk and there seems to be some problems still. I’ll keep looking and repost if I find a solution.