diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 181161617c..fbd270d41b 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -392,11 +392,6 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 } } - if (!tech_pvt->rm_encoding && (b_sdp = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) { - sofia_glue_sdp_map(b_sdp, &map, &ptmap); - } - - if (fmtp_out_var) { fmtp_out = fmtp_out_var; } @@ -435,6 +430,10 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, uint32 return; } + if (!tech_pvt->rm_encoding && (b_sdp = switch_channel_get_variable(tech_pvt->channel, SWITCH_B_SDP_VARIABLE))) { + sofia_glue_sdp_map(b_sdp, &map, &ptmap); + } + if (!sr) { if ((var_val = switch_channel_get_variable(tech_pvt->channel, "media_audio_mode"))) { sr = var_val;