Summary: | ASTERISK-01041: [patch] video format description bug into an INVITE message | ||
Reporter: | fgilli (fgilli) | Labels: | |
Date Opened: | 2004-02-17 05:25:45.000-0600 | Date Closed: | 2008-01-15 14:45:06.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) MSN2CallMSN1.txt | |
Description: | You can use MSN V5.0 to make a video call (you need windows XP). The Video doesn't work because there is a bug into SIP. The INVITE message between MSN1 and Asterisk has: m=video 5006 RTP/AVP 34 a=rtpmap:34 H263/90000 But the INVITE message between Asterisk and MSN2 has: m=video 19172 RTP/AVP (the message is truncated) The bug is in chan_sip.c into add_sdp() function: /*Now send any other common codecs, and non-codec formats:*/ for (x = 1; x <= AST_FORMAT_MAX_AUDIO; x <<= 1) {....} must be replace by for (x = 1; x <= AST_FORMAT_MAX_VIDEO; x <<= 1) {....} ****** ADDITIONAL INFORMATION ****** With this patch you can now make a video call between 2 msn, or msn and other SIP visiophones... | ||
Comments: | By: Olle Johansson (oej) 2004-02-17 12:58:24.000-0600 Could you please attache a full SIP DEBUG of the INVITES? By: fgilli (fgilli) 2004-02-18 04:39:49.000-0600 Here is the full SIP debug. Note that the bug is here: (chan_sip.c / add_sdp() function) for (x = 1; x <= AST_FORMAT_MAX_AUDIO; x <<= 1) { if ((p->jointcapability & x) && !(alreadysent & x)) { if (sipdebug) ast_verbose("Answering with capability %d\n", x); codec = ast_rtp_lookup_code(p->rtp, 1, x); if (codec > -1) { snprintf(costr, sizeof(costr), " %d", codec); if (x < AST_FORMAT_MAX_AUDIO) { strncat(m, costr, sizeof(m) - strlen(m)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x)); strncat(a, costr, sizeof(a) - strlen(a)); } else { strncat(m2, costr, sizeof(m2) - strlen(m2)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/90000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x)); strncat(a2, costr, sizeof(a2) - strlen(a2)); } } } } Can't deals with video codec because the en of the loop is AST_FORMAT_MAX_AUDIO. So, it must be replace by : for (x = 1; x <= AST_FORMAT_MAX_VIDEO; x <<= 1) { if ((p->jointcapability & x) && !(alreadysent & x)) { if (sipdebug) ast_verbose("Answering with capability %d\n", x); codec = ast_rtp_lookup_code(p->rtp, 1, x); if (codec > -1) { snprintf(costr, sizeof(costr), " %d", codec); if (x < AST_FORMAT_MAX_AUDIO) { strncat(m, costr, sizeof(m) - strlen(m)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x)); strncat(a, costr, sizeof(a) - strlen(a)); } else { strncat(m2, costr, sizeof(m2) - strlen(m2)); snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/90000\r\n", codec, ast_rtp_lookup_mime_subtype(1, x)); strncat(a2, costr, sizeof(a2) - strlen(a2)); } } } } By: Mark Spencer (markster) 2004-02-23 10:56:36.000-0600 Did you enabled video in your sip.conf with: videosupport=yes in [general] ? By: Mark Spencer (markster) 2004-02-27 02:21:56.000-0600 Also, did you allow the h263 video codec with allow => h263 ? By: z_smurf (z_smurf) 2004-02-27 06:30:08.000-0600 Markster: I think this is a clear case. This must be a bug. fgilli found that the for-loop is wrong. Read his Description again. By: fgilli (fgilli) 2004-03-01 10:53:14.000-0600 I confirm that: videosupport=yes and all codec are enable. As z_smurf said this is a clear case: "if (x < AST_FORMAT_MAX_AUDIO)" can't be true if the for-loop end with AST_FORMAT_MAX_AUDIO By: Mark Spencer (markster) 2004-03-01 11:25:08.000-0600 Okay, this wouldn't be an issue had you explicitly done: allow=h263 but because you did allow=all it is an issue. I've put in a fix that should work with both videosupport=yes and videosupport=no. By: Digium Subversion (svnbot) 2008-01-15 14:45:06.000-0600 Repository: asterisk Revision: 2282 U branches/v1-0_stable/channel.c U branches/v1-0_stable/channels/chan_sip.c ------------------------------------------------------------------------ r2282 | markster | 2008-01-15 14:45:06 -0600 (Tue, 15 Jan 2008) | 2 lines Handle video formats properly when allow=all (bug ASTERISK-1041) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=2282 |