Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 322174) +++ channels/chan_sip.c (working copy) @@ -6284,12 +6284,20 @@ switch (frame->frametype) { case AST_FRAME_VOICE: if (!(frame->subclass.codec & ast->nativeformats)) { + struct ast_channel *bridge; char s1[512], s2[512], s3[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.codec), ast_getformatname_multiple(s1, sizeof(s1), ast->nativeformats & AST_FORMAT_AUDIO_MASK), ast_getformatname_multiple(s2, sizeof(s2), ast->readformat), ast_getformatname_multiple(s3, sizeof(s3), ast->writeformat)); + bridge = ast_bridged_channel(ast); + if (bridge && !ast_channel_trylock(bridge)) { + ast_set_write_format(ast, frame->subclass.codec); + ast_log(LOG_WARNING, "Attempting to change formats making %s and %s compat.\n", ast->name, bridge->name); + ast_channel_make_compatible(ast, bridge); + ast_channel_unlock(bridge); + } return 0; } if (p) {