Commit fa7eb2a switched the 2 parameter version of sip_trace from
using the builtin fixup_spve_spve to the custom fixup method to
using the custom fixup_siptrace. As it is a custom fixup method,
the corresponding free method can not be auto-detected causing the
config parser to require the parameters to be a constant. This
patch adds a free method, allowing variables to be once again passed
as the 2nd parameter of this method (as well as fixing a memory leak
for the 3rd parameter).
<!-- 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, ...)
- [ ] 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
- [ ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2588
-- Commit Summary --
* modules/siptrace: fix regression preventing variables to be used
-- File Changes --
M src/modules/siptrace/siptrace.c (18)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2588.patchhttps://github.com/kamailio/kamailio/pull/2588.diff
--
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/pull/2588
Module: kamailio
Branch: master
Commit: 7c98d547996637a7bf1c7025c93142f574fe3ac9
URL: https://github.com/kamailio/kamailio/commit/7c98d547996637a7bf1c7025c93142f…
Author: tsearle <tsearle(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2020-12-16T21:47:11+01:00
modules/siptrace: fix regression preventing variables to be used (#2588)
* modules/siptrace: fix regression preventing variables to be used
Commit fa7eb2a switched the 2 parameter version of sip_trace from
using the builtin fixup_spve_spve to the custom fixup method to
using the custom fixup_siptrace. As it is a custom fixup method,
the corresponding free method can not be auto-detected causing the
config parser to require the parameters to be a constant. This
patch adds a free method, allowing variables to be once again passed
as the 2nd parameter of this method (as well as fixing a memory leak
for the 3rd parameter).
* change free for parameter 3
Co-authored-by: Torrey Searle <tsearle(a)voxbone.com>
---
Modified: src/modules/siptrace/siptrace.c
---
Diff: https://github.com/kamailio/kamailio/commit/7c98d547996637a7bf1c7025c93142f…
Patch: https://github.com/kamailio/kamailio/commit/7c98d547996637a7bf1c7025c93142f…
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 2e8e690ac0..e9c44ec548 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -91,6 +91,7 @@ static int w_sip_trace1(struct sip_msg *, char *dest, char *p2);
static int w_sip_trace2(struct sip_msg *, char *dest, char *correlation_id);
static int w_sip_trace3(struct sip_msg *, char *dest, char *correlation_id, char *trace_type);
static int fixup_siptrace(void **param, int param_no);
+static int fixup_free_siptrace(void **param, int param_no);
static int w_sip_trace_mode(sip_msg_t *msg, char *pmode, char *p2);
static int siptrace_parse_uri(str* duri, dest_info_t* dst);
@@ -203,9 +204,9 @@ static cmd_export_t cmds[] = {
ANY_ROUTE},
{"sip_trace", (cmd_function)w_sip_trace1, 1, fixup_siptrace, 0,
ANY_ROUTE},
- {"sip_trace", (cmd_function)w_sip_trace2, 2, fixup_siptrace, 0,
+ {"sip_trace", (cmd_function)w_sip_trace2, 2, fixup_siptrace, fixup_free_siptrace,
ANY_ROUTE},
- {"sip_trace", (cmd_function)w_sip_trace3, 3, fixup_siptrace, 0,
+ {"sip_trace", (cmd_function)w_sip_trace3, 3, fixup_siptrace, fixup_free_siptrace,
ANY_ROUTE},
{"hlog", (cmd_function)w_hlog1, 1, fixup_spve_null, 0,
ANY_ROUTE},
@@ -785,6 +786,21 @@ static int fixup_siptrace(void **param, int param_no)
return 0;
}
+static int fixup_free_siptrace(void **param, int param_no)
+{
+ if (param_no == 1 || param_no == 2) {
+ /* correlation id */
+ return fixup_free_spve_all(param, param_no);
+ } if (param_no == 3) {
+ /* tracing type; string only */
+ if (*param) {
+ pkg_free(*param);
+ }
+ }
+
+ return 0;
+}
+
/**
*
Functions added:
- set_body
- set_body_multipart
- append_body_part
<!-- 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2586
-- Commit Summary --
* textops: added functions to manipulate the body in the exported api
-- File Changes --
M src/modules/textops/api.c (18)
M src/modules/textops/api.h (6)
M src/modules/textops/textops.c (19)
M src/modules/textops/textops.h (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2586.patchhttps://github.com/kamailio/kamailio/pull/2586.diff
--
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/pull/2586
<!-- 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, ...)
- [ ] 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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] 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
<!-- Describe your changes in detail -->
Evapi: added KEMI function for evapi_async_multicast
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2582
-- Commit Summary --
* evapi: export async_multicast() to kemi
-- File Changes --
M src/modules/evapi/evapi_mod.c (58)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2582.patchhttps://github.com/kamailio/kamailio/pull/2582.diff
--
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/pull/2582