]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_sip: Handle a request to negotiate T.38 after it is enabled 53/3153/2
authorJoshua Colp <jcolp@digium.com>
Thu, 7 Jul 2016 15:38:45 +0000 (12:38 -0300)
committerJoshua Colp <jcolp@digium.com>
Fri, 8 Jul 2016 17:51:59 +0000 (12:51 -0500)
Some T.38 implementations may send another re-invite after the initial
one which adds additional negotiation details (such as the max bitrate).
Currently this will fail when passthrough is being done in chan_sip as we
do nothing if T.38 is already active.

Other handlers of T.38 inside of Asterisk (such as res_fax) handle this
scenario so this change adds support for it to chan_sip. If a request
to negotiate is received while T.38 is already enabled a new re-INVITE is
sent and negotiation is done again.

ASTERISK-26179 #close

Change-Id: I0298494d3da6df3219bbfa4be9aa04015043145c

channels/chan_sip.c

index 9ec3a6989cc2276904fb26bb7b0705d96791cca7..80f1189dda3339dbbcd50191ad58f7e4a24dd7c2 100644 (file)
@@ -7426,7 +7426,8 @@ static int interpret_t38_parameters(struct sip_pvt *p, const struct ast_control_
                        ast_udptl_set_local_max_ifp(p->udptl, p->t38.our_parms.max_ifp);
                        change_t38_state(p, T38_ENABLED);
                        transmit_response_with_t38_sdp(p, "200 OK", &p->initreq, XMIT_CRITICAL);
-               } else if (p->t38.state != T38_ENABLED) {
+               } else if ((p->t38.state != T38_ENABLED) || ((p->t38.state == T38_ENABLED) &&
+                               (parameters->request_response == AST_T38_REQUEST_NEGOTIATE))) {
                        p->t38.our_parms = *parameters;
                        ast_udptl_set_local_max_ifp(p->udptl, p->t38.our_parms.max_ifp);
                        change_t38_state(p, T38_LOCAL_REINVITE);