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>
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for feature requests.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* http://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
If you submit a feature request (or enhancement) add the description of what you would like to be added.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
Looking for a mechanism to reload Location attributes at runtime.
Having both registered and permanent Contacts under AoR, with Attributes from `usrloc` to be used for various routing decisions.
This is about attributes of permanent Contacts. Registered ones have `xavp_contact` of `usrloc` to store attributes during registration.
**Problem:**
Only way to make it work is:
1. adding a permanent Contact using `rpc ul.add`
2. assigning attributes in DB `location_attr` per RUID (can't find an rpc function for attributes)
3. restart Kamailio
modparam("usrloc", "db_mode", 1)
modparam("usrloc", "db_load", 1)
This however is far from ideal, having to restart Kamailio for every change in attributes of a Contact.
### Expected behavior
#### Actual observed behavior
#### Debugging Data
```
(paste your debugging data here)
```
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your log messages here)
```
#### SIP Traffic
<!--
If the issue is exposed by processing specific SIP messages, grab them with ngrep or save in a pcap file, then add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
(paste your sip traffic here)
```
### Possible Solutions
<!--
If you found a solution or workaround for the issue, describe it. Ideally, provide a pull request with a improvement.
-->
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
version: kamailio 5.3.3 (x86_64/linux) 44ccb9
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `uname -a`)
-->
```
(paste your output here)
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2299