diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index c11c31dbb4..1e4ffaa60e 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -294,6 +294,8 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) } else { if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) { char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE); + tech_pvt->num_codecs = 0; + sofia_glue_tech_prepare_codecs(tech_pvt); if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END()); @@ -884,6 +886,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi } else { if (switch_test_flag(tech_pvt, TFLAG_LATE_NEGOTIATION)) { char *r_sdp = switch_channel_get_variable(channel, SWITCH_R_SDP_VARIABLE); + tech_pvt->num_codecs = 0; + sofia_glue_tech_prepare_codecs(tech_pvt); if (sofia_glue_tech_media(tech_pvt, r_sdp) != SWITCH_STATUS_SUCCESS) { switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "CODEC NEGOTIATION ERROR"); nua_respond(tech_pvt->nh, SIP_488_NOT_ACCEPTABLE, TAG_END());