Module: kamailio
Branch: master
Commit: 294a00985b2cf4a397ffc81782f9ce6e4bc1ca15
URL: https://github.com/kamailio/kamailio/commit/294a00985b2cf4a397ffc81782f9ce6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-08-30T10:54:53+02:00
tmx: use t_unset() instead of t_unref() for pv_get_tm_reply_reason()
---
Modified: src/modules/tmx/t_var.c
---
Diff: https://github.com/kamailio/kamailio/commit/294a00985b2cf4a397ffc81782f9ce6…
Patch: https://github.com/kamailio/kamailio/commit/294a00985b2cf4a397ffc81782f9ce6…
---
diff --git a/src/modules/tmx/t_var.c b/src/modules/tmx/t_var.c
index 2fac9605a8..64a81e591b 100644
--- a/src/modules/tmx/t_var.c
+++ b/src/modules/tmx/t_var.c
@@ -587,7 +587,7 @@ int pv_get_tm_reply_reason(struct sip_msg *msg, pv_param_t *param,
/* t_find() above has the side effect of setting T and
REFerencing T => we must unref and unset it for the
main/core onreply_route. */
- _tmx_tmb.t_unref(msg);
+ _tmx_tmb.t_unset();
}
/* no break */
case TM_ONREPLY_ROUTE:
Module: kamailio
Branch: master
Commit: 07877fe6686139032d4d2f85b5f119b2cdf93cf6
URL: https://github.com/kamailio/kamailio/commit/07877fe6686139032d4d2f85b5f119b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-08-30T10:36:53+02:00
tmx: use t_find() for pv_get_tm_reply_reason()
---
Modified: src/modules/tmx/t_var.c
---
Diff: https://github.com/kamailio/kamailio/commit/07877fe6686139032d4d2f85b5f119b…
Patch: https://github.com/kamailio/kamailio/commit/07877fe6686139032d4d2f85b5f119b…
---
diff --git a/src/modules/tmx/t_var.c b/src/modules/tmx/t_var.c
index 3e977c98777..2fac9605a81 100644
--- a/src/modules/tmx/t_var.c
+++ b/src/modules/tmx/t_var.c
@@ -246,7 +246,7 @@ int pv_t_update_inv(struct sip_msg *msg)
return 1;
}
- if (_pv_tinv.label == t->label && _pv_tinv.index == t->hash_index)
+ if (_pv_tinv.label == t->label && _pv_tinv.index == t->hash_index)
goto done;
/* make a copy */
@@ -569,23 +569,26 @@ int pv_get_tm_reply_reason(struct sip_msg *msg, pv_param_t *param,
{
struct cell *t;
struct sip_msg *reply;
- int branch;
+ int branch = -1;
+ int vref = 0;
if(msg==NULL || res==NULL)
return -1;
/* first get the transaction */
- if (_tmx_tmb.t_check( msg , 0 )==-1) return -1;
- if ( (t=_tmx_tmb.t_gett())==0) {
+ t = _tmx_tmb.t_find(msg, &branch, &vref);
+ if (t==T_NULL_CELL || t==T_UNDEFINED) {
/* no T */
return pv_get_strempty(msg, param, res);
} else {
switch (get_route_type()) {
case CORE_ONREPLY_ROUTE:
- /* t_check() above has the side effect of setting T and
- REFerencing T => we must unref and unset it for the
- main/core onreply_route. */
- _tmx_tmb.t_unref(msg);
+ if(vref) {
+ /* t_find() above has the side effect of setting T and
+ REFerencing T => we must unref and unset it for the
+ main/core onreply_route. */
+ _tmx_tmb.t_unref(msg);
+ }
/* no break */
case TM_ONREPLY_ROUTE:
/* use the reason of the current reply */
<!-- 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 -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [ ] 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 -->
- [ ] PR should be backported to stable branches
- [X ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Adjusted comments in kamailio.cfg - no code impact -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3227
-- Commit Summary --
* added rtpengine to comment
-- File Changes --
M etc/kamailio.cfg (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3227.patchhttps://github.com/kamailio/kamailio/pull/3227.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3227
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3227(a)github.com>