From: Andreas Eversberg Date: Mon, 12 Nov 2012 11:20:27 +0000 (+0100) Subject: Fix: Set correct local RTP port X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=commitdiff_plain;h=9e6a068f252adab72e05fa732de363fc1cc98fe0 Fix: Set correct local RTP port --- diff --git a/sip.cpp b/sip.cpp index 1e8d59d..4c81f11 100644 --- a/sip.cpp +++ b/sip.cpp @@ -393,8 +393,9 @@ int Psip::rtp_open(void) if (rc != 0) goto try_next_port; - rc = rtp_sub_socket_bind(p_s_rtcp_fd.fd, &p_s_rtcp_sin_local, ip, next_udp_port+1); + rc = rtp_sub_socket_bind(p_s_rtcp_fd.fd, &p_s_rtcp_sin_local, ip, next_udp_port + 1); if (rc == 0) { + p_s_rtp_port_local = next_udp_port; next_udp_port = (next_udp_port + 2 > RTP_PORT_MAX) ? RTP_PORT_BASE : next_udp_port + 2; break; } @@ -421,7 +422,6 @@ try_next_port: rtp_close(); return rc; } - p_s_rtp_port_local = next_udp_port; p_s_rtp_ip_local = ntohl(p_s_rtp_sin_local.sin_addr.s_addr); PDEBUG(DEBUG_SIP, "local ip %08x port %d\n", p_s_rtp_ip_local, p_s_rtp_port_local); PDEBUG(DEBUG_SIP, "remote ip %08x port %d\n", p_s_rtp_ip_remote, p_s_rtp_port_remote);