--- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10063,6 +10063,7 @@ int audio = FALSE; int video = FALSE; int image = FALSE; + enum ast_t38_ec_modes error_correction_scheme_prior_offer_from_peer = UDPTL_ERROR_CORRECTION_NONE; int text = FALSE; int processed_crypto = FALSE; char protocol[18] = {0,}; @@ -10348,6 +10349,9 @@ if (p->t38.state != T38_ENABLED) { memset(&p->t38.their_parms, 0, sizeof(p->t38.their_parms)); + /* Get the error correction scheme before the offer */ + error_correction_scheme_prior_offer_from_peer = ast_udptl_get_error_correction_scheme(p->udptl); + /* default EC to none, the remote end should * respond with the EC they want to use */ ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE); @@ -10469,6 +10473,15 @@ (processed == TRUE)? "OK." : "UNSUPPORTED OR FAILED."); } + if (image && p->t38.state != T38_ENABLED) { + if (error_correction_scheme_prior_offer_from_peer != ast_udptl_get_error_correction_scheme(p->udptl) && + UDPTL_ERROR_CORRECTION_NONE == error_correction_scheme_prior_offer_from_peer) { + /* Disregard the error correction scheme from remote offer and + reset the error correction scheme to NONE*/ + ast_udptl_set_error_correction_scheme(p->udptl, UDPTL_ERROR_CORRECTION_NONE); + } + } + /* Ensure crypto lines are provided where necessary */ if (audio && secure_audio && !processed_crypto) { ast_log(LOG_WARNING, "Rejecting secure audio stream without encryption details: %s\n", m); @@ -10477,6 +10490,7 @@ ast_log(LOG_WARNING, "Rejecting secure video stream without encryption details: %s\n", m); return -1; } + } /* Sanity checks */