Asterisk 17.8.1 not releasing RTP ports

Hi,

I’m running multiple asterisk containers on a host and after few days of running, we are experiencing an error “res_rtp_asterisk.c:3798 rtp_allocate_transport: Oh dear… we couldn’t allocate a port for RTP instance ‘0x7fa6c0384d20’”

asterisk -rx “core show channels count”

139 active channels
70 active calls
3062854 calls processed

ps -aux |grep /usr/sbin/asterisk

root 10743 0.0 0.4 28295384 1227784 ? S Mar02 0:00 /usr/sbin/asterisk
root 16052 55.1 0.5 32535688 1417112 ? Ssl 2022 93012:34 /usr/sbin/asterisk
root 22666 0.0 0.4 28283384 1217292 ? S Mar01 0:00 /usr/sbin/asterisk
root 24127 0.0 0.4 28329384 1261448 ? S Mar06 0:00 /usr/sbin/asterisk
root 26171 0.0 0.0 3216 828 pts/114 S+ 14:00 0:00 grep /usr/sbin/asterisk
root 35458 0.0 0.5 32204008 1362676 ? S Mar22 0:00 /usr/sbin/asterisk
root 38977 0.0 0.4 28775136 1268664 ? S Mar14 0:00 /usr/sbin/asterisk
root 39156 0.0 0.5 32566688 1352368 ? S 12:26 0:00 /usr/sbin/asterisk
root 47393 0.0 0.4 28270884 1214856 ? S Mar03 0:00 /usr/sbin/asterisk
root 61486 0.0 0.5 32205508 1348412 ? S Mar24 0:00 /usr/sbin/asterisk
root 68312 0.0 0.4 28764136 1267940 ? S Mar14 0:00 /usr/sbin/asterisk
root 75411 0.0 0.5 32569688 1338728 ? S Mar28 0:00 /usr/sbin/asterisk
root 76527 0.0 0.5 28790636 1320244 ? S Mar18 0:00 /usr/sbin/asterisk
root 86774 0.0 0.4 28770136 1276376 ? S Mar16 0:00 /usr/sbin/asterisk
root 97233 0.0 0.4 28782136 1286092 ? S Mar15 0:00 /usr/sbin/asterisk

netstat -anpe |grep /var/run/asterisk/asterisk.ctl

unix 2 [ ACC ] STREAM LISTENING 1371080297 10743/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 191664932 47393/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 2619729838 76527/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 1886816474 75411/asterisk /var/run/asterisk/asterisk.ctl
unix 3 STREAM CONNECTED 1736297413 10743/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 3810961375 39156/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 820620196 61486/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 409634437 97233/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 3817477930 22666/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 1977102082 24127/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 1689411053 10743/asterisk /var/run/asterisk/asterisk.ctl
unix 3 STREAM CONNECTED 2476500438 10743/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 246761502 35458/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 2346752357 86774/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 2569506974 38977/asterisk /var/run/asterisk/asterisk.ctl
unix 2 STREAM CONNECTED 2621454324 68312/asterisk /var/run/asterisk/asterisk.ctl

#netstat -tulpn |grep asterisk |wc -l
3242

I don’t think anyone here will invest time in a 2+ year old unsupported version of Asterisk. Noone has reported such an issue in current supported versions.

Hi jcolp,

Do you have any idea why it shows multiple asterisk execution.

ps -aux |grep /usr/sbin/asterisk

root 10743 0.0 0.4 28295384 1227784 ? S Mar02 0:00 /usr/sbin/asterisk

root 16052 55.1 0.5 32535688 1417112 ? Ssl 2022 93012:34 /usr/sbin/asterisk
root 22666 0.0 0.4 28283384 1217292 ? S Mar01 0:00 /usr/sbin/asterisk
root 24127 0.0 0.4 28329384 1261448 ? S Mar06 0:00 /usr/sbin/asterisk
root 26171 0.0 0.0 3216 828 pts/114 S+ 14:00 0:00 grep /usr/sbin/asterisk
root 35458 0.0 0.5 32204008 1362676 ? S Mar22 0:00 /usr/sbin/asterisk
root 38977 0.0 0.4 28775136 1268664 ? S Mar14 0:00 /usr/sbin/asterisk
root 39156 0.0 0.5 32566688 1352368 ? S 12:26 0:00 /usr/sbin/asterisk
root 47393 0.0 0.4 28270884 1214856 ? S Mar03 0:00 /usr/sbin/asterisk
root 61486 0.0 0.5 32205508 1348412 ? S Mar24 0:00 /usr/sbin/asterisk
root 68312 0.0 0.4 28764136 1267940 ? S Mar14 0:00 /usr/sbin/asterisk
root 75411 0.0 0.5 32569688 1338728 ? S Mar28 0:00 /usr/sbin/asterisk
root 76527 0.0 0.5 28790636 1320244 ? S Mar18 0:00 /usr/sbin/asterisk
root 86774 0.0 0.4 28770136 1276376 ? S Mar16 0:00 /usr/sbin/asterisk
root 97233 0.0 0.4 28782136 1286092 ? S Mar15 0:00 /usr/sbin/asterisk

Hi jcolp,

Do you have idea why it shows multiple asterisk execution below.

ps -aux |grep /usr/sbin/asterisk

root 10743 0.0 0.4 28295384 1227784 ? S Mar02 0:00 /usr/sbin/asterisk

root 16052 55.1 0.5 32535688 1417112 ? Ssl 2022 93012:34 /usr/sbin/asterisk
root 22666 0.0 0.4 28283384 1217292 ? S Mar01 0:00 /usr/sbin/asterisk
root 24127 0.0 0.4 28329384 1261448 ? S Mar06 0:00 /usr/sbin/asterisk
root 26171 0.0 0.0 3216 828 pts/114 S+ 14:00 0:00 grep /usr/sbin/asterisk
root 35458 0.0 0.5 32204008 1362676 ? S Mar22 0:00 /usr/sbin/asterisk
root 38977 0.0 0.4 28775136 1268664 ? S Mar14 0:00 /usr/sbin/asterisk
root 39156 0.0 0.5 32566688 1352368 ? S 12:26 0:00 /usr/sbin/asterisk
root 47393 0.0 0.4 28270884 1214856 ? S Mar03 0:00 /usr/sbin/asterisk
root 61486 0.0 0.5 32205508 1348412 ? S Mar24 0:00 /usr/sbin/asterisk
root 68312 0.0 0.4 28764136 1267940 ? S Mar14 0:00 /usr/sbin/asterisk
root 75411 0.0 0.5 32569688 1338728 ? S Mar28 0:00 /usr/sbin/asterisk
root 76527 0.0 0.5 28790636 1320244 ? S Mar18 0:00 /usr/sbin/asterisk
root 86774 0.0 0.4 28770136 1276376 ? S Mar16 0:00 /usr/sbin/asterisk
root 97233 0.0 0.4 28782136 1286092 ? S Mar15 0:00 /usr/sbin/asterisk

You stated “I’m running multiple asterisk containers on a host” therefore multiple Asterisk instances would be running. Unless you mean something differently.

It shows single process after restarting the asterisk service, but it keeps increasing day by day. I also found that it releases the rtp ports if i kill all the asterisk processes except the one asterisk running on.
in this case pid = 16052 is the main.

The fact remains that you are using an expired version of Asterisk and need to reproduce this on a current version.

I suggest you give rather more detail regarding what “I’m running multiple
asterisk containers on a host” from your first posting really means.

Otherwise we are only guessing about the setup you are running.

Antony.

I have four containers running with Asterisk 17 each. One of the containers shows multiple Asterisk processes, such as “/usr/sbin/asterisk,” with 15 processes. When I manually kill all of these processes, the RTP ports are released.

For example, if I kill all PIDs except for the one I highlighted, it frees up all of the RTP ports.
image

I’d want to know what process 16052 was.

This is the main process id since the Asterisk service started running. I just want to know from where the other pids came in and why those processes were not releasing rtp ports.

The main process ID of what?

Why is the process that is actually consuming CPU not a child of that process?

Also, my understanding is that using Asterisk under Docker is not a supported configuration, so you are at your own risk.

The main pid of an asterisk, as you can see in the screenshot.

Apologies. I missed that.

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