res_pjsip_t38: T.38 error correction mode selection at 200 ok received

if asterisk offer T38 SDP with none error correction scheme and
the endpoint respond with redundancy EC scheme, asterisk switch
to that mode. Since we configure the endpoint as none EC mode
we should not switch to any other mode except none.
following logic implemented in code.

1. If asterisk offer none, and anything except none in answer
   will be ignored.
2. If asterisk offer fec, answer with fec, redundancy and none will
   be accepted.
3. If asterisk offer redundancy, answer with redundancy and none
   will be accepted.

ASTERISK-28621

Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19
This commit is contained in:
Salah Ahmed 2019-11-15 11:34:26 -06:00
parent 5802e32d47
commit efef44985d
1 changed files with 25 additions and 5 deletions

View File

@ -740,12 +740,32 @@ static void t38_interpret_sdp(struct t38_state *state, struct ast_sip_session *s
state->their_parms.rate_management = AST_T38_RATE_MANAGEMENT_TRANSFERRED_TCF;
}
} else if (!pj_stricmp2(&attr->name, "t38faxudpec")) {
if (!pj_stricmp2(&attr->value, "t38UDPRedundancy")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_REDUNDANCY);
} else if (!pj_stricmp2(&attr->value, "t38UDPFEC")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_FEC);
if (session->t38state == T38_LOCAL_REINVITE) {
if (session->endpoint->media.t38.error_correction == UDPTL_ERROR_CORRECTION_FEC) {
if (!pj_stricmp2(&attr->value, "t38UDPFEC")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_FEC);
} else if (!pj_stricmp2(&attr->value, "t38UDPRedundancy")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_REDUNDANCY);
} else {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_NONE);
}
} else if (session->endpoint->media.t38.error_correction == UDPTL_ERROR_CORRECTION_REDUNDANCY) {
if (!pj_stricmp2(&attr->value, "t38UDPRedundancy")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_REDUNDANCY);
} else {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_NONE);
}
} else {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_NONE);
}
} else {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_NONE);
if (!pj_stricmp2(&attr->value, "t38UDPRedundancy")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_REDUNDANCY);
} else if (!pj_stricmp2(&attr->value, "t38UDPFEC")) {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_FEC);
} else {
ast_udptl_set_error_correction_scheme(session_media->udptl, UDPTL_ERROR_CORRECTION_NONE);
}
}
}