[asterisk-bugs] [Asterisk 0017735]: Video RTP type in response SDP not matching the one in INVITE

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jul 28 04:24:56 CDT 2010


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17735 
====================================================================== 
Reported By:                sgarcia
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17735
Category:                   Channels/chan_sip/Video
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  1.4  
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-07-28 04:24 CDT
Last Modified:              2010-07-28 04:24 CDT
====================================================================== 
Summary:                    Video RTP type in response SDP not matching the one
in INVITE
Description: 
When creating the SDP for answering a SIP call only audio types are matched
against the incoming INVITE SDP. As a result the default rtp codecs type
for video are used instead.

Even if that is tenchically correct, that causes softphones like Port SIP
or Pangolin not to display incomming video as expects the same rtp codec
type for both rtp video streams.

For audio it is already done, so the it will be much more coherent to do
it in video also. The ptch is quite simple:

--- /usr/local/src/orig/asterisk-1.4.33.1/channels/chan_sip.c   2010-06-01
22:57:49.000000000 +0800
+++ /usr/local/src/asterisk-1.4.33.1/channels/chan_sip.c        2010-07-28
16:58:21.000000000 +0800
@@ -6763,14 +6763,23 @@

        if (debug)
                ast_verbose("Adding codec 0x%x (%s) to SDP\n", codec,
ast_getformatname(codec));
-       if ((rtp_code = ast_rtp_lookup_code(p->rtp, 1, codec)) == -1)
+
+       struct ast_rtp* rtp = NULL;
+
+       if (codec & AST_FORMAT_AUDIO_MASK)
+               rtp = p->rtp;
+       if (codec & AST_FORMAT_VIDEO_MASK)
+               rtp = p->vrtp;
+
+       if(!rtp)
                return;

-       if (p->rtp) {
-               struct ast_codec_pref *pref =
ast_rtp_codec_getpref(p->rtp);
-               fmt = ast_codec_pref_getsize(pref, codec);
-       } else /* I dont see how you couldn't have p->rtp, but good to
check for and error out if not there like earlier code */
+       if ((rtp_code = ast_rtp_lookup_code(rtp, 1, codec)) == -1)
                return;
+
+       struct ast_codec_pref *pref = ast_rtp_codec_getpref(rtp);
+       fmt = ast_codec_pref_getsize(pref, codec);
+
        ast_build_string(m_buf, m_size, " %d", rtp_code);
        ast_build_string(a_buf, a_size, "a=rtpmap:%d %s/%d\r\n",
rtp_code,
                         ast_rtp_lookup_mime_subtype(1, codec,

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-07-28 04:24 sgarcia        New Issue                                    
2010-07-28 04:24 sgarcia        Asterisk Version          => SVN             
2010-07-28 04:24 sgarcia        Regression                => No              
2010-07-28 04:24 sgarcia        SVN Branch (only for SVN checkouts, not tarball
releases) =>  1.4            
======================================================================




More information about the asterisk-bugs mailing list