[Is This Possible?] Codec Negotiation On Fax Detect DIDs

Hello everybody,

I have a question/issue that I am wondering if it is even possible to achieve.

We have G729 as our only codec to be used on the SIP trunk for all external calls. We also have a SIP trunk used for faxing that only allows ulaw for t.38 purposes (since it can only travel over ulaw).

We have several DIDs that point to extensions direct, but to first try fax detection. My theory/question is this: is it possible to have a DID to prefer to use ulaw for fax detection, but if a fax is not detected, to renegotiate as as g729? We are trying to find ways to ensure all calls to handsets with outside callers are g729 only.

I can confirm that if I do not specify our SIP fax trunk with

disallow=all
allow=ulaw

then calls will come through to the extension for that respective DID (with fax detection) as g729, simply because g729 is listed as the most preferred codec in Asterisk SIP settings. Obviously, when it begins to arrive as g729, faxes will never detect, so therefore fax calls will pass through to the telephone/followme.

Probably easiest to arrange by allowing g729 and g711 on the trunk but only g729 on your extensions, this should allow whatever your fax detection/reception method is (you don’t say) to do it’s work with g7811 and t38 as appropriate.