[SR-Users] rtpproxy bridge external(real ip)/internal

Artur Hovsepyan hvspa at yahoo.com
Fri Apr 3 22:48:31 CEST 2020


just to add rtpproxy and kamailio versions:
rtpproxy -vBasic version: 20040107
version: kamailio 5.1.10 (x86_64/linux)
OS=CentOS Linux release 7.7.1908 (Core) 
    On Friday, April 3, 2020, 04:41:40 PM EDT, Artur Hovsepyan <hvspa at yahoo.com> wrote:  
 
 Hey, 

This is my first post here, so I wanted a bit of help. Appreciating that in advance.
i have following setup:
carrier(asterisk with sip ip=rtp ip=real IP) <==> kamailio+rtpproxy(ext real ip, internal ip) <==> internal asterisk(sip ip != rtp ip, both internal ips).
rtprpoxy setup/usr/local/bin/rtpproxy -p /var/run/rtpproxy.pid -u rtpproxy -F -s udp:127.0.0.1 7722 -l kam_int_ip kam_ext_ip -m 10000 -M 20000 -L 30000 -d DBUG LOG
kamailio listens on both external and internal ipsdispatcher list:
0 towards carrier SOCKET: udp:external_ip2 towards internal asterisk SOCKET: udp:internal_ip
calls being routed with if(src_ip==carrier's real ip) sent to route "from_carrier" and if(src_ip==int_ast_sip_ip) sent to route "to_carrier" in the routes calls are dispatched with if(!ds_select_dst("0", "4")) and if(!ds_select_dst("2", "4"))

rtpproxy_manage is done in "NATMANAGE" route:
#checking if call is from carrier or to carrier:if(src_ip!=carrier_ext_ip) {        if(nat_uac_test("8")) {                rtpproxy_manage("coier");        } else {                rtpproxy_manage("cor");        }}else {        rtpproxy_manage("coeir");}
so, this setup works, when i setup private IP addresses(from same network) on both carrier side(10.0.1.1) and external interface of kamailio(10.0.1.2) (accordingly changing the dispatcher file, rtpproxy and the kamailio.cfg). as per below:
carrier(asterisk with sip ip=rtp ip=10.0.1.1) <==> kamailio+rtpproxy(ext ip=10.0.1.2, internal ip=10.0.2.1) <==> internal asterisk(sip ip != rtp ip, both internal ips).
rtprpoxy setup/usr/local/bin/rtpproxy -p /var/run/rtpproxy.pid -u rtpproxy -F -s udp:127.0.0.1 7722 -l 10.0.2.1 10.0.1.2 -m 10000 -M 20000 -L 30000 -d DBUG LOG
kamailio listens on both external and internal ipsdispatcher list:
0 towards carrier SOCKET: udp:10.0.1.22 towards internal asterisk SOCKET: udp:10.0.2.1
calls being routed with if(src_ip==10.0.1.1) sent to route "from_carrier" and if(src_ip==172.16.21.21) sent to route "to_carrier" in the routes calls are dispatched with if(!ds_select_dst("0", "4")) and if(!ds_select_dst("2", "4"))

rtpproxy_manage is done in "NATMANAGE" route:
#checking if call is from carrier or to carrier:if(src_ip!=10.0.1.1) {        if(nat_uac_test("8")) {                rtpproxy_manage("coier");        } else {                rtpproxy_manage("cor");        }}else {        rtpproxy_manage("coeir");}

once i replace the IP addresses of carrier and kamailio with real IPs, kamailio is starting to forward internal asterisk's sip and rtp IP addresses to carrier  and carrier's sip/rtp IPs in the SDP and breaking the SIP flow. that is  is not the case while private IPs are setup for both external and internal interfaces. in the later case it normally does the bridging and sends correct info in SDP messages.
can someone help me please to understand why/how it is working correctly for private IPs and "misbehaving" in case of real IPs.
thanks,Art  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200403/245d149f/attachment.html>


More information about the sr-users mailing list