kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
November 2024
----- 2024 -----
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
17 participants
305 discussions
Start a n
N
ew thread
git:master:5484965b: rabbitmq: reformat exported structures
by Victor Seva
Module: kamailio Branch: master Commit: 5484965bb912c96dec57b701af0030b03ccdeb44 URL:
https://github.com/kamailio/kamailio/commit/5484965bb912c96dec57b701af0030b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:37:49+01:00 rabbitmq: reformat exported structures --- Modified: src/modules/rabbitmq/rabbitmq.c --- Diff:
https://github.com/kamailio/kamailio/commit/5484965bb912c96dec57b701af0030b…
Patch:
https://github.com/kamailio/kamailio/commit/5484965bb912c96dec57b701af0030b…
--- diff --git a/src/modules/rabbitmq/rabbitmq.c b/src/modules/rabbitmq/rabbitmq.c index 709055dc9ab..5008625b939 100644 --- a/src/modules/rabbitmq/rabbitmq.c +++ b/src/modules/rabbitmq/rabbitmq.c @@ -127,34 +127,40 @@ static int rbmq_fixup_free_params(void **param, int param_no) return -1; } +/* clang-format off */ /* module commands */ static cmd_export_t cmds[] = { - {"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, fixup_spve_all, - fixup_free_spve_all, ANY_ROUTE}, - {"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5, - rbmq_fixup_params, rbmq_fixup_free_params, REQUEST_ROUTE}, - {0, 0, 0, 0, 0, 0}}; + {"rabbitmq_publish", (cmd_function)rabbitmq_publish, 4, + fixup_spve_all, fixup_free_spve_all, ANY_ROUTE}, + {"rabbitmq_publish_consume", (cmd_function)rabbitmq_publish_consume, 5, + rbmq_fixup_params, rbmq_fixup_free_params, REQUEST_ROUTE}, + {0, 0, 0, 0, 0, 0} +}; /* module parameters */ -static param_export_t params[] = {{"url", PARAM_STRING, &amqp_url}, - {"amqps_ca_file", PARAM_STRING, &rmq_amqps_ca_file}, - {"timeout_sec", PARAM_INT, &timeout_sec}, - {"timeout_usec", PARAM_INT, &timeout_usec}, - {"direct_reply_to", PARAM_INT, &direct_reply_to}, {0, 0, 0}}; +static param_export_t params[] = { + {"url", PARAM_STRING, &amqp_url}, + {"amqps_ca_file", PARAM_STRING, &rmq_amqps_ca_file}, + {"timeout_sec", PARAM_INT, &timeout_sec}, + {"timeout_usec", PARAM_INT, &timeout_usec}, + {"direct_reply_to", PARAM_INT, &direct_reply_to}, + {0, 0, 0} +}; /* module exports */ struct module_exports exports = { - "rabbitmq", /* module name */ - DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /* exported functions */ - params, /* exported parameters */ - 0, /* RPC method exports */ - 0, /* exported pseudo-variables */ - 0, /* response handling function */ - mod_init, /* module initialization function */ - mod_child_init, /* per-child init function */ - 0 /* module destroy function */ + "rabbitmq", /* module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* RPC method exports */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module initialization function */ + mod_child_init, /* per-child init function */ + 0 /* module destroy function */ }; +/* clang-format on */ /* module init */ static int mod_init(void)
2 days, 9 hours
1
0
0
0
git:master:5680e3ac: ratelimit: add fixup_free* to exported functions
by Victor Seva
Module: kamailio Branch: master Commit: 5680e3acb5964952ed0b084f7e946bf28f817d61 URL:
https://github.com/kamailio/kamailio/commit/5680e3acb5964952ed0b084f7e946bf…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:35:38+01:00 ratelimit: add fixup_free* to exported functions --- Modified: src/modules/ratelimit/ratelimit.c --- Diff:
https://github.com/kamailio/kamailio/commit/5680e3acb5964952ed0b084f7e946bf…
Patch:
https://github.com/kamailio/kamailio/commit/5680e3acb5964952ed0b084f7e946bf…
--- diff --git a/src/modules/ratelimit/ratelimit.c b/src/modules/ratelimit/ratelimit.c index 90065b56698..f67d8a6c3fc 100644 --- a/src/modules/ratelimit/ratelimit.c +++ b/src/modules/ratelimit/ratelimit.c @@ -218,7 +218,7 @@ static cmd_export_t cmds[] = { {"rl_check", (cmd_function)w_rl_check_forced, 1, fixup_igp_null, fixup_free_pvar_null, REQUEST_ROUTE | LOCAL_ROUTE}, {"rl_check_pipe", (cmd_function)w_rl_check_forced_pipe, 1, - fixup_igp_null, 0, ANY_ROUTE}, + fixup_igp_null, fixup_free_igp_null, ANY_ROUTE}, {0, 0, 0, 0, 0, 0} };
2 days, 9 hours
1
0
0
0
git:master:0595feb1: ratelimit: reformat exported structures
by Victor Seva
Module: kamailio Branch: master Commit: 0595feb17da5632a24f1e44a992335ff66d0b30e URL:
https://github.com/kamailio/kamailio/commit/0595feb17da5632a24f1e44a992335f…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:34:22+01:00 ratelimit: reformat exported structures --- Modified: src/modules/ratelimit/ratelimit.c --- Diff:
https://github.com/kamailio/kamailio/commit/0595feb17da5632a24f1e44a992335f…
Patch:
https://github.com/kamailio/kamailio/commit/0595feb17da5632a24f1e44a992335f…
--- diff --git a/src/modules/ratelimit/ratelimit.c b/src/modules/ratelimit/ratelimit.c index 0d31d36b6eb..90065b56698 100644 --- a/src/modules/ratelimit/ratelimit.c +++ b/src/modules/ratelimit/ratelimit.c @@ -212,39 +212,42 @@ static int ki_rl_check_pipe(struct sip_msg *msg, int pipe); static int set_load_source(modparam_t, void *); */ static void destroy(void); - +/* clang-format off */ static cmd_export_t cmds[] = { - {"rl_check", (cmd_function)w_rl_check_default, 0, 0, 0, ANY_ROUTE}, - {"rl_check", (cmd_function)w_rl_check_forced, 1, fixup_igp_null, - fixup_free_pvar_null, REQUEST_ROUTE | LOCAL_ROUTE}, - {"rl_check_pipe", (cmd_function)w_rl_check_forced_pipe, 1, - fixup_igp_null, 0, ANY_ROUTE}, - {0, 0, 0, 0, 0, 0}}; + {"rl_check", (cmd_function)w_rl_check_default, 0, 0, 0, ANY_ROUTE}, + {"rl_check", (cmd_function)w_rl_check_forced, 1, + fixup_igp_null, fixup_free_pvar_null, REQUEST_ROUTE | LOCAL_ROUTE}, + {"rl_check_pipe", (cmd_function)w_rl_check_forced_pipe, 1, + fixup_igp_null, 0, ANY_ROUTE}, + {0, 0, 0, 0, 0, 0} +}; + static param_export_t params[] = { - {"timer_interval", PARAM_INT, &timer_interval}, - {"queue", PARAM_STRING | PARAM_USE_FUNC, (void *)add_queue_params}, - {"pipe", PARAM_STRING | PARAM_USE_FUNC, (void *)add_pipe_params}, - /* RESERVED for future use + {"timer_interval", PARAM_INT, &timer_interval}, + {"queue", PARAM_STRING | PARAM_USE_FUNC, (void *)add_queue_params}, + {"pipe", PARAM_STRING | PARAM_USE_FUNC, (void *)add_pipe_params}, + /* RESERVED for future use {"load_source", PARAM_STRING|PARAM_USE_FUNC, (void *)set_load_source}, */ - {0, 0, 0}}; + {0, 0, 0} +}; static rpc_export_t rpc_methods[]; /** module exports */ struct module_exports exports = { - "ratelimit", /* module name */ - DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /* cmd (cfg function) exports */ - params, /* param exports */ - 0, /* exported RPC functions */ - 0, /* exported pseudo-variables */ - 0, /* response handling function */ - mod_init, /* module initialization function */ - 0, /* per-child init function */ - destroy /* module exit function */ + "ratelimit", /* module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* RPC method exports */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module initialization function */ + 0, /* per-child init function */ + destroy /* module destroy function */ }; - +/* clang-format on */ /** * converts a mapped str to an int
2 days, 9 hours
1
0
0
0
git:master:5bebde17: regex: add fixup_free* to exported functions
by Victor Seva
Module: kamailio Branch: master Commit: 5bebde177c357e2aaf5f24537d0d44da51ac914a URL:
https://github.com/kamailio/kamailio/commit/5bebde177c357e2aaf5f24537d0d44d…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:29:00+01:00 regex: add fixup_free* to exported functions --- Modified: src/modules/regex/regex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/5bebde177c357e2aaf5f24537d0d44d…
Patch:
https://github.com/kamailio/kamailio/commit/5bebde177c357e2aaf5f24537d0d44d…
--- diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c index 11c055c1d10..4c378bb28f0 100644 --- a/src/modules/regex/regex_mod.c +++ b/src/modules/regex/regex_mod.c @@ -116,13 +116,13 @@ static int w_pcre_match_group(struct sip_msg *_msg, char *_s1, char *_s2); /* clang-format off */ static cmd_export_t cmds[] = { {"pcre_match", (cmd_function)w_pcre_match, 2, - fixup_spve_spve, 0, + fixup_spve_spve, fixup_free_spve_spve, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {"pcre_match_group", (cmd_function)w_pcre_match_group, 2, - fixup_spve_spve, 0, + fixup_spve_spve, fixup_free_spve_spve, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {"pcre_match_group", (cmd_function)w_pcre_match_group, 1, - fixup_spve_null, 0, + fixup_spve_null, fixup_free_spve_null, REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {0, 0, 0, 0, 0, 0} };
2 days, 9 hours
1
0
0
0
git:master:71197e76: regex: reformat exported structures
by Victor Seva
Module: kamailio Branch: master Commit: 71197e76e02818d8e7e016cefbda3886bec9afb1 URL:
https://github.com/kamailio/kamailio/commit/71197e76e02818d8e7e016cefbda388…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:28:11+01:00 regex: reformat exported structures --- Modified: src/modules/regex/regex_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/71197e76e02818d8e7e016cefbda388…
Patch:
https://github.com/kamailio/kamailio/commit/71197e76e02818d8e7e016cefbda388…
--- diff --git a/src/modules/regex/regex_mod.c b/src/modules/regex/regex_mod.c index 904342ff7fc..11c055c1d10 100644 --- a/src/modules/regex/regex_mod.c +++ b/src/modules/regex/regex_mod.c @@ -115,21 +115,18 @@ static int w_pcre_match_group(struct sip_msg *_msg, char *_s1, char *_s2); */ /* clang-format off */ static cmd_export_t cmds[] = { - {"pcre_match", (cmd_function)w_pcre_match, 2, fixup_spve_spve, 0, - REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE - | LOCAL_ROUTE}, + {"pcre_match", (cmd_function)w_pcre_match, 2, + fixup_spve_spve, 0, + REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {"pcre_match_group", (cmd_function)w_pcre_match_group, 2, - fixup_spve_spve, 0, - REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE - | LOCAL_ROUTE}, + fixup_spve_spve, 0, + REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {"pcre_match_group", (cmd_function)w_pcre_match_group, 1, - fixup_spve_null, 0, - REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE - | LOCAL_ROUTE}, + fixup_spve_null, 0, + REQUEST_ROUTE | FAILURE_ROUTE | ONREPLY_ROUTE | BRANCH_ROUTE | LOCAL_ROUTE}, {0, 0, 0, 0, 0, 0} }; - /* * Exported parameters */ @@ -144,21 +141,20 @@ static param_export_t params[] = { {0, 0, 0} }; - /* * Module interface */ struct module_exports exports = { - "regex", /*!< module name */ - DEFAULT_DLFLAGS, /*!< dlopen flags */ - cmds, /*!< exported functions */ - params, /*!< exported parameters */ - 0, /*!< exported RPC functions */ - 0, /*!< exported pseudo-variables */ - 0, /*!< response handling function */ - mod_init, /*!< module initialization function */ - 0, /*!< per-child init function */ - destroy /*!< destroy function */ + "regex", /*!< module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* exported functions */ + params, /* exported parameters */ + 0, /* RPC method exports */ + 0, /* exported pseudo-variables */ + 0, /* response handling function */ + mod_init, /* module initialization function */ + 0, /* per-child init function */ + destroy /* module destroy function */ }; /* clang-format on */
2 days, 9 hours
1
0
0
0
git:master:a0f09749: registrar: reformat exported structures
by Victor Seva
Module: kamailio Branch: master Commit: a0f09749f7607b764523004663e0dd8f23675c22 URL:
https://github.com/kamailio/kamailio/commit/a0f09749f7607b764523004663e0dd8…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:25:45+01:00 registrar: reformat exported structures --- Modified: src/modules/registrar/registrar.c --- Diff:
https://github.com/kamailio/kamailio/commit/a0f09749f7607b764523004663e0dd8…
Patch:
https://github.com/kamailio/kamailio/commit/a0f09749f7607b764523004663e0dd8…
2 days, 9 hours
1
0
0
0
git:master:7f3207cc: rls: add fixup_free* to exported functions
by Victor Seva
Module: kamailio Branch: master Commit: 7f3207ccd2757fbdbed53bab5841808c4fc5c1cf URL:
https://github.com/kamailio/kamailio/commit/7f3207ccd2757fbdbed53bab5841808…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:09:35+01:00 rls: add fixup_free* to exported functions --- Modified: src/modules/rls/rls.c Modified: src/modules/rls/subscribe.c --- Diff:
https://github.com/kamailio/kamailio/commit/7f3207ccd2757fbdbed53bab5841808…
Patch:
https://github.com/kamailio/kamailio/commit/7f3207ccd2757fbdbed53bab5841808…
--- diff --git a/src/modules/rls/rls.c b/src/modules/rls/rls.c index c11d3da3476..4a4457dfc7e 100644 --- a/src/modules/rls/rls.c +++ b/src/modules/rls/rls.c @@ -209,15 +209,16 @@ void rlsubs_table_update(unsigned int ticks, void *param); int add_rls_event(modparam_t type, void *val); int rls_update_subs(struct sip_msg *msg, char *puri, char *pevent); int fixup_update_subs(void **param, int param_no); +int fixup_free_update_subs(void **param, int param_no); /* clang-format off */ static cmd_export_t cmds[] = { {"rls_handle_subscribe", (cmd_function)w_rls_handle_subscribe0, 0, 0, 0, REQUEST_ROUTE}, {"rls_handle_subscribe", (cmd_function)w_rls_handle_subscribe1, 1, - fixup_spve_null, 0, REQUEST_ROUTE}, + fixup_spve_null, fixup_free_spve_null, REQUEST_ROUTE}, {"rls_handle_notify", (cmd_function)w_rls_handle_notify, 0, 0, 0, REQUEST_ROUTE}, {"rls_update_subs", (cmd_function)w_rls_update_subs, 2, - fixup_update_subs, 0, ANY_ROUTE}, + fixup_update_subs, fixup_free_update_subs, ANY_ROUTE}, {"bind_rls", (cmd_function)bind_rls, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0} }; diff --git a/src/modules/rls/subscribe.c b/src/modules/rls/subscribe.c index b1d2b9a6582..f96238dbc1c 100644 --- a/src/modules/rls/subscribe.c +++ b/src/modules/rls/subscribe.c @@ -1051,6 +1051,16 @@ int fixup_update_subs(void **param, int param_no) return 0; } +int fixup_free_update_subs(void **param, int param_no) +{ + if(param_no == 1) { + return fixup_free_spve_null(param, 1); + } else if(param_no == 2) { + return fixup_free_spve_null(param, 1); + } + return 0; +} + void update_a_sub(subs_t *subs_copy) { xmlDocPtr doc = NULL;
2 days, 9 hours
1
0
0
0
git:master:e56f003a: rls: reformat exported structures
by Victor Seva
Module: kamailio Branch: master Commit: e56f003abaa1f8589193ac1826992929aea6f0b2 URL:
https://github.com/kamailio/kamailio/commit/e56f003abaa1f8589193ac182699292…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2024-11-22T15:09:29+01:00 rls: reformat exported structures --- Modified: src/modules/rls/rls.c --- Diff:
https://github.com/kamailio/kamailio/commit/e56f003abaa1f8589193ac182699292…
Patch:
https://github.com/kamailio/kamailio/commit/e56f003abaa1f8589193ac182699292…
2 days, 9 hours
1
0
0
0
git:master:5b852254: core: framework to execute async event route with type-key-value
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 5b852254e75365c2886baf1e4be8829ac10b9917 URL:
https://github.com/kamailio/kamailio/commit/5b852254e75365c2886baf1e4be8829…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2024-11-22T13:28:20+01:00 core: framework to execute async event route with type-key-value - execute event_route[core:tkv] in async fashion, with data passed in the form of [type, key, value] - the events have to be emitted from parts of the code and the execution of the event route should not block the emitting process --- Modified: src/core/async_task.c Modified: src/core/async_task.h --- Diff:
https://github.com/kamailio/kamailio/commit/5b852254e75365c2886baf1e4be8829…
Patch:
https://github.com/kamailio/kamailio/commit/5b852254e75365c2886baf1e4be8829…
--- diff --git a/src/core/async_task.c b/src/core/async_task.c index bce7ed51faa..17c385a51fd 100644 --- a/src/core/async_task.c +++ b/src/core/async_task.c @@ -34,11 +34,15 @@ #include <arpa/inet.h> #include <fcntl.h> #include <errno.h> +#include <stdarg.h> #include "dprint.h" #include "sr_module.h" #include "ut.h" #include "pt.h" +#include "kemi.h" +#include "fmsg.h" +#include "receive.h" #include "cfg/cfg_struct.h" #include "parser/parse_param.h" @@ -525,3 +529,126 @@ int async_task_run(async_wgroup_t *awg, int idx) return 0; } + + +/** + * + */ +static async_wgroup_t *_async_tkv_awg = NULL; +static async_tkv_param_t *_ksr_async_tkv_param = NULL; +static int _ksr_async_tkv_ridx = -1; + +/** + * + */ +void async_tkv_init(void) +{ + str gname = str_init("tkv"); + str evname = str_init("core:tkv"); + + _async_tkv_awg = async_task_group_find(&gname); + + _ksr_async_tkv_ridx = route_lookup(&event_rt, evname.s); + if(_ksr_async_tkv_ridx <= 0 + || event_rt.rlist[_ksr_async_tkv_ridx] == NULL) { + LM_DBG("event_route[%s] not defined - skipping\n", evname.s); + _ksr_async_tkv_ridx = -2; + return; + } +} + +/** + * + */ +void async_exec_tkv(void *param) +{ + async_tkv_param_t *adp; + sr_kemi_eng_t *keng = NULL; + sip_msg_t *fmsg = NULL; + str evname = str_init("core:tkv"); + str cbname = str_init("ksr_core_tkv"); + int rtype = 0; + + adp = (async_tkv_param_t *)param; + fmsg = faked_msg_next(); + rtype = get_route_type(); + _ksr_async_tkv_param = adp; + set_route_type(REQUEST_ROUTE); + keng = sr_kemi_eng_get(); + if(keng != NULL) { + if(sr_kemi_route(keng, fmsg, EVENT_ROUTE, &cbname, &evname) < 0) { + LM_ERR("error running event route kemi callback [%.*s]\n", + cbname.len, cbname.s); + } + } else { + if(_ksr_async_tkv_ridx >= 0) { + run_top_route(event_rt.rlist[_ksr_async_tkv_ridx], fmsg, 0); + } + } + ksr_msg_env_reset(); + set_route_type(rtype); + _ksr_async_tkv_param = NULL; + /* param is freed along with the async task strucutre in core */ +} + +/** + * + */ +int async_tkv_emit(int dtype, char *pkey, char *fmt, ...) +{ + async_task_t *at = NULL; + int dsize = 0; + async_tkv_param_t *adp; + va_list va; + char buf[KSR_ASYNC_TKV_SIZE]; + int n = 0; + int klen = 0; + sr_kemi_eng_t *keng = NULL; + + if(_async_tkv_awg == NULL) { + LM_DBG("the async group has not been set\n"); + return -1; + } + keng = sr_kemi_eng_get(); + if(keng == NULL && _ksr_async_tkv_ridx == -2) { + LM_DBG("the event_route[core:tkv] has not been defined\n"); + return -1; + } + + va_start(va, fmt); + n = vsnprintf(buf, KSR_ASYNC_TKV_SIZE, fmt, va); + va_end(va); + + if(n < 0 || n > KSR_ASYNC_TKV_SIZE) { + LM_ERR("failed to print the arguments for key: %s\n", pkey); + return -1; + } + + klen = strlen(pkey); + dsize = sizeof(async_task_t) + sizeof(async_tkv_param_t) + klen + 1 + n + 1; + at = (async_task_t *)shm_malloc(dsize); + if(at == NULL) { + SHM_MEM_ERROR; + return -1; + } + memset(at, 0, dsize); + at->exec = async_exec_tkv; + at->param = (char *)at + sizeof(async_task_t); + adp = (async_tkv_param_t *)at->param; + adp->dtype = dtype; + adp->skey.s = (char *)adp + sizeof(async_tkv_param_t); + adp->skey.len = klen; + memcpy(adp->skey.s, pkey, klen); + adp->skey.len = klen; + adp->sval.s = (char *)adp->skey.s + klen + 1; + memcpy(adp->sval.s, buf, n); + adp->sval.len = n; + + if(async_task_group_send(_async_tkv_awg, at) < 0) { + LM_ERR("failed to send task with key: %s\n", pkey); + shm_free(at); + return -1; + } + + return 0; +} diff --git a/src/core/async_task.h b/src/core/async_task.h index 58386bba8bd..b4276c2d27c 100644 --- a/src/core/async_task.h +++ b/src/core/async_task.h @@ -58,4 +58,15 @@ async_wgroup_t *async_task_group_find(str *gname); int async_task_group_push(str *gname, async_task_t *task); int async_task_group_send(async_wgroup_t *awg, async_task_t *task); +typedef struct async_tkv_param +{ + int dtype; + str skey; + str sval; +} async_tkv_param_t; + +#define KSR_ASYNC_TKV_SIZE 512 +void async_tkv_init(void); +int async_tkv_emit(int dtype, char *pkey, char *fmt, ...); + #endif
2 days, 11 hours
1
0
0
0
git:master:ecb99f2f: jwt: add fixup_free* to exported functions
by Federico Cabiddu
Module: kamailio Branch: master Commit: ecb99f2ff1babe3871af5fba7d7f94e8b0df68cd URL:
https://github.com/kamailio/kamailio/commit/ecb99f2ff1babe3871af5fba7d7f94e…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com> Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com> Date: 2024-11-22T12:37:09+01:00 jwt: add fixup_free* to exported functions --- Modified: src/modules/jwt/jwt_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/ecb99f2ff1babe3871af5fba7d7f94e…
Patch:
https://github.com/kamailio/kamailio/commit/ecb99f2ff1babe3871af5fba7d7f94e…
--- diff --git a/src/modules/jwt/jwt_mod.c b/src/modules/jwt/jwt_mod.c index 90d8fa5bd03..64c78e63555 100644 --- a/src/modules/jwt/jwt_mod.c +++ b/src/modules/jwt/jwt_mod.c @@ -65,39 +65,45 @@ typedef struct jwt_fcache static jwt_fcache_t *_jwt_fcache_list = NULL; -static cmd_export_t cmds[] = {{"jwt_generate", (cmd_function)w_jwt_generate_4, - 4, fixup_spve_all, 0, ANY_ROUTE}, - {"jwt_generate", (cmd_function)w_jwt_generate_3, 3, fixup_spve_all, 0, - ANY_ROUTE}, - {"jwt_verify", (cmd_function)w_jwt_verify, 4, fixup_spve_all, 0, - ANY_ROUTE}, - {"jwt_verify_key", (cmd_function)w_jwt_verify_key, 4, fixup_spve_all, 0, - ANY_ROUTE}, - {0, 0, 0, 0, 0, 0}}; - -static param_export_t params[] = {{"key_mode", PARAM_INT, &_jwt_key_mode}, +/* clang-format off */ +static cmd_export_t cmds[] = { + {"jwt_generate", (cmd_function)w_jwt_generate_4, 4, fixup_spve_all, fixup_free_spve_all, + ANY_ROUTE}, + {"jwt_generate", (cmd_function)w_jwt_generate_3, 3, fixup_spve_all, fixup_free_spve_all, + ANY_ROUTE}, + {"jwt_verify", (cmd_function)w_jwt_verify, 4, fixup_spve_all, fixup_free_spve_all, + ANY_ROUTE}, + {"jwt_verify_key", (cmd_function)w_jwt_verify_key, 4, fixup_spve_all, fixup_free_spve_all, + ANY_ROUTE}, + {0, 0, 0, 0, 0, 0} +}; - {0, 0, 0}}; +static param_export_t params[] = { + {"key_mode", PARAM_INT, &_jwt_key_mode}, + {0, 0, 0} +}; static int jwt_pv_get(sip_msg_t *msg, pv_param_t *param, pv_value_t *res); static int jwt_pv_parse_name(pv_spec_t *sp, str *in); static pv_export_t mod_pvs[] = { - {{"jwt", sizeof("jwt") - 1}, PVT_OTHER, jwt_pv_get, 0, - jwt_pv_parse_name, 0, 0, 0}, - {{0, 0}, 0, 0, 0, 0, 0, 0, 0}}; + {{"jwt", sizeof("jwt") - 1}, PVT_OTHER, jwt_pv_get, 0, + jwt_pv_parse_name, 0, 0, 0}, + {{0, 0}, 0, 0, 0, 0, 0, 0, 0} +}; struct module_exports exports = { - "jwt", /* module name */ - DEFAULT_DLFLAGS, /* dlopen flags */ - cmds, /* cmd (cfg function) exports */ - params, /* param exports */ - 0, /* RPC method exports */ - mod_pvs, /* pseudo-variables exports */ - 0, /* response handling function */ - mod_init, /* module init function */ - child_init, /* per-child init function */ - mod_destroy /* module destroy function */ + "jwt", /* module name */ + DEFAULT_DLFLAGS, /* dlopen flags */ + cmds, /* cmd (cfg function) exports */ + params, /* param exports */ + 0, /* RPC method exports */ + mod_pvs, /* pseudo-variables exports */ + 0, /* response handling function */ + mod_init, /* module init function */ + child_init, /* per-child init function */ + mod_destroy /* module destroy function */ }; +/* clang-format on */ /**
2 days, 12 hours
1
0
0
0
← Newer
1
2
3
4
5
...
31
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Results per page:
10
25
50
100
200