Summary: | ASTERISK-11113: Can't make two channels compatible if they have common video codec | ||
Reporter: | Chih-Wei Huang (cwhuang) | Labels: | |
Date Opened: | 2007-12-26 21:42:41.000-0600 | Date Closed: | 2007-12-27 08:48:41.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_sip/Video |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ||
Description: | I'm testing asterisk 1.4 with some video phones. I usually got such errors: [Dec 27 11:24:53] WARNING[13425]: channel.c:3038 set_format: Unable to find a codec translation path from unknown to unknown [Dec 27 11:24:53] WARNING[13425]: channel.c:3423 ast_channel_make_compatible: Unable to set read format on channel SIP/401-08ee0760 to 524288 [Dec 27 11:24:53] WARNING[13425]: app_dial.c:1685 dial_exec_full: Had to drop call because I couldn't make SIP/401-08ee0760 compatible with SIP/405-08ef0908 One of my phone has codec (gsm|h263), the other has (g729|h263). They should be compatible. | ||
Comments: | By: Chih-Wei Huang (cwhuang) 2007-12-26 21:45:21.000-0600 By analyzing the API ast_translator_best_choice(), I think it incorrectly take the common video codec into consideration. The following simple patch fixes the problem. Index: main/translate.c =================================================================== --- main/translate.c (revision 94825) +++ main/translate.c (working copy) @@ -796,7 +796,7 @@ int cur, cursrc; int besttime = INT_MAX; int beststeps = INT_MAX; - int common = (*dst) & (*srcs); /* are there common formats ? */ + int common = (*dst) & (*srcs) & AST_FORMAT_AUDIO_MASK; /* are there common formats ? */ if (common) { /* yes, pick one and return */ for (cur = 1, y = 0; y < MAX_FORMAT; cur <<= 1, y++) { By: Russell Bryant (russell) 2007-12-26 21:45:22.000-0600 Please provide a SIP debug trace of the call when the problem occurs. By: Chih-Wei Huang (cwhuang) 2007-12-26 21:50:45.000-0600 I confirm the patch I provided fix the issue. I think no more debug trace is required. By: Digium Subversion (svnbot) 2007-12-27 08:29:58.000-0600 Repository: asterisk Revision: 94828 U branches/1.4/main/translate.c ------------------------------------------------------------------------ r94828 | russell | 2007-12-27 08:29:56 -0600 (Thu, 27 Dec 2007) | 9 lines Change ast_translator_best_choice() to only pay attention to audio formats. This fixes a problem where Asterisk claims that a translation path can not be found for channels involving video. (closes issue ASTERISK-11113) Reported by: cwhuang Tested by: cwhuang Patch suggested by cwhuang, with some additional changes by me. ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=94828 By: Digium Subversion (svnbot) 2007-12-27 08:48:41.000-0600 Repository: asterisk Revision: 94830 _U trunk/ U trunk/include/asterisk/translate.h U trunk/main/translate.c ------------------------------------------------------------------------ r94830 | russell | 2007-12-27 08:48:40 -0600 (Thu, 27 Dec 2007) | 22 lines Merged revisions 94828-94829 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r94828 | russell | 2007-12-27 08:33:21 -0600 (Thu, 27 Dec 2007) | 9 lines Change ast_translator_best_choice() to only pay attention to audio formats. This fixes a problem where Asterisk claims that a translation path can not be found for channels involving video. (closes issue ASTERISK-11113) Reported by: cwhuang Tested by: cwhuang Patch suggested by cwhuang, with some additional changes by me. ........ r94829 | russell | 2007-12-27 08:44:29 -0600 (Thu, 27 Dec 2007) | 2 lines Use the constant that I really meant to use here ... ........ ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=94830 |