diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-07-08 11:46:15 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-07-08 11:46:15 +0000 |
commit | e6ec107095e052276e613f40ff60bb593146531f (patch) | |
tree | 21665bd9dea4199212e2bb584d97784842e9914f /rtp.c | |
parent | cce8f951b1cc6ba649775083c117bd6911a74895 (diff) |
Extend bindaddr to RTP connections on SIP (bug #1989 et al)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3393 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-x | rtp.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -786,7 +786,7 @@ static struct ast_rtcp *ast_rtcp_new(void) return rtcp; } -struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode) +struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode, struct in_addr addr) { struct ast_rtp *rtp; int x; @@ -817,6 +817,7 @@ struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, for (;;) { /* Must be an even port number by RTP spec */ rtp->us.sin_port = htons(x); + rtp->us.sin_addr = addr; if (rtp->rtcp) rtp->rtcp->us.sin_port = htons(x + 1); if (!(first = bind(rtp->s, (struct sockaddr *)&rtp->us, sizeof(rtp->us))) && @@ -861,6 +862,13 @@ struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, return rtp; } +struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode) +{ + struct in_addr ia; + memset(&ia, 0, sizeof(ia)); + return ast_rtp_new_with_bindaddr(sched, io, rtcpenable, callbackmode, ia); +} + int ast_rtp_settos(struct ast_rtp *rtp, int tos) { int res; |