Module: kamailio Branch: master Commit: 82096e8f0af7a0bc75fc76749f3a7fdb6e1b028d URL: https://github.com/kamailio/kamailio/commit/82096e8f0af7a0bc75fc76749f3a7fdb...
Author: Giacomo Vacca giacomo.vacca@gmail.com Committer: GitHub noreply@github.com Date: 2021-05-17T11:56:05+02:00
tm: t_suspend.c - t_continue_helper() - do not continue processing a reply if it's suspended again (#2721)
* tm: t_suspend.c - do not t_continue with reply if suspended
* tm: t_suspend.c - unlock t_continue and reset flag if suspended again
* tm: t_reply.c - received_reply() done if suspended after route
---
Modified: src/modules/tm/t_reply.c Modified: src/modules/tm/t_suspend.c
---
Diff: https://github.com/kamailio/kamailio/commit/82096e8f0af7a0bc75fc76749f3a7fdb... Patch: https://github.com/kamailio/kamailio/commit/82096e8f0af7a0bc75fc76749f3a7fdb...
---
diff --git a/src/modules/tm/t_reply.c b/src/modules/tm/t_reply.c index a46921cbfd..306ed8f872 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; diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c index 4c8de42ce6..04f906f53c 100644 --- a/src/modules/tm/t_suspend.c +++ b/src/modules/tm/t_suspend.c @@ -404,6 +404,14 @@ int t_continue_helper(unsigned int hash_index, unsigned int label, 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; + } + /*lock transaction replies - will be unlocked when reply is relayed*/ LOCK_REPLIES( t ); if ( is_local(t) ) {