Module: kamailio
Branch: master
Commit: 70ecd99e3d8069d0f89444a5b893f61dd1edd1b3
URL: https://github.com/kamailio/kamailio/commit/70ecd99e3d8069d0f89444a5b893f61…
Author: Morten Tryfoss <morten(a)tryfoss.no>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-06T13:29:09+01:00
tm: T_ASYNC_SUSPENDED flag not removed when cancelling a suspension
---
Modified: src/modules/tm/t_suspend.c
---
Diff: https://github.com/kamailio/kamailio/commit/70ecd99e3d8069d0f89444a5b893f61…
Patch: https://github.com/kamailio/kamailio/commit/70ecd99e3d8069d0f89444a5b893f61…
---
diff --git a/src/modules/tm/t_suspend.c b/src/modules/tm/t_suspend.c
index 997d1a5bb78..e0048f0604c 100644
--- a/src/modules/tm/t_suspend.c
+++ b/src/modules/tm/t_suspend.c
@@ -645,6 +645,7 @@ int t_cancel_suspend(unsigned int hash_index, unsigned int label)
/* The transaction does not need to be locked because this
* function is either executed from the original route block
* or from failure route which already locks */
+ t->flags &= ~T_ASYNC_SUSPENDED;
reset_kr(); /* the blind UAC of t_suspend has set kr */
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
I've been testing the ims_charging module which relies on a diameter request and async reply. If there's no available diameter server, Ro_CCR() calls t_cancel_suspend() to cancel suspension of the transaction and return an error.
Based on my understanding, it should now be possible to continue script logic as if the transaction was not suspended at all.
In our case we want the call to go through anyway, as a fallback.
The INVITE is being sent to the destination, but all replies are filtered since the suspended flag is still set.
Tested this change locally, and it's now working according to our needs.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3629
-- Commit Summary --
* tm: T_ASYNC_SUSPENDED flag not removed when cancelling a suspension
-- File Changes --
M src/modules/tm/t_suspend.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3629.patchhttps://github.com/kamailio/kamailio/pull/3629.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3629
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3629(a)github.com>
Module: kamailio
Branch: master
Commit: 4cec039ce1b7fa2d1980f8f30dd7bb1012e3c9cb
URL: https://github.com/kamailio/kamailio/commit/4cec039ce1b7fa2d1980f8f30dd7bb1…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2023-11-05T22:02:26+01:00
modules: readme files regenerated - tm ... [skip ci]
---
Modified: src/modules/tm/README
---
Diff: https://github.com/kamailio/kamailio/commit/4cec039ce1b7fa2d1980f8f30dd7bb1…
Patch: https://github.com/kamailio/kamailio/commit/4cec039ce1b7fa2d1980f8f30dd7bb1…
---
diff --git a/src/modules/tm/README b/src/modules/tm/README
index 216533fbfb6..41dced573d2 100644
--- a/src/modules/tm/README
+++ b/src/modules/tm/README
@@ -2101,6 +2101,9 @@ if (t_newtran()) {
* code - Reply code number.
* reason_phrase - Reason string.
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
+ ONREPLY_ROUTE.
+
Example 1.63. t_reply usage
...
t_reply("404", "Not found");
@@ -2111,7 +2114,8 @@ t_reply("404", "Not found");
Sends a stateful reply based in internal error code, similar to
sl_send_error() from sl module.
- This function can be used from REQUEST_ROUTE.
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
+ ONREPLY_ROUTE.
Example 1.64. t_reply_error usage
...
Module: kamailio
Branch: master
Commit: 9bbf86a8a7e598a67254e2907dcc430af98f5689
URL: https://github.com/kamailio/kamailio/commit/9bbf86a8a7e598a67254e2907dcc430…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-05T21:48:43+01:00
tm: docs updated for t_reply_error()
---
Modified: src/modules/tm/doc/functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/9bbf86a8a7e598a67254e2907dcc430…
Patch: https://github.com/kamailio/kamailio/commit/9bbf86a8a7e598a67254e2907dcc430…
---
diff --git a/src/modules/tm/doc/functions.xml b/src/modules/tm/doc/functions.xml
index 7bcc3a43ccf..539e4f0dafb 100644
--- a/src/modules/tm/doc/functions.xml
+++ b/src/modules/tm/doc/functions.xml
@@ -359,6 +359,9 @@ if (t_newtran()) {
</para>
</listitem>
</itemizedlist>
+ <para>
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE.
+ </para>
<example>
<title><function>t_reply</function> usage</title>
<programlisting>
@@ -378,7 +381,7 @@ t_reply("404", "Not found");
sl_send_error() from sl module.
</para>
<para>
- This function can be used from REQUEST_ROUTE.
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE, ONREPLY_ROUTE.
</para>
<example>
<title><function>t_reply_error</function> usage</title>
Module: kamailio
Branch: master
Commit: cb5295234a1b106473c3fdb9ff25c23bfc9fbcd1
URL: https://github.com/kamailio/kamailio/commit/cb5295234a1b106473c3fdb9ff25c23…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-03T09:06:38+01:00
sl: docs for send_reply_error()
---
Modified: src/modules/sl/doc/sl_functions.xml
---
Diff: https://github.com/kamailio/kamailio/commit/cb5295234a1b106473c3fdb9ff25c23…
Patch: https://github.com/kamailio/kamailio/commit/cb5295234a1b106473c3fdb9ff25c23…
---
diff --git a/src/modules/sl/doc/sl_functions.xml b/src/modules/sl/doc/sl_functions.xml
index 11ef4706755..8f2715b7a00 100644
--- a/src/modules/sl/doc/sl_functions.xml
+++ b/src/modules/sl/doc/sl_functions.xml
@@ -130,7 +130,7 @@ send_reply_mode("403", "Invalid user - $fU", "3");
</title>
<para>
Sends back an error reply describing the nature of the last
- internal error. Usually this function should be used after a
+ internal error. Usually this function should be used after a
script function that returned an error code.
</para>
<example>
@@ -174,6 +174,29 @@ sl_reply_error();
if(status=="408")
sl_forward_reply("404", "Not found");
...
+</programlisting>
+ </example>
+ </section>
+
+ <section id="sl.f.send_reply_error">
+ <title>
+ <function moreinfo="none">send_reply_error()</function>
+ </title>
+ <para>
+ For the current request, the internal error code reply is sent back
+ stateful or stateless, depending of the <acronym>TM</acronym> module:
+ if a transaction exists for the current request, then the reply is sent
+ statefully, otherwise stateless.
+ </para>
+ <para>
+ It can be used from REQUEST_ROUTE, ONREPLY_ROUTE and FAILURE_ROUTE.
+ </para>
+ <example>
+ <title><function>send_reply_error</function> usage</title>
+ <programlisting format="linespecific">
+...
+send_reply_error();
+...
</programlisting>
</example>
</section>