Hi Sebastien,

For every Update or Lookup command, RTPProxy tries to open 2 file descriptors: 1 for RTP and 1 for RTCP. Both of them are required in order to work properly. Therefore every successful session will 4 ports - 2 for caller and 2 for callee.

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer


On 11/09/2011 04:03 PM, Sebastien CRUAUX wrote:
Update : it seems rtpproxy tries to bind on 2 sockets, one on an even port and another on the odd port just after (cf for loop in the create_twinlistener function). The first bind is successful but it fails on the second :

Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO :: (INVITE) rtpproxy set 1 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: entering select_rtpp_node Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: rtpproxy node count = 1 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: node->rn_disabled = 0, node->rn_recheck_ticks = 0, get_ticks = 11 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: result rtpp_test = 0 Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:handle_command: new session 886876334, tag 1383821790;1 requested, type strong Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18014 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18015 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18000 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18001 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18016 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18017 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18002 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18003 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18012 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18013 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18010 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18011 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18008 port succeeded Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:force_rtp_proxy_body: command sent to rtpproxy, cp = E10 , err = 10 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:force_rtp_proxy_body: rtpproxy returned an error, we disable the node Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18009 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: entering select_rtpp_node Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18018 port succeeded Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: rtpproxy node count = 1 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: node->rn_disabled = 1, node->rn_recheck_ticks = 71, get_ticks = 11 Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18019 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: INFO:rtpproxy:select_rtpp_node: result rtpp_test = 1 Nov 9 15:01:57 WWW_64Bits ./opensips[1882]: ERROR:rtpproxy:force_rtp_proxy_body: no available proxies Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: INFO:create_twinlistener: bind to the 18004 port succeeded Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:create_twinlistener: bind to the 18005 port failed, errno = 98: Address already in use Nov 9 15:01:57 WWW_64Bits rtpproxy[1774]: ERR:handle_command: can't create listener

Why are there 2 binds ? One should be enough (there is no video in my INVITE request).

Best regards,

Sebastien

Le 09/11/2011 12:12, Sebastien CRUAUX a écrit :
Hi Razvan,

I finally managed to get the rtpproxy logs (it only needed to be launched with the -d flag), so I added a trace in the create_twinlistener function in rtpp_command.c in order to see what was the errno on the bind attempt. I get an errno 98 (Address already in use) for all the UDP ports in my rtpproxy range (18000 - 18020) :

Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO :: (INVITE) rtpproxy set 1 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: entering select_rtpp_node Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: rtpproxy node count = 1 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: node->rn_disabled = 1, node->rn_recheck_ticks = 70, get_ticks = 72 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:rtpp_test: force = 0 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:rtpp_test: rtp proxy <udp:localhost:12221> found, support for it re-enabled Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: result rtpp_test = 0 Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: INFO:handle_command: new session 944821033294@192.168.1.206, tag z9hG4bK74406739;1 requested, type strong Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18013 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18007 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18017 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18009 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18005 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18001 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18015 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:force_rtp_proxy_body: command sent to rtpproxy, cp = E10 , err = 10 Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18011 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:force_rtp_proxy_body: rtpproxy returned an error, we disable the node Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:create_twinlistener: bind to the 18003 port failed, errno = 98: Address already in use Nov 8 17:53:52 WWW_64Bits rtpproxy[22611]: ERR:handle_command: can't create listener Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: entering select_rtpp_node Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: rtpproxy node count = 1 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: node->rn_disabled = 1, node->rn_recheck_ticks = 132, get_ticks = 72 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: INFO:rtpproxy:select_rtpp_node: result rtpp_test = 1 Nov 8 17:53:52 WWW_64Bits ./opensips[22671]: ERROR:rtpproxy:force_rtp_proxy_body: no available proxies

However, when I run netstat none of these ports seems to be used...

Best regards,

Sebastien

Le 08/11/2011 13:48, Razvan Crainea a écrit :
Hi Sebastien,

Taking a look into RTPProxy's code, I see that the error 10 is returned when it can't create a listener. This happens when RTPProxy can't create or bind a socket, or doesn't have enough ports allocated. My guess is that in your case it can't bind a socket on the interface specified by the "-l" parameter.

Best regards,

--
Ra(zvan Crainea
OpenSIPS Developer


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to