Merged revisions 56011 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r56011 | russell | 2007-02-21 18:57:36 -0600 (Wed, 21 Feb 2007) | 11 lines

Merged revisions 56010 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r56010 | russell | 2007-02-21 18:53:25 -0600 (Wed, 21 Feb 2007) | 3 lines

If we receive a frame that is not in any of the negotiated formats, then drop
it.  (potentially issue #8781 and SPD-12)

........

................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56012 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant 2007-02-22 00:59:17 +00:00
parent 48517d4bc8
commit 80fce39036
1 changed files with 7 additions and 0 deletions

View File

@ -4424,6 +4424,13 @@ static struct ast_frame *sip_rtp_read(struct ast_channel *ast, struct sip_pvt *p
/* We already hold the channel lock */
if (f->frametype == AST_FRAME_VOICE) {
if (f->subclass != (p->owner->nativeformats & AST_FORMAT_AUDIO_MASK)) {
if (!(f->subclass & p->jointcapability)) {
if (option_debug) {
ast_log(LOG_DEBUG, "Bogus frame of format '%s' received from '%s'!\n",
ast_getformatname(f->subclass), p->owner->name);
}
return &ast_null_frame;
}
if (option_debug)
ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
p->owner->nativeformats = (p->owner->nativeformats & (AST_FORMAT_VIDEO_MASK | AST_FORMAT_TEXT_MASK)) | f->subclass;