diff --git a/modules/rtpproxy/doc/rtpproxy_admin.xml b/modules/rtpproxy/doc/rtpproxy_admin.xml index 2988e3c004e..bad15c4d256 100644 --- a/modules/rtpproxy/doc/rtpproxy_admin.xml +++ b/modules/rtpproxy/doc/rtpproxy_admin.xml @@ -216,17 +216,19 @@ ... # single rtproxy with specific weight -modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:12221=2") +modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:22222=2") + +# single rtpproxy with advertised address + weight +modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:22222|8.8.8.8=2") + # multiple rtproxies for LB modparam("rtpproxy", "rtpproxy_sock", - "udp:localhost:12221 udp:localhost:12222 tcp:remote1:33422 tcp6:remote2:32322") + "udp:localhost:22222 udp:localhost:22223 tcp:remote1:33422 tcp6:remote2:32322") + # multiple sets of multiple rtproxies -modparam("rtpproxy", "rtpproxy_sock", - "1 == udp:localhost:12221 udp:localhost:12222") -modparam("rtpproxy", "rtpproxy_sock", - "2 == udp:localhost:12225") -modparam("rtpproxy", "rtpproxy_sock", - "2 == udp:localhost:12225|8.8.8.8") +modparam("rtpproxy", "rtpproxy_sock", "1 == udp:localhost:22222 udp:localhost:22223") +modparam("rtpproxy", "rtpproxy_sock", "2 == udp:localhost:22223") +modparam("rtpproxy", "rtpproxy_sock", "2 == udp:localhost:22223|8.8.8.8") ... diff --git a/modules/rtpproxy/rtpproxy.c b/modules/rtpproxy/rtpproxy.c index fc999655d97..4c8ce3dbfd3 100644 --- a/modules/rtpproxy/rtpproxy.c +++ b/modules/rtpproxy/rtpproxy.c @@ -657,7 +657,7 @@ static int add_rtpproxy_socks(struct rtpp_set * rtpp_list, pnode->rn_umode = CM_UNIX; pnode->rn_disabled = 0; memcpy(pnode->rn_url.s, p1, p2 - p1); - pnode->rn_url.s[p2 - p1] = 0; + pnode->rn_url.s[p2 - p1] = '\0'; pnode->rn_url.len = p2-p1; if (p3) { pnode->adv_address = pnode->rn_url.s + pnode->rn_url.len + 1; @@ -665,8 +665,8 @@ static int add_rtpproxy_socks(struct rtpp_set * rtpp_list, pnode->adv_address[p4 - p3] = 0; } - LM_DBG("url is %s, len is %i, adv is [%s]\n", - pnode->rn_url.s, pnode->rn_url.len, pnode->adv_address); + LM_DBG("url: %s, len: %i, weight: %d, adv: [%s]\n", + pnode->rn_url.s, pnode->rn_url.len, weight, pnode->adv_address); /* Leave only address in rn_address */ pnode->rn_address = pnode->rn_url.s; if (strncasecmp(pnode->rn_address, "udp:", 4) == 0) {