]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] on call term optionally ignore Q.850 Reason 1680/head
authorKen <krice@freeswitch.org>
Tue, 7 Jun 2022 16:56:54 +0000 (11:56 -0500)
committerAndrey Volk <andywolk@gmail.com>
Tue, 7 Jun 2022 16:58:43 +0000 (19:58 +0300)
Currently SIP termination messages with Q.850 override the SIP
reason. Add chanvar ignore_q850_reason to ignore the Q.850 reason
and keep the SIP Reason Code.

Using the chan var avoids unexpected changes in behavior.

Co-authored-by: Brian West <brian@freeswitch.org>
src/mod/endpoints/mod_sofia/sofia.c

index 5066a13ef879627a6823f41e96f79f24ebc5226d..09d877527a6b292bbd17ba95877cc0f0049eb15a 100644 (file)
@@ -8718,7 +8718,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
                        sofia_clear_flag_locked(tech_pvt, TFLAG_NOHUP);
                } else if (switch_channel_up(channel)) {
                        int cause;
-                       if (tech_pvt->q850_cause) {
+                       if (tech_pvt->q850_cause && !switch_channel_var_true(channel, "ignore_q850_reason")) {
                                cause = tech_pvt->q850_cause;
                        } else {
                                cause = sofia_glue_sip_cause_to_freeswitch(status);