summaryrefslogtreecommitdiff
path: root/main/rtp.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-10-29 20:21:33 +0000
committerOlle Johansson <oej@edvina.net>2006-10-29 20:21:33 +0000
commit52a5d63a2df039d297d2bf360cc3fb92b5d6be0b (patch)
tree2cab9cca729397ea0ec1d13ea8cc5f5d37f34d06 /main/rtp.c
parent53ef33ccc35e465a7684494cb518e70b083db049 (diff)
Bind RTCP to the same IP as RTP.
I currently don't see this as a bug that needs to be fixed in 1.4/1.2 too, but feel free to backport if you see it that way. RTCP now binds to ALL IP addresses on the host, RTP to a specific address. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/main/rtp.c b/main/rtp.c
index cf3737c6b..f21a5afbd 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -1740,6 +1740,7 @@ char *ast_rtp_lookup_mime_multiple(char *buf, size_t size, const int capability,
return buf;
}
+/*! \brief Open RTP or RTCP socket for a session */
static int rtp_socket(void)
{
int s;
@@ -1815,9 +1816,12 @@ struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io
/* Must be an even port number by RTP spec */
rtp->us.sin_port = htons(x);
rtp->us.sin_addr = addr;
+
/* If there's rtcp, initialize it as well. */
- if (rtp->rtcp)
+ if (rtp->rtcp) {
rtp->rtcp->us.sin_port = htons(x + 1);
+ rtp->rtcp->us.sin_addr = addr;
+ }
/* Try to bind it/them. */
if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) &&
(!rtp->rtcp || !bind(rtp->rtcp->s, (struct sockaddr *)&rtp->rtcp->us, sizeof(rtp->rtcp->us))))