T.38 using RTP outside of range

Good evening all. I’ve been ripping what little hair I have left out for the past few hours, ultimately coming across something that makes no sense to me and hope someone else has seen this behavior before.

So, I’ve got a PJSIP trunk to a FAX server. All the T38 stuff is enabled for it, but we were having issues with once the call was answered, it would drop after about 30 seconds.

Finally loading Wireshark, I noticed that, although the initial g711 call sets up fine, when the reinvite to T38 happens, there’s a distinct “no signal” in the flow. More importantly, I noticed the server has been instructed to contact the phone system on a port in the 4000 range (my default RTP ports are set 10,000 to 20,000. Naturally, the 4000-range isn’t in our open firewall rules. As soon as I put in the entire 4000 block, now magically FAXing works. However, In several tests, it’s jumping all over the place in the 4k range (4125 on one, 4748 on another).

I have no desire to keep the entire 4k range open, and actually I’m more concerned why PJSIP might be calling for this port range when reinviting to T38.

Any place anyone can think of that I can define that (I assumed PJSip got it’s RTP settings from the system-wide range (which I had thought was driver independent).

Open to any thoughts/suggestions on how to get the port range back where it belongs.

Thanks.

T.38 support does not use RTP, it uses a protocol called UDPTL which uses different ports. By default Asterisk uses a range of 4000 to 4999, configured in the udptl.conf file - but as I work on the Asterisk project, I do not know where that would be within FreePBX itself.

from the asterisk console:

freepbx*CLI> udptl show config
UDPTL Global options
--------------------
udptlstart:      4000
udptlend:        4999
udptlfecentries: 0
udptlfecspan:    0
use_even_ports:  No
udptlchecksums: Yes

add the following lines to /etc/asterisk/udptl_custom.conf:

udptlstart=5000
udptlend=5999

in the asterisk console:

freepbx*CLI> core reload

freepbx*CLI> udptl show config
UDPTL Global options
--------------------
udptlstart:      5000
udptlend:        5999
udptlfecentries: 0
udptlfecspan:    0
use_even_ports:  No
udptlchecksums: Yes
1 Like

Thank you both - I had no idea it would use a different port range - mentally I just turned the RTP port range into “UDP Port Range” and never really thought anything of it. Knowing this, it now makes sense anytime we’ve ever had an issue with audio disappearing for FAXes and couldn’t quite figure it out.

Is there any harm in making the port ranges for both the same? Are they smart enough to see that if by fluke they pick a port already in use, to try another one?

That being said, does it make sense to have the SIP Settings module match them up, or have fields for the UDP Start/End?

Thanks.

Doesn’t seem wise to me to have the ranges overlap. If you need to move the udptl then adjust both ranges to something like:

udptl - 10000-10999
rtp - 11000-20000

1 Like

That’s what I ended up doing. But yeah, that should be in the SIP settings module. :slight_smile:
Thanks.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.