[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r320938 - /team/irroot/distr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 26 00:27:06 CDT 2011


Author: irroot
Date: Thu May 26 00:26:51 2011
New Revision: 320938

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320938
Log:
If Format Is not compatibile make it compat chan_sip sip_write

Modified:
    team/irroot/distrotech-customers-trunk/channels/chan_sip.c

Modified: team/irroot/distrotech-customers-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/channels/chan_sip.c?view=diff&rev=320938&r1=320937&r2=320938
==============================================================================
--- team/irroot/distrotech-customers-trunk/channels/chan_sip.c (original)
+++ team/irroot/distrotech-customers-trunk/channels/chan_sip.c Thu May 26 00:26:51 2011
@@ -6340,12 +6340,20 @@
 	switch (frame->frametype) {
 	case AST_FRAME_VOICE:
 		if (!(ast_format_cap_iscompatible(ast->nativeformats, &frame->subclass.format))) {
+			struct ast_channel *bridge;
 			char s1[512];
+
 			ast_log(LOG_WARNING, "Asked to transmit frame type %s, while native formats is %s read/write = %s/%s\n",
 				ast_getformatname(&frame->subclass.format),
 				ast_getformatname_multiple(s1, sizeof(s1), ast->nativeformats),
 				ast_getformatname(&ast->readformat),
 				ast_getformatname(&ast->writeformat));
+
+			bridge = ast_bridged_channel(ast);
+			if (!ast_channel_trylock(bridge)) {
+				ast_log(LOG_WARNING, "Attempting to change formats making %s and %s compat.\n", ast->name, bridge->name);
+				ast_channel_make_compatible(ast, bridge);
+			}
 			return 0;
 		}
 		if (p) {




More information about the asterisk-commits mailing list