Rtpengine occupies too many ports

44 views
Skip to first unread message

Bob Bob

unread,
Sep 21, 2026, 2:33:45 AM (6 days ago) Sep 21
to Sipwise rtpengine

Hi all, I'm encountering a tricky issue when using rtpengine to forward audio. Below is the problem description.

System version: Debian 13 amd64
rtpengine version: Version: 13.5.1.3+0~mr13.5.1.3, installed via Sipwise

rtpengine-ctl -ip 127.0.0.1:2224 list numsessions:

Current sessions own: 3

Current sessions foreign: 0

Current sessions total: 3
Current transcoded media: 0
Current sessions ipv4 only media: 0
Current sessions ipv6 only media: 0
Current sessions ip mixed media: 0

netstat -unlp | grep rtpengine | wc -l:

131262

Below are some key configurations; see the attachment for the complete configuration file.

table = 0

port-min = 20000

port-max = 39999


Why is the actual number of occupied ports so different from the number of active sessions?

Thank you.

rtpengine.conf

Bob Bob

unread,
Sep 21, 2026, 2:53:59 AM (6 days ago) Sep 21
to Sipwise rtpengine
timeout = 60
silent-timeout = 3600
tos = 184

Bob Bob

unread,
Sep 21, 2026, 2:54:46 AM (6 days ago) Sep 21
to Sipwise rtpengine
The current architecture has one Kamailio using two rtpengines. Only one rtpengine is experiencing the issue of excessive port usage. Therefore, I believe it is not caused by Kamailio not calling rtpengine_delete().

Moreover, the rtpengine that is reporting the fault is deployed on the same server as Kamailio and connects directly via localhost.

Bob Bob

unread,
Sep 21, 2026, 4:02:31 AM (5 days ago) Sep 21
to Sipwise rtpengine
should I upgrade rtpengine to 13.5.1.27-1 to solve this?

Richard Fuchs

unread,
Sep 21, 2026, 10:18:51 AM (5 days ago) Sep 21
to rtpe...@googlegroups.com
On 21/09/2026 04.02, Bob Bob wrote:
> should I upgrade rtpengine to 13.5.1.27-1 to solve this?

Upgrade to the newest version is always a good first step for
troubleshooting.

Although I have to admit, I find the number 131262 highly suspicious.
With a port range covering 20000 ports, you'd need at least 7 interfaces
to actually have that many ports open? What does `rtpengine-ctl list
interfaces` say?

Cheers

Bob Bob

unread,
Sep 21, 2026, 9:19:41 PM (5 days ago) Sep 21
to Sipwise rtpengine
Thanks for help.

Here is the result of `rtpengine-ctl list interfaces`

Interface 'PRIVATE' address '10.10.100.3' (IPv4)
 Port range: 20000 - 39999
 Ports used:   468 / 20000 (  2.3%)
 Packets/bytes/errors:
  Ingress:    901924642 / 154055232823 /          0
  Egress:     855338642 / 146572476452 /          8
 Packets lost/duplicates:          0 /          0
 MOS:    avg 4.3, packet loss avg   0%
 Jitter: avg 420 (measured -nan)
 RTT:    e2e 17072, dsct 10295

Interface 'PUBLIC' address '10.10.100.3' (IPv4)
 Port range: 20000 - 39999
 Ports used:   468 / 20000 (  2.3%)
 Packets/bytes/errors:
  Ingress:   1896271366 / 324210604025 /         14
  Egress:    1918801757 / 329000943631 /       4386
 Packets lost/duplicates:          0 /          0
 MOS:    avg 4.3, packet loss avg   0%
 Jitter: avg 217 (measured -nan)
 RTT:    e2e 23800, dsct 12905

So many ports are occupied, yet it doesn’t seem to affect audio transmission. It’s strange—what are these ports shown in the statistics?
Reply all
Reply to author
Forward
0 new messages