aboutsummaryrefslogtreecommitdiffstats
path: root/rtp.c
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-11-15 00:53:33 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-11-15 00:53:33 +0000
commitea6c73be353ca485910460006ac35d3894e690b8 (patch)
tree2252df4d37b91b7eeb55d843028e8f3d33f3b069 /rtp.c
parentecf766d435fc18559b645a30f3b31d1f6832be97 (diff)
Don't allow reinvite if both parties talk diffrent codec (part 2)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1753 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-xrtp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/rtp.c b/rtp.c
index 4025b5105..b4b3bc18c 100755
--- a/rtp.c
+++ b/rtp.c
@@ -1144,7 +1144,6 @@ int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, st
void *pvt0, *pvt1;
int to;
-
memset(&vt0, 0, sizeof(vt0));
memset(&vt1, 0, sizeof(vt1));
memset(&vac0, 0, sizeof(vac0));
@@ -1195,6 +1194,15 @@ int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, st
ast_mutex_unlock(&c1->lock);
return -2;
}
+ if (pr0->get_codec && pr1->get_codec) {
+ int codec0,codec1;
+ codec0 = pr0->get_codec(c0);
+ codec1 = pr1->get_codec(c1);
+ ast_log(LOG_WARNING, "codec0 = %d is not codec1 = %d, can't do reinvite\n",codec0,codec1);
+ /* Hey, we can't do reinvite if both parties speak diffrent codecs */
+ if (codec0 != codec1)
+ return -2;
+ }
if (pr0->set_rtp_peer(c0, p1, vp1))
ast_log(LOG_WARNING, "Channel '%s' failed to talk to '%s'\n", c0->name, c1->name);
else {