Module: kamailio
Branch: master
Commit: d2459f4a9978e6b42ba99212b77dd856005df0d7
URL:
https://github.com/kamailio/kamailio/commit/d2459f4a9978e6b42ba99212b77dd85…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Xenofon Karamanos <xenakiskaramanos(a)gmail.com>
Date: 2024-02-16T12:20:44+02:00
file_out: Fix fixup functions to handle all string.
---
Modified: src/modules/file_out/file_out.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d2459f4a9978e6b42ba99212b77dd85…
Patch:
https://github.com/kamailio/kamailio/commit/d2459f4a9978e6b42ba99212b77dd85…
---
diff --git a/src/modules/file_out/file_out.c b/src/modules/file_out/file_out.c
index c985c04935a..fde63db5a0b 100644
--- a/src/modules/file_out/file_out.c
+++ b/src/modules/file_out/file_out.c
@@ -54,6 +54,7 @@ static int fo_close_file(const int index);
static int fo_check_interval(int index);
static int fo_fixup_int_pvar(void **param, int param_no);
static int fo_fixup_str_index(void **param, int param_no);
+static int fo_fixup_free_int_pvar(void **param, int param_no);
static int fo_count_assigned_files();
static void fo_log_writer_process(int rank);
static int fo_add_filename(modparam_t type, void *val);
@@ -74,8 +75,9 @@ time_t fo_stored_timestamp[FO_MAX_FILES] = {0};
time_t fo_current_timestamp = 0;
FILE *fo_file_output[FO_MAX_FILES];
-static cmd_export_t cmds[] = {{"file_out", (cmd_function)fo_write_to_file, 2,
- fo_fixup_int_pvar, 0, ANY_ROUTE},
+static cmd_export_t cmds[] = {
+ {"file_out", (cmd_function)fo_write_to_file, 2, fo_fixup_int_pvar,
+ fo_fixup_free_int_pvar, ANY_ROUTE},
{0, 0, 0, 0, 0, 0}};
static param_export_t params[] = {
@@ -266,11 +268,22 @@ static int fo_fixup_int_pvar(void **param, int param_no)
if(param_no == 1) {
return fo_fixup_str_index(param, param_no);
} else if(param_no == 2) {
- return fixup_var_pve_str_12(param, param_no);
+ return fixup_spve_all(param, param_no);
}
return 0;
}
+static int fo_fixup_free_int_pvar(void **param, int param_no)
+{
+ if(param_no == 1) {
+ return fixup_free_igp_null(param, param_no);
+ } else if(param_no == 2) {
+ return fixup_free_spve_all(param, param_no);
+ }
+
+ return 0;
+}
+
static int fo_add_filename(modparam_t type, void *val)
{
str in;