Bug #4561
closedsiproxd listening port redirect rule pulling wrong tag from <siproxdsettings> (config.xml)
100%
Description
I use siproxd a little differently than most. I set its listen port to 5070 and have all my SIP devices set to UDP on 5070. Reason is that I also have an inside Asterisk server that needs 5060 open (not intercepted). I have some outside PBX connections to attach to as well, and siproxd on 5070 handles these perfectly without NAT concerns. What I discovered was that even with siproxd's port set to 5070, port 5060 was still being intercepted. Examination of Line 83 in /usr/local/pkg/siproxd.inc exposed the problem:
$port = ($siproxd_conf['proxy_port'] ? $siproxd_conf['proxy_port'] : 5060);
It is pulling 'proxy_port' from <installedpackages><siproxdsettings><config> in config.xml, whereas the actual tag saved in this location is:
<port>5070</port>
As the $port line above defaults to 5060 if <proxy_port> is undefined, the redirect rule insert is always redirecting on 5060 regardless of what port siproxd is actually listening on. This condition has existed as far back as 2.0.x, but as few use siproxd as I do, I'm not surprised that this issue has not surfaced before now.