sip codec negotiation of dynamic rtp payloads error fix

This patch fixes how chan_sip handles dynamic rtp payload types
it does not understand.  At the moment if a dynamic payload's mime
type does not match one we understand, the payload does not get
removed from our payload table.  As a result of this, the payload
is set to whatever dynamic codec we use internally for that payload
number on outgoing INVITES.  This is incorrect.

This patch fixes this by properly checking the rtpmap set function's
return code to make sure it was found.  The function can return both
-1 and -2 depending on the source of the mismatch.  We were just
checking -1 explicitly.

Review: https://reviewboard.asterisk.org/r/1169/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@314017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David Vossel
2011-04-18 13:41:06 +00:00
parent d460a38e5a
commit 2998c62fc4
3 changed files with 7 additions and 6 deletions

View File

@@ -562,8 +562,8 @@ int ast_rtp_codecs_payloads_set_rtpmap_type_rate(struct ast_rtp_codecs *codecs,
}
/* if both sample rates have been supplied, and they don't match,
then this not a match; if one has not been supplied, then the
rates are not compared */
* then this not a match; if one has not been supplied, then the
* rates are not compared */
if (sample_rate && t->sample_rate &&
(sample_rate != t->sample_rate)) {
continue;