Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 56124) +++ channels/chan_sip.c (working copy) @@ -6409,7 +6409,7 @@ } respprep(&resp, p, msg, req); if (p->rtp) { - if (!p->autoframing && !ast_test_flag(&p->flags[0], SIP_OUTGOING)) { + if (!p->autoframing && !ast_test_flag(&p->flags[1], SIP_PAGE2_OUTGOING_CALL)) { if (option_debug) ast_log(LOG_DEBUG, "Setting framing from config on incoming call\n"); ast_rtp_codec_setpref(p->rtp, &p->prefs); Index: main/rtp.c =================================================================== --- main/rtp.c (revision 56124) +++ main/rtp.c (working copy) @@ -3144,6 +3144,7 @@ enum ast_rtp_get_result audio_p1_res = AST_RTP_GET_FAILED, video_p1_res = AST_RTP_GET_FAILED; enum ast_bridge_result res = AST_BRIDGE_FAILED; int codec0 = 0, codec1 = 0; + struct ast_format_list fmt0, fmt1; void *pvt0 = NULL, *pvt1 = NULL; /* Lock channels */ @@ -3247,8 +3248,18 @@ return AST_BRIDGE_FAILED_NOWARN; } + fmt0 = ast_codec_pref_getsize(&p0->pref, c0->rawreadformat); + fmt1 = ast_codec_pref_getsize(&p1->pref, c1->rawreadformat); + if ( fmt0.cur_ms != fmt1.cur_ms){ + if (option_debug > 3) + ast_log(LOG_DEBUG, "Channel0 = %s codec = %d Channel1 = %s codec = %d\n", c0->name, c0->rawreadformat, c1->name, c1->rawreadformat); + ast_log(LOG_DEBUG, "Codec0 framing = %d is not Codec1 framing = %d, cannot P2P bridge in RTP.\n", fmt0.cur_ms, fmt1.cur_ms); + audio_p0_res = AST_RTP_TRY_NATIVE; + audio_p1_res = AST_RTP_TRY_NATIVE; + } + /* If either side can only do a partial bridge, then don't try for a true native bridge */ - if (audio_p0_res == AST_RTP_TRY_PARTIAL || audio_p1_res == AST_RTP_TRY_PARTIAL) { + if ((audio_p0_res == AST_RTP_TRY_PARTIAL || audio_p1_res == AST_RTP_TRY_PARTIAL)) { /* In order to do Packet2Packet bridging both sides must be in the same rawread/rawwrite */ if (c0->rawreadformat != c1->rawwriteformat || c1->rawreadformat != c0->rawwriteformat) { if (option_debug) Index: main/frame.c =================================================================== --- main/frame.c (revision 56124) +++ main/frame.c (working copy) @@ -1227,6 +1227,7 @@ } } + /* size validation */ if(!framems) framems = AST_FORMAT_LIST[index].def_ms; @@ -1242,6 +1243,9 @@ fmt.cur_ms = framems; + if (option_debug > 3) + ast_log(LOG_DEBUG, "Framing for codec %d is %d\n", format, fmt.cur_ms); + return fmt; }