Can I ‘force’ A SIP Trunk To Initiate T.38 On Inbound Call?

Hi - I’ve been using spandsp for quite some time as a fax solution for Asterisk. Outbound calls are working fine; our upstream SIP/DID provider supports T.38 and I’m really happy with the outcome.

However, we’ve always had some problems with inbound T.38 - seemingly an issue with the path that each DID/incoming call takes within our providers network. Some ranges work fine, others… never.

Our provider has just moved to new infrastructure, and I’m taking this opportunity to move all inbound fax DID’s to a single Asterisk server and a dedicated SIP trunk. It’s 1-2ms away from the SIP provider, and yet so far all inbound faxes are being done as G.711 calls. I asked the provider why, and their answer was:

“Our network doesn’t proactively offer T.38. If your end is configured to initiate a T.38 session once the call is established we will support and use that, otherwise we’ll continue to use G.711.”

My question to the community is, therefore, how can I configure an asterisk trunk to always initiate T.38 once the call is established? The closest thing I can find in the docs is to set a FAXOPT(gateway=yes), but I’m not sure this is correct?

I did a Pcap on an inbound call, and all I saw was our side accepting the SDP offer of ulaw, nothing T.38-specific.

Any clues? Basic configs below:

Connected to Asterisk 13.19.0 currently running on hostname (pid = 1196)
ls01*CLI> fax show capabilities

Registered FAX Technology Modules:

Type : Spandsp
Description : Spandsp FAX Driver
Capabilities : SEND RECEIVE T.38 G.711 GATEWAY

If you are using ReceiveFax or SendFax I believe there are options present to force it to request T.38 negotiation.