<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi,<div><br></div><div>I tried to use Kamailio / RTPProxy in mhomed setup without any luck.</div><div>I had no problem to configure it with only 1 interface, without mhomed, everything worked perfectly.</div><div><br></div><div>The RTP streams where not established correctly even if I managed to have to proper IP in the SIP INVITE (C & O).</div><div><br></div><div>Versions:</div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">version: kamailio 4.1.4 (x86_64/linux) </div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">flags: STATS: Off, USE_TCP, USE_TLS, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, DBG_QM_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 4MB</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">id: unknown </div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">compiled on 04:23:19 Jun 13 2014 with gcc 4.7.2</div></div><div><br></div><div>RTPProxy -v:</div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Basic version: 20040107</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20050322: Support for multiple RTP streams and MOH</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20060704: Support for extra parameter in the V command</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20071116: Support for RTP re-packetization</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20071218: Support for forking (copying) RTP stream</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20080403: Support for RTP statistics querying</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20081102: Support for setting codecs in the update/lookup command</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">Extension 20081224: Support for session timeout notifications</div></div><div><br></div><div><br></div><div>Here is my RTPProxy config (/etc/default/rtpproxy) :</div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">CONTROL_SOCK=udp:127.0.0.1:7722</div></div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">EXTRA_OPTS=“-l <i>PU.BL.IC.IP</i>/<i>PRI.VA.TE.IP</i> -m 11000 -M 12000 -d DBUG:LOG_LOCAL3</div></div><div><br></div><div><br></div><div>Here are snippets of my kamailio.cfg:</div><div><br></div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">port=5060</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">mhomed=1</div><div><br></div><div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);"># RTPProxy control</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">route[NATMANAGE] {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">#!ifdef WITH_NAT</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        if (is_request()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                if(has_totag()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        if(check_route_param("nat=yes")) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                                setbflag(FLB_NATB);</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                return;</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196); min-height: 14px;"><br></div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        xlog("NATMANAGE M=$rm OU=$ou  RURI=$ru RD=$rd F=$fu T=$tu NH=$nh(d) IP=$si ID=$ci\n");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196); min-height: 14px;"><br></div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        if(dst_ip == PUBLIC_IP) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                if(is_ipv4($nh(d)) && is_in_subnet($nh(d), PRIVATE_NET)) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        xlog("NATMANAGE coei\n");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        rtpproxy_<span style="font-variant-ligatures: no-common-ligatures; color: #dfdbc4; background-color: #4c2f2d">manage</span>("coei", PRIVATE_IP);</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                } else {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        xlog("NATMANAGE coee\n");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        rtpproxy_<span style="font-variant-ligatures: no-common-ligatures; color: #dfdbc4; background-color: #4c2f2d">manage</span>("coee", PUBLIC_IP);</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        } else {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                if(is_ipv4($nh(d)) && is_in_subnet($nh(d), PRIVATE_NET)) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        xlog("NATMANAGE coii\n");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        rtpproxy_<span style="font-variant-ligatures: no-common-ligatures; color: #dfdbc4; background-color: #4c2f2d">manage</span>("coii", PRIVATE_IP);</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                } else {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        xlog("NATMANAGE coie\n");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        rtpproxy_<span style="font-variant-ligatures: no-common-ligatures; color: #dfdbc4; background-color: #4c2f2d">manage</span>("coie", PUBLIC_IP);</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);"><br></div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        if (is_request()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                if (!has_totag()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        if(t_is_branch_route()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                                add_rr_param(";nat=yes");</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        if (is_reply()) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                if(isbflagset(FLB_NATB)) {</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                        if(is_first_hop())</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                                set_contact_alias();</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">                }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        }</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">#!endif</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">        return;</div><div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">}</div></div><div><br></div><div><br></div><div>Calls were correctly going to the desired rtpproxy_manage options. </div><div>Now I’m not quite sure I’m using the correct ones.</div><div>I had to specify the PUBLIC_IP or PRIVATE_IP in the rtpproxy_manage calls in order to have the correct IP address in the C and O headers of the SIP INVITE. Without that, the public IP would be sent as C and O params to phones on the private subnet.</div><div>In fact not a single call direction would give correct RTP streams.</div><div><br></div><div>Any idea where I missed the turn?</div><div><br></div><div><br></div><div>Cheers</div>
<br></div></body></html>