Asterisk / PJSIP Unexpectedly Opens Additional UDP Port

Home » Asterisk Users » Asterisk / PJSIP Unexpectedly Opens Additional UDP Port
Asterisk Users No Comments

Dear all,

I have drastically stripped down my Asterisk installation to about 70 modules since I wanted it to be as slim as possible.

Nevertheless, Asterisk still opens an unwanted port:

root@spock:/install/asterisk-13.6.0# netstat -apnv|grep asterisk
… udp 0 0 192.168.20.48:5060 0.0.0.0:* 26419/asterisk
udp 0 0 0.0.0.0:38827 0.0.0.0:* 26419/asterisk

Port 5060 is expected, of course, and the address where it is bound to is correct. But even after having a glance at the source, I can’t imagine why it opens another port on all addresses. I have done some debugging with the following results:

1) The unwanted port changes every time Asterisk is restarted. I can’t remember a situation where the port changed *while* Asterisk was running.

2) The opening of the port seems to be caused by res_pjsip. At least, if I don’t load res_pjsip when starting Asterisk, the port isn’t there (port 5060 then is gone as well, of course). I am not sure if we should conclude that res_pjsip actually causes the port being opened; it could well be another module which depends on res_pjsip and gets loaded if and only if res_pjsip gets loaded. Nevertheless, I’ve spent quite a few hours with trying to find that mysterious other module, but I didn’t find one.

Could please somebody who knows Asterisk’s architecture and the relationship between Asterisk and PJSIP look into that or give an explanation? I am quite sure that this affects every Asterisk / PJSIP installation …

Thank you very much,

Recursive