Module: kamailio
Branch: master
Commit: 790bf50f5ec5a08f6fa0d1bd3c2732fb1317cdd0
URL:
https://github.com/kamailio/kamailio/commit/790bf50f5ec5a08f6fa0d1bd3c2732f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-11-21T19:43:58+01:00
slack: add fixup_free* to exported functions
---
Modified: src/modules/slack/slack.c
Modified: src/modules/slack/slack.h
---
Diff:
https://github.com/kamailio/kamailio/commit/790bf50f5ec5a08f6fa0d1bd3c2732f…
Patch:
https://github.com/kamailio/kamailio/commit/790bf50f5ec5a08f6fa0d1bd3c2732f…
---
diff --git a/src/modules/slack/slack.c b/src/modules/slack/slack.c
index 1ffcfbc1572..3835c13deff 100644
--- a/src/modules/slack/slack.c
+++ b/src/modules/slack/slack.c
@@ -41,7 +41,7 @@ static char *slack_icon = SLACK_DEFAULT_ICON;
* Exported functions
*/
static cmd_export_t cmds[] = {
- {"slack_send", (cmd_function)slack_send1, 1, slack_fixup, 0, ANY_ROUTE},
+ {"slack_send", (cmd_function)slack_send1, 1, slack_fixup, slack_fixup_free,
ANY_ROUTE},
{0, 0, 0, 0, 0, 0}
};
@@ -241,6 +241,20 @@ static int slack_fixup(void **param, int param_no)
return slack_fixup_helper(param, param_no);
}
+static int slack_fixup_free(void **param, int param_no)
+{
+ sl_msg_t *sm;
+ if(param_no != 1 || param == NULL || *param == NULL) {
+ LM_ERR("invalid parameter number %d\n", param_no);
+ return E_UNSPEC;
+ }
+
+ sm = *param;
+ pv_elem_free_all(sm->m);
+ pkg_free(sm);
+ return 0;
+}
+
/**
* send text message to slack
*/
diff --git a/src/modules/slack/slack.h b/src/modules/slack/slack.h
index 8537cf07772..e4f02fd5fc9 100644
--- a/src/modules/slack/slack.h
+++ b/src/modules/slack/slack.h
@@ -55,6 +55,7 @@ static int _slack_parse_url_param(char *val);
static int _slack_url_param(modparam_t type, void *val);
static int slack_fixup(void **param, int param_no);
+static int slack_fixup_free(void **param, int param_no);
static int slack_send1(struct sip_msg *msg, char *frm, char *str2);
static int slack_fixup_helper(void **param, int param_no);