[Asterisk-code-review] res_pjsip_t38: T.38 error correction mode selection at 200 ok received (asterisk[13])
Joshua Colp
asteriskteam at digium.com
Mon Dec 2 06:47:52 CST 2019
Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/13180 )
Change subject: res_pjsip_t38: T.38 error correction mode selection at 200 ok received
......................................................................
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
---
M res/res_pjsip_t38.c
1 file changed, 25 insertions(+), 5 deletions(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c
index 62bbb48..5948665 100644
--- a/res/res_pjsip_t38.c
+++ b/res/res_pjsip_t38.c
@@ -702,12 +702,32 @@
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);
+ }
}
}
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13180
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I343c62253ea4c8b7ee17abbfb377a4d484a14b19
Gerrit-Change-Number: 13180
Gerrit-PatchSet: 2
Gerrit-Owner: Salah Ahmed <txrubel at gmail.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191202/b9b55854/attachment.html>
More information about the asterisk-code-review
mailing list