Fax detection with codec G.726

I have set up fax detection on one of my inbound routes. To get it to work I had to allow the incoming call from my SIP provider to be ULAW / G.711.

Normally I force the trunk to use G.726 for inbound/outbound, but fax detection does not seem to work with this codec. I’m forcing G.726 on the trunk by using the following in the PEER/USER details:

disallow=all
allow=g726

If the incoming call shows up in ULAW, fax detection works. G.726, no detection.

Is this expected, or is there anything I can do to work around this?

No work around, fax T30 will never work on anything but g711

I dedicated a DID for faxing and sent all incoming calls on this line to the fax recipient. Line is still using G.726 and faxing is working.

So, I can receive faxes using G.726, however as stated above the fax detection does not work with G.726. I need to force all calls to the fax recipient extension to receive the fax.

Seems like a limitation of the fax detection routine not working with G.726.

g.726 is a “Lossy” CODEC it provides lower bandwidth consumption in exchange for an imperfect recreation of the voice signal on the distant end.

FAX is data, you simply can’t put a MODEM/FAX signal that uses every single hz of the bandwidth to encode information and expect it to work.

I seriously doubt that you are using g726 inbound successfully.

I’m watching the incoming call on the asterisk channels page, it shows the G.726 codec in use. I’m also forcing the G.726 codec on the trunk and disallowing all others.

As well, I’m using an online fax provider to send the fax, which reports when complete that it negotiates a fax rate of either 9600 or 12200 baud. When using G.711 it would always negotiate the highest 14400 baud.

From what I’m reading, G.726 should be able to carry fax.

“The G.726 codec was, however, specifically designed to be able to carry medium speed modems, such as the V.29 modem used for FAX.”

Source: http://www.soft-switch.org/foip.html

“The dynamic switch allows the speed of voice band modem transmitted by G.726 at 32 kbit/s to be boosted to 9600 bit/s. At 40 kbit/s, modem speeds up to 14400 bit/s are possible.”

Source: http://books.google.ca/books?id=gC0U-nDGvvsC&pg=PA263&lpg=PA263&dq=g726+modem&source=bl&ots=_iVSOHiLd5&sig=41AaoZyS38UBYmEQ6D6stGeqxIE&hl=en&sa=X&ei=OXBgU7KmPOqy2wWh1IG4AQ&ved=0CDUQ6AEwAg#v=snippet&q="the%20dynamic%20switch%20allows"&f=false

Yes, see my post above, G.726 should be able to carry fax/modem speeds. I was able to get it to work when forcing the incoming call to the fax extension.

My question really is about the Fax Detection not working when the call is using G.726.

Maybe in it’s day the support was added. If I recall g.726 used to be called “half rate” and was originally used in TDM pair gain technologies so some degree of data support was included in the original ITU specification.

How the Asterisk CODEC implementation supports it is entirely up to the implementer. My guess if you buried your nose in the FAX Detect application is it doesn’t even look at anything but full rate CODEC’s.

I took a look at the Asterisk source, it looks like the fax detection only proceeds on specific codecs.

Looks like the code is in res_fax.c

/* We can only process some formats*/ switch (f->subclass.format.id) { case AST_FORMAT_SLINEAR: case AST_FORMAT_ALAW: case AST_FORMAT_ULAW: break;

I’d like to try to pass G.726 as well, but recompiling asterisk source is a bit out of my league.

Guess that settles it!

Well actually it’s not that hard.

Certainly it is worth a try, just add another case statement.

Then configure, make menuselect and pick the modules you want, then make and make install. That’s all it takes to install asterisk from source.

Yea, there’s only a few places to add the CASE for G726.

The code is easy, I’ve just never done a compile from source in Linux. I’ll see about giving it a try this weekend.

The four commands I sent are really the totality of it. Let us know how it works out.