<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px"><div id="yiv4480501099"><div id="yui_3_16_0_1_1414454539977_39523"><div id="yui_3_16_0_1_1414454539977_39522" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"><div id="yiv4480501099yui_3_16_0_1_1414454539977_36190">I narrowed down the problem to a comparison made in this function:</div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36500"><br clear="none"></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36491">send_rtpp_command(struct rtpp_node *node, struct iovec *v, int vcnt)  line 1618<br class="yiv4480501099" style="" clear="none"></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36501"><br clear="none"></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36502">inside the rtpproxy.c file (kamailio-4.2/kamailio/modules/rtpproxy/rtpproxy.c, lines 1693, 1694 )</div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36078"><br clear="none"><span></span></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36341"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342">if (len >= (v[0].iov_len - 1) <br clear="none"></span></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36655"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342">    && memcmp(buf, v[0].iov_base, (v[0].iov_len - 1)) == 0)</span></div><div id="yiv4480501099yui_3_16_0_1_1414454539977_36656"><br clear="none"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342"></span></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_36657"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342">What I see is this: kamailio starts up and sends 4 requests to rtpproxy to verify these versions:</span></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_37014"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342"><br clear="none"></span></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_36828"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342">/* Supported version of the RTP proxy command protocol */<br class="yiv4480501099" style="" clear="none">#define SUP_CPROTOVER   20040107<br class="yiv4480501099" style="" clear="none">/* Required additional version of the RTP proxy command protocol */<br class="yiv4480501099" style="" clear="none">#define REQ_CPROTOVER   "20050322"<br class="yiv4480501099" style="" clear="none">/* Additional version necessary for re-packetization support */<br class="yiv4480501099" style="" clear="none">#define REP_CPROTOVER   "20071116"<br class="yiv4480501099" style="" clear="none">#define PTL_CPROTOVER   "20081102"<br clear="none"></span></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_36658"><br clear="none"><span id="yiv4480501099yui_3_16_0_1_1414454539977_36342"></span></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_37012"><div id="yui_3_16_0_1_1414454539977_39566"><span class="yiv4480501099" id="yiv4480501099yui_3_16_0_1_1414454539977_36342" style="">In all those requests the function "</span>send_rtpp_command" is used. The proxy sends/recv inside a for loop (at max rtpproxy_retr tries) and when the proxy receives something is when it does the comparison:</div><div style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36341"><div id="yui_3_16_0_1_1414454539977_40019"><span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342"><br></span></div><div id="yui_3_16_0_1_1414454539977_40026"><span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342">if (len >= (v[0].iov_len - 1) <br style="" class="" clear="none"></span></div></div><div style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36655"><div id="yui_3_16_0_1_1414454539977_40027"><span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342">    && memcmp(buf, v[0].iov_base, (v[0].iov_len - 1)) == 0)</span></div><div id="yui_3_16_0_1_1414454539977_40028"><span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342"><br></span></div></div><div style="" class="" dir="ltr" id="yui_3_16_0_1_1414454539977_39563">len has the number of bytes received and the v[0].iov_base has the pid_v when checking the  <span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342">SUP_CPROTOVER.</span></div><div id="yui_3_16_0_1_1414454539977_40033" style="" class="" dir="ltr"><span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342">rtpproxy receives "13582_0 V" and replies </span>with 20040107#012</div><div style="" class="" dir="ltr" id="yui_3_16_0_1_1414454539977_39563"> </div></div><div dir="ltr" id="yiv4480501099yui_3_16_0_1_1414454539977_37246">ex:<br style="" class="">Oct 29 13:37:31 ip-10-0-2-68 rtpproxy[14268]: DBUG:get_command: received command "13582_0 V"<br style="" class="">Oct 29 13:37:31 ip-10-0-2-68 rtpproxy[14268]: DBUG:rtpc_doreply: sending reply "20040107#012"<br style="" class=""><div id="yui_3_16_0_1_1414454539977_40182"><br></div><div id="yui_3_16_0_1_1414454539977_40345" dir="ltr">and it is comparing 2 diff things so the comparison fails and the logic goes to the "badproxy" label where the test is flag as failed and hence the rtpproxy is marked as unavailable and all the other version checks are stopped<br></div><div id="yui_3_16_0_1_1414454539977_40346"><br></div><div dir="ltr" id="yui_3_16_0_1_1414454539977_40183">when checking for <span style="" class="" id="yiv4480501099yui_3_16_0_1_1414454539977_36342">REQ_CPROTOVER it sends </span>13582_1 VF 20050322 and receives "1#012", the comparison should fail for the same reason<br></div><div id="yui_3_16_0_1_1414454539977_40186" dir="ltr"><br style="" class="">Oct 29 13:37:31 ip-10-0-2-68 rtpproxy[14268]: DBUG:get_command: received command "13582_1 VF 20050322"<br style="" class="">Oct 29 13:37:31 ip-10-0-2-68 rtpproxy[14268]: DBUG:rtpc_doreply: sending reply "1#012"<br style="" class=""><br style="" class="">etc etc.</div><div id="yui_3_16_0_1_1414454539977_40349" dir="ltr"><br></div><div dir="ltr">I commented out all the sections inside the rtpp_test function that go to the "error" label and also inside rtpp_checkcap I always return 1. Now at the end when running ./kamctl fifo nh_show_rtpp it looks enabled:<br></div><div id="yui_3_16_0_1_1414454539977_40752" dir="ltr"><br></div><div id="yui_3_16_0_1_1414454539977_41160" dir="ltr">[root@ip-10-0-2-68 sbin]# ./kamctl fifo nh_show_rtpp<br style="" class="">which: no greadlink in (/sbin:/bin:/usr/sbin:/usr/bin:/)<br style="" class="">which: no gdb in (/sbin:/bin:/usr/sbin:/usr/bin:/)<br style="" class="">udp:127.0.0.1:7722::  set=0<br style="" class="">        index:: 0<br style="" class="">        disabled:: 0<br style="" class="">        weight:: 1<br style="" class="">        recheck_ticks:: 95595268<br style="" class="">[root@ip-10-0-2-68 sbin]#<br style="" class=""><br></div><div style="" class="" id="yui_3_16_0_1_1414454539977_40186" dir="ltr"> but I dont know how safe this is. I dont know if when I start using it 
(sending other commands to modify SDP etc) it will still work</div><div id="yui_3_16_0_1_1414454539977_41164" style="" class="" dir="ltr"><br></div><div id="yui_3_16_0_1_1414454539977_41165" style="" class="" dir="ltr">Can somebody tell me which version of both apps (kamailio and rtpproxy) are fully compatible?<br>txs a lot</div><div id="yui_3_16_0_1_1414454539977_41166" style="" class="" dir="ltr">jp2014<br></div><div style="" class="" id="yui_3_16_0_1_1414454539977_40186" dir="ltr"><br style="" class=""></div></div> <div id="yui_3_16_0_1_1414454539977_39562" class="yiv4480501099qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv4480501099yqt2617357596" id="yiv4480501099yqt25101"><div class="yiv4480501099yahoo_quoted" style="display: block;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:13px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"> <font face="Arial" size="2"> On Monday, October 27, 2014 8:22 PM, Juan Perez <juan_perez_2014@yahoo.com> wrote:<br clear="none"> </font> </div>  <br clear="none"><br clear="none"> <div class="yiv4480501099y_msg_container"><div id="yiv4480501099"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;">I installed Kamailio 4.2 and the latest rtpproxy. When starting Kamailio I see these lines:<br style="" clear="none"><br class="yiv4480501099" style="" clear="none"><div class="yiv4480501099" id="yiv4480501099" style=""><div class="yiv4480501099" style=""><div class="yiv4480501099" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div class="yiv4480501099" id="yiv4480501099yui_3_16_0_1_1414453840694_5109" style=""><font size="2">Oct 27 21:54:26 ip-10-0-2-68 kamailio: DEBUG: <core> [sr_module.c:590]: load_module(): load_module: trying to load </usr/local<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:26 ip-10-0-2-68 kamailio: DEBUG: <core> [sr_module.c:357]: register_module(): register PV from: rtpproxy<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:26 ip-10-0-2-68 kamailio: DEBUG: <core> [cfg.lex:1724]: pp_define(): defining id: MOD_rtpproxy<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:32 ip-10-0-2-68 ./kamailio[3887]: ERROR: rtpproxy [rtpproxy.c:1707]: send_rtpp_command(): timeout waiting reply f<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:32 ip-10-0-2-68 ./kamailio[3887]: ERROR: rtpproxy [rtpproxy.c:1716]: send_rtpp_command(): proxy <udp:10.0.2.68:77<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:32 ip-10-0-2-68 ./kamailio[3887]: WARNING: rtpproxy [rtpproxy.c:1573]: rtpp_test(): can't get version of the RTP<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:32 ip-10-0-2-68 ./kamailio[3887]: WARNING: rtpproxy [rtpproxy.c:1610]: rtpp_test(): support for RTP proxy <udp:10<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:37 ip-10-0-2-68 ./kamailio[3898]: ERROR: rtpproxy [rtpproxy.c:1707]: send_rtpp_command(): timeout waiting reply f<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:37 ip-10-0-2-68 ./kamailio[3898]: ERROR: rtpproxy [rtpproxy.c:1716]: send_rtpp_command(): proxy <udp:10.0.2.68:77<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:37 ip-10-0-2-68 ./kamailio[3898]: WARNING: rtpproxy [rtpproxy.c:1573]: rtpp_test(): can't get version of the RTP<br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none">I run rtpproxy like this:<br class="yiv4480501099" style="" clear="none"><font size="2">/usr/local/rtpproxy-install-dir/bin/rtpproxy -l <public ip here> -s udp:10.0.2.68:7722 -F -d DBUG:LOG_LOCAL3<br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none">I have these linee in the kamailio.cfg file<br class="yiv4480501099" style="" clear="none"><font size="2"><br class="yiv4480501099" style="" clear="none">loadmodule "rtpproxy.so"<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"># ----- rtpproxy params -----<br class="yiv4480501099" style="" clear="none">modparam("rtpproxy", "rtpproxy_sock", "udp:10.0.2.68:7722")<br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none">I have tried with localhost, with 127.0.0.1 and get the same results ( I mean configure kamailio to contact rttpproxy with localhost instead of ip and at the same time running rtpproxy with the same reference.<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"> I can see the rtpproxy running/listening<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"><font size="2">[root@ip-10-0-2-68 sbin]# netstat -lnp  | grep rtpproxy<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:7722              0.0.0.0:*                               3608/rtpproxy<br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none">I can also see these lines:<br class="yiv4480501099" style="" clear="none"><font size="2">[root@ip-10-0-2-68 sbin]# netstat -np  | grep 7722<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:49772             10.0.2.68:7722              ESTABLISHED 3928/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:36097             10.0.2.68:7722              ESTABLISHED 3897/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:49158             10.0.2.68:7722              ESTABLISHED 3906/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:37129             10.0.2.68:7722              ESTABLISHED 3904/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:39052             10.0.2.68:7722              ESTABLISHED 3926/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:38161             10.0.2.68:7722              ESTABLISHED 3919/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:53144             10.0.2.68:7722              ESTABLISHED 3887/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:39721             10.0.2.68:7722              ESTABLISHED 3905/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:59563             10.0.2.68:7722              ESTABLISHED 3909/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:51884             10.0.2.68:7722              ESTABLISHED 3921/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:46902             10.0.2.68:7722              ESTABLISHED 3930/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:33981             10.0.2.68:7722              ESTABLISHED 3931/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:60221             10.0.2.68:7722              ESTABLISHED 3898/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:35651             10.0.2.68:7722              ESTABLISHED 3900/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:33105             10.0.2.68:7722              ESTABLISHED 3927/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:43349             10.0.2.68:7722              ESTABLISHED 3887/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:39259             10.0.2.68:7722              ESTABLISHED 3899/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:35170             10.0.2.68:7722              ESTABLISHED 3907/./kamailio<br class="yiv4480501099" style="" clear="none">udp        0      0 10.0.2.68:38760             10.0.2.68:7722              ESTABLISHED 3908/./kamailio<br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none">In the rtpproxy I see that it is sent data and it replies too, I even got a wireshark capture showing that as well:<br class="yiv4480501099" style="" clear="none"><font size="2"><br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:get_command: received command "3931_2 V"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:rtpc_doreply: sending reply "20040107#012"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:get_command: received command "3927_2 V"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:rtpc_doreply: sending reply "20040107#012"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:get_command: received command "3926_2 V"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:rtpc_doreply: sending reply "20040107#012"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:get_command: received command "3928_2 V"<br class="yiv4480501099" style="" clear="none">Oct 27 21:54:41 ip-10-0-2-68 rtpproxy[3608]: DBUG:rtpc_doreply: sending reply "20040107#012"<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none">But somehow kamailio does not see it:<br class="yiv4480501099" style="" clear="none"><font size="2"><br class="yiv4480501099" style="" clear="none">[root@ip-10-0-2-68 sbin]# ./kamctl fifo nh_show_rtpp<br class="yiv4480501099" style="" clear="none">which: no greadlink in (/sbin:/bin:/usr/sbin:/usr/bin:/)<br class="yiv4480501099" style="" clear="none">which: no gdb in (/sbin:/bin:/usr/sbin:/usr/bin:/)<br class="yiv4480501099" style="" clear="none">udp:10.0.2.68:7722::  set=0<br class="yiv4480501099" style="" clear="none">        index:: 0<br class="yiv4480501099" style="" clear="none">        disabled:: 1<br class="yiv4480501099" style="" clear="none">        weight:: 1<br class="yiv4480501099" style="" clear="none">        recheck_ticks:: 53253287<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"></font><br class="yiv4480501099" style="" clear="none"></div><div class="yiv4480501099" id="yiv4480501099yui_3_16_0_1_1414453840694_5109" style="">I even when to the kamailio code and saw something that may have something to do with it but havent tried it yet:, in the implementation of the function "send_rtpp_command" I see that the socket created is using TCP. But I tried configuring kamailio/rtpproxy to use tcp instead but I also got the same results, kamailio seems to fail to acknoledgwe the replies from rtpproxy.<br class="yiv4480501099" style="" clear="none">I also have SELINUX disabled and the iptables are not running.<br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none">I dont know what else to check, if somebody can shed some light into this I'd appreciate it.<br clear="none"><br clear="none">jp2014<br clear="none"><br class="yiv4480501099" style="" clear="none"><br class="yiv4480501099" style="" clear="none"></div><div class="yiv4480501099" id="yiv4480501099yui_3_16_0_1_1414453840694_5109" style=""> </div></div></div></div></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div> </div></div></div></div></body></html>