[Asterisk-cvs] asterisk rtp.c,1.43,1.44
martinp at lists.digium.com
martinp at lists.digium.com
Fri Nov 14 18:27:18 CST 2003
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv3518
Modified Files:
rtp.c
Log Message:
Don't allow reinvite if both parties talk diffrent codec (part 2)
Index: rtp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/rtp.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- rtp.c 4 Nov 2003 02:40:09 -0000 1.43
+++ rtp.c 15 Nov 2003 00:53:33 -0000 1.44
@@ -1144,7 +1144,6 @@
void *pvt0, *pvt1;
int to;
-
memset(&vt0, 0, sizeof(vt0));
memset(&vt1, 0, sizeof(vt1));
memset(&vac0, 0, sizeof(vac0));
@@ -1194,6 +1193,15 @@
ast_mutex_unlock(&c0->lock);
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);
More information about the svn-commits
mailing list