aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-27 19:24:17 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-27 19:24:17 +0000
commitbb9210c7a960fa9b4ec5c3d6167b25339b0428f0 (patch)
tree010456feea8c290b3ad46768771d566dba273121 /channels/chan_sip.c
parent3db53911ba5ee17df139b45c6ccac18fb916d276 (diff)
The following patch with updates for trunk. Works much better in trunk.
Also by accident fixed a bad typo by a previous committer, which actually made video calls not work fully... Merged revisions 89630 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r89630 | oej | 2007-11-27 16:23:17 +0100 (Tis, 27 Nov 2007) | 12 lines If we get a codec offer using a well-known payload type, but using it for another codec that we don't know, Asterisk did not remove that codec from the list. With this patch, we remove the codec from audio and video rtp objects and deny it ever existed. Thanks to lasse for testing. (closes issue #11376) Reported by: lasse Patches: bug11376.txt uploaded by oej (license 306) Tested by: lasse ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89698 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index ebf77519f..95f69fca1 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5918,25 +5918,39 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req)
continue;
} else if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) == 2) {
/* We have a rtpmap to handle */
- if (debug)
- ast_verbose("Found description format %s for ID %d\n", mimeSubtype, codec);
- found_rtpmap_codecs[last_rtpmap_codec] = codec;
- last_rtpmap_codec++;
/* Note: should really look at the 'freq' and '#chans' params too */
/* Note: This should all be done in the context of the m= above */
if (!strncasecmp(mimeSubtype, "H26", 3) || !strncasecmp(mimeSubtype, "MP4", 3)) { /* Video */
- /* Not going to do anything here for the moment, but we will soon */
- ast_rtp_set_rtpmap_type(newtextrtp, codec, "video", mimeSubtype, 1);
+ if(ast_rtp_set_rtpmap_type(newvideortp, codec, "video", mimeSubtype, 0) != -1) {
+ if (debug)
+ ast_verbose("Found video description format %s for ID %d\n", mimeSubtype, codec);
+ found_rtpmap_codecs[last_rtpmap_codec] = codec;
+ last_rtpmap_codec++;
+ } else {
+ ast_rtp_unset_m_type(newvideortp, codec);
+ if (debug)
+ ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+ }
} else if (!strncasecmp(mimeSubtype, "T140",4)) { /* Text */
if (p->trtp) {
/* ast_verbose("Adding t140 mimeSubtype to textrtp struct\n"); */
ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
}
} else { /* Must be audio?? */
- ast_rtp_set_rtpmap_type(newaudiortp, codec, "audio", mimeSubtype,
- ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0);
+ if(ast_rtp_set_rtpmap_type(newaudiortp, codec, "audio", mimeSubtype,
+ ast_test_flag(&p->flags[0], SIP_G726_NONSTANDARD) ? AST_RTP_OPT_G726_NONSTANDARD : 0) != -1) {
+ if (debug)
+ ast_verbose("Found audio description format %s for ID %d\n", mimeSubtype, codec);
+ found_rtpmap_codecs[last_rtpmap_codec] = codec;
+ last_rtpmap_codec++;
+ } else {
+ ast_rtp_unset_m_type(newaudiortp, codec);
+ if (debug)
+ ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+ }
}
+
}
}