]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't offer video to directmedia callee unless caller offered it as well
authorTerry Wilson <twilson@digium.com>
Mon, 9 May 2011 20:04:41 +0000 (20:04 +0000)
committerTerry Wilson <twilson@digium.com>
Mon, 9 May 2011 20:04:41 +0000 (20:04 +0000)
Make sure that when directmedia is enabled, that video is not offered to the
callee even if it supports it. p->vrtp will not exist since the caller didn't
offer video.

(closes issue #19195)
Reported by: one47
Patches:
      sip_cant_add_video_rtp uploaded by one47 (license 23)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@318331 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9c6dd7ebb02f8e3a8cc5f29d98d971d0a7a7a75d..9c2779b80dac27b215516b758571ca7db3ba5b1e 100644 (file)
@@ -10597,11 +10597,14 @@ static enum sip_result add_sdp(struct sip_request *resp, struct sip_pvt *p, int
                doing_directmedia = (p->redirip.sin_addr.s_addr && p->redircodecs) ? TRUE : FALSE;
                /* Check if we need video in this call */
                if ((p->jointcapability & AST_FORMAT_VIDEO_MASK) && !p->novideo) {
-                       if (p->vrtp) {
+                       if (doing_directmedia && !(p->jointcapability & AST_FORMAT_VIDEO_MASK & p->redircodecs)) {
+                               ast_debug(2, "This call needs video offers, but caller probably did not offer it!\n");
+                       } else if (p->vrtp) {
                                needvideo = TRUE;
                                ast_debug(2, "This call needs video offers!\n");
-                       } else
+                       } else {
                                ast_debug(2, "This call needs video offers, but there's no video support enabled!\n");
+                       }
                }
                /* Check if we need text in this call */
                if ((p->jointcapability & AST_FORMAT_TEXT_MASK) && !p->notext) {