From ac93e393612d183782a327c590c2d231626407c0 Mon Sep 17 00:00:00 2001 From: Giacomo Vacca Date: Fri, 30 Apr 2021 19:32:00 +0200 Subject: [PATCH 1/3] tm: t_suspend.c - do not t_continue with reply if suspended --- src/modules/tm/t_suspend.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c index 4c8de42ce6d..590e58939bf 100644 --- a/src/modules/tm/t_suspend.c +++ b/src/modules/tm/t_suspend.c @@ -401,6 +401,12 @@ int t_continue_helper(unsigned int hash_index, unsigned int label, exec_post_script_cb(t->uac[branch].reply, cb_type); } + if (t->flags & T_ASYNC_SUSPENDED) { + LM_DBG("The transaction is suspended, so not continuing\n"); + set_t(backup_T, backup_T_branch); + return 0; + } + LM_DBG("restoring previous environment\n"); faked_env( t, 0, 1); From bdd602c8c10367de1be097912c9d3bc359a94676 Mon Sep 17 00:00:00 2001 From: Giacomo Vacca Date: Mon, 3 May 2021 14:20:14 +0200 Subject: [PATCH 2/3] tm: t_suspend.c - unlock t_continue and reset flag if suspended again --- src/modules/tm/t_suspend.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c index 590e58939bf..04f906f53ca 100644 --- a/src/modules/tm/t_suspend.c +++ b/src/modules/tm/t_suspend.c @@ -401,15 +401,17 @@ int t_continue_helper(unsigned int hash_index, unsigned int label, exec_post_script_cb(t->uac[branch].reply, cb_type); } + LM_DBG("restoring previous environment\n"); + faked_env( t, 0, 1); + if (t->flags & T_ASYNC_SUSPENDED) { LM_DBG("The transaction is suspended, so not continuing\n"); + t->flags &= ~T_ASYNC_CONTINUE; + UNLOCK_ASYNC_CONTINUE(t); set_t(backup_T, backup_T_branch); return 0; } - LM_DBG("restoring previous environment\n"); - faked_env( t, 0, 1); - /*lock transaction replies - will be unlocked when reply is relayed*/ LOCK_REPLIES( t ); if ( is_local(t) ) { From a8f52fd86a59f8f411ebc063f09eb54cb3047b6c Mon Sep 17 00:00:00 2001 From: Giacomo Vacca Date: Wed, 5 May 2021 15:42:01 +0200 Subject: [PATCH 3/3] tm: t_reply.c - received_reply() done if suspended after route --- src/modules/tm/t_reply.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c index a46921cbfdd..306ed8f8724 100644 --- a/src/modules/tm/t_reply.c +++ b/src/modules/tm/t_reply.c @@ -2653,6 +2653,11 @@ int reply_received( struct sip_msg *p_msg ) } #endif + if (t->flags & T_ASYNC_SUSPENDED) { + LM_DBG("Reply for suspended transaction, done.\n"); + goto done; + } + if (unlikely(p_msg->msg_flags&FL_RPL_SUSPENDED)) { /* suspended the reply (async) - no error */ goto done;