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
January 2021
----- 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
185 discussions
Start a n
N
ew thread
git:master:13d786e3: rtpengine: fixing wrong parsing the pair of IPv6 addr:port (#2592)
by GitHub
Module: kamailio Branch: master Commit: 13d786e33d6f04a718af40ba345cf0827f752c2f URL:
https://github.com/kamailio/kamailio/commit/13d786e33d6f04a718af40ba345cf08…
Author: Dennis <dennis_y(a)mail.ru> Committer: GitHub <noreply(a)github.com> Date: 2021-01-04T10:35:44-05:00 rtpengine: fixing wrong parsing the pair of IPv6 addr:port (#2592) - fixing wrong parsing the pair of IPv6 addr:port in rtpengine module, when loading node information from database. --- Modified: src/modules/rtpengine/rtpengine.c --- Diff:
https://github.com/kamailio/kamailio/commit/13d786e33d6f04a718af40ba345cf08…
Patch:
https://github.com/kamailio/kamailio/commit/13d786e33d6f04a718af40ba345cf08…
--- diff --git a/src/modules/rtpengine/rtpengine.c b/src/modules/rtpengine/rtpengine.c index fb736b2f10..7eb0843793 100644 --- a/src/modules/rtpengine/rtpengine.c +++ b/src/modules/rtpengine/rtpengine.c @@ -1022,7 +1022,14 @@ int add_rtpengine_socks(struct rtpp_set *rtpp_list, char *rtpengine, /* Check the rn_address is 'hostname:port' */ /* Check the rn_address port is valid */ - p1 = strchr(pnode->rn_address, ':'); + if(pnode->rn_umode == 6) { + p1 = strstr(pnode->rn_address, "]:"); + if(p1 != NULL) { + p1++; + } + } else { + p1 = strchr(pnode->rn_address, ':'); + } if (p1 != NULL) { p1++; }
3 years, 10 months
1
0
0
0
git:master:2b0c7213: kemix: exported functions to get env values
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 2b0c7213700c64a762939f9b39111f902eeab9e8 URL:
https://github.com/kamailio/kamailio/commit/2b0c7213700c64a762939f9b39111f9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-01-04T10:35:42+01:00 kemix: exported functions to get env values --- Modified: src/modules/kemix/kemix_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/2b0c7213700c64a762939f9b39111f9…
Patch:
https://github.com/kamailio/kamailio/commit/2b0c7213700c64a762939f9b39111f9…
--- diff --git a/src/modules/kemix/kemix_mod.c b/src/modules/kemix/kemix_mod.c index 269dbd3dee..fc4c6a2a69 100644 --- a/src/modules/kemix/kemix_mod.c +++ b/src/modules/kemix/kemix_mod.c @@ -1093,6 +1093,52 @@ static int ki_kx_get_defn(sip_msg_t *msg, str *dname) return n; } +/** + * + */ +static sr_kemi_xval_t* ki_kx_get_env(sip_msg_t *msg, str *envname) +{ + char *val; + + memset(&_sr_kemi_kx_xval, 0, sizeof(sr_kemi_xval_t)); + if(envname==NULL || envname->s==NULL || envname->len<=0) { + sr_kemi_xval_null(&_sr_kemi_kx_xval, SR_KEMI_XVAL_NULL_EMPTY); + return &_sr_kemi_kx_xval; + } + + val = getenv(envname->s); + if (val == NULL) { + sr_kemi_xval_null(&_sr_kemi_kx_xval, SR_KEMI_XVAL_NULL_EMPTY); + return &_sr_kemi_kx_xval; + } + + _sr_kemi_kx_xval.vtype = SR_KEMIP_STR; + _sr_kemi_kx_xval.v.s.s = val; + _sr_kemi_kx_xval.v.s.len = strlen(val); + return &_sr_kemi_kx_xval; +} + +/** + * + */ +static int ki_kx_get_envn(sip_msg_t *msg, str *envname) +{ + str val; + int r = 0; + + if(envname==NULL || envname->s==NULL || envname->len<=0) { + return 0; + } + + val.s = getenv(envname->s); + if (val.s) { + val.len = strlen(val.s); + str2sint(&val, &r); + return r; + } + + return r; +} /** * @@ -1404,6 +1450,16 @@ static sr_kemi_t sr_kemi_kx_exports[] = { { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("kx"), str_init("get_env"), + SR_KEMIP_XVAL, ki_kx_get_env, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, + { str_init("kx"), str_init("get_envn"), + SR_KEMIP_INT, ki_kx_get_envn, + { SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { {0, 0}, {0, 0}, 0, NULL, { 0, 0, 0, 0, 0, 0 } }
3 years, 10 months
1
0
0
0
git:master:6fc0ccc5: core: added loadmodulex - can evaluate the vars in the parameter
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 6fc0ccc5c2ac2f86f353562f68924c5af16f5994 URL:
https://github.com/kamailio/kamailio/commit/6fc0ccc5c2ac2f86f353562f68924c5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-01-04T10:05:06+01:00 core: added loadmodulex - can evaluate the vars in the parameter - example #!define MYMOD async.so loadmodulex "$def(MYMOD)" --- Modified: src/core/cfg.lex Modified: src/core/cfg.y Modified: src/core/sr_module.c Modified: src/core/sr_module.h --- Diff:
https://github.com/kamailio/kamailio/commit/6fc0ccc5c2ac2f86f353562f68924c5…
Patch:
https://github.com/kamailio/kamailio/commit/6fc0ccc5c2ac2f86f353562f68924c5…
--- diff --git a/src/core/cfg.lex b/src/core/cfg.lex index 01e5218285..67fd519127 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -488,6 +488,7 @@ ONSEND_RT_REPLY "onsend_route_reply" CFG_DESCRIPTION "description"|"descr"|"desc" LOADMODULE loadmodule +LOADMODULEX loadmodulex LOADPATH "loadpath"|"mpath" MODPARAM modparam MODPARAMX modparamx @@ -1002,6 +1003,7 @@ IMPORTFILE "import_file" <INITIAL>{LATENCY_LIMIT_CFG} { count(); yylval.strval=yytext; return LATENCY_LIMIT_CFG;} <INITIAL>{CFG_DESCRIPTION} { count(); yylval.strval=yytext; return CFG_DESCRIPTION; } <INITIAL>{LOADMODULE} { count(); yylval.strval=yytext; return LOADMODULE; } +<INITIAL>{LOADMODULEX} { count(); yylval.strval=yytext; return LOADMODULEX; } <INITIAL>{LOADPATH} { count(); yylval.strval=yytext; return LOADPATH; } <INITIAL>{MODPARAM} { count(); yylval.strval=yytext; return MODPARAM; } <INITIAL>{MODPARAMX} { count(); yylval.strval=yytext; return MODPARAMX; } diff --git a/src/core/cfg.y b/src/core/cfg.y index 2a5804c3dd..cc1b0e13e3 100644 --- a/src/core/cfg.y +++ b/src/core/cfg.y @@ -401,6 +401,7 @@ extern char *default_routename; %token USER_AGENT_HEADER %token REPLY_TO_VIA %token LOADMODULE +%token LOADMODULEX %token LOADPATH %token MODPARAM %token MODPARAMX @@ -1850,6 +1851,13 @@ module_stm: } } | LOADMODULE error { yyerror("string expected"); } + | LOADMODULEX STRING { + LM_DBG("loading module %s\n", $2); + if (load_modulex($2)!=0) { + yyerror("failed to load module"); + } + } + | LOADMODULEX error { yyerror("string expected"); } | LOADPATH STRING { if(mods_dir_cmd==0) { LM_DBG("loading modules under %s\n", $2); diff --git a/src/core/sr_module.c b/src/core/sr_module.c index ba6406ba46..58624ea06e 100644 --- a/src/core/sr_module.c +++ b/src/core/sr_module.c @@ -42,6 +42,7 @@ #include "rpc_lookup.h" #include "sr_compat.h" #include "ppcfg.h" +#include "fmsg.h" #include "async_task.h" #include "shm_init.h" @@ -611,6 +612,29 @@ int load_module(char* mod_path) return -1; } +/** + * + */ +int load_modulex(char* mod_path) +{ + str seval; + str sfmt; + sip_msg_t *fmsg; + char* emod; + + emod = mod_path; + if(strchr(mod_path, '$') != NULL) { + fmsg = faked_msg_get_next(); + sfmt.s = mod_path; + sfmt.len = strlen(sfmt.s); + if(pv_eval_str(fmsg, &seval, &sfmt)>=0) { + emod = seval.s; + } + } + + return load_module(emod); +} + /** * test if command flags are compatible with route block flags (type) * - decide if the command is allowed to run within a specific route block diff --git a/src/core/sr_module.h b/src/core/sr_module.h index 485c732bf7..1d3150b326 100644 --- a/src/core/sr_module.h +++ b/src/core/sr_module.h @@ -330,6 +330,7 @@ extern int mod_response_cbk_no; /**< size of reponse callbacks array */ int register_builtin_modules(void); int load_module(char* path); +int load_modulex(char* path); ksr_cmd_export_t* find_export_record(char* name, int param_no, int flags); cmd_function find_export(char* name, int param_no, int flags); cmd_function find_mod_export(char* mod, char* name, int param_no, int flags);
3 years, 10 months
1
0
0
0
git:master:3dfc7242: core: added $envn(name) - return environment variable as int number
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 3dfc7242e0fdf16555ddf6d3cf06a82014fc4268 URL:
https://github.com/kamailio/kamailio/commit/3dfc7242e0fdf16555ddf6d3cf06a82…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-01-02T16:10:07+01:00 core: added $envn(name) - return environment variable as int number --- Modified: src/core/pv_core.c --- Diff:
https://github.com/kamailio/kamailio/commit/3dfc7242e0fdf16555ddf6d3cf06a82…
Patch:
https://github.com/kamailio/kamailio/commit/3dfc7242e0fdf16555ddf6d3cf06a82…
--- diff --git a/src/core/pv_core.c b/src/core/pv_core.c index 2b3132ccb4..d1274dc3e4 100644 --- a/src/core/pv_core.c +++ b/src/core/pv_core.c @@ -82,6 +82,45 @@ static int pv_get_env(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) return pv_get_null(msg, param, res); } +static int pv_parse_envn_name(pv_spec_p sp, str *in) +{ + char *csname; + + if(in->s==NULL || in->len<=0) + return -1; + + csname = pkg_malloc(in->len + 1); + + if (csname == NULL) { + LM_ERR("no more pkg memory"); + return -1; + } + + memcpy(csname, in->s, in->len); + csname[in->len] = '\0'; + + sp->pvp.pvn.u.dname = (void*)csname; + sp->pvp.pvn.type = PV_NAME_OTHER; + return 0; +} + +static int pv_get_envn(sip_msg_t *msg, pv_param_t *param, pv_value_t *res) +{ + str val; + int r = 0; + char *csname = (char *) param->pvn.u.dname; + + if (csname) { + val.s = getenv(csname); + if (val.s) { + val.len = strlen(val.s); + str2sint(&val, &r); + return pv_get_intstrval(msg, param, res, r, &val); + } + } + return pv_get_null(msg, param, res); +} + static int pv_parse_def_name(pv_spec_p sp, str *in) { if (in == NULL || in->s == NULL || sp == NULL) { @@ -142,6 +181,8 @@ static pv_export_t core_pvs[] = { { STR_STATIC_INIT("retcode"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, { STR_STATIC_INIT("env"), PVT_OTHER, pv_get_env, 0, pv_parse_env_name, 0, 0, 0 }, + { STR_STATIC_INIT("envn"), PVT_OTHER, pv_get_envn, 0, + pv_parse_envn_name, 0, 0, 0 }, { STR_STATIC_INIT("def"), PVT_OTHER, pv_get_def, 0, pv_parse_def_name, 0, 0, 0 }, { STR_STATIC_INIT("defn"), PVT_OTHER, pv_get_defn, 0,
3 years, 10 months
1
0
0
0
git:master:5e91f429: core: use STR_STATIC_INIT() for defining core vars
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 5e91f429ef137625668dd41de9d227a2fcd1461a URL:
https://github.com/kamailio/kamailio/commit/5e91f429ef137625668dd41de9d227a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-01-01T11:58:33+01:00 core: use STR_STATIC_INIT() for defining core vars --- Modified: src/core/pv_core.c --- Diff:
https://github.com/kamailio/kamailio/commit/5e91f429ef137625668dd41de9d227a…
Patch:
https://github.com/kamailio/kamailio/commit/5e91f429ef137625668dd41de9d227a…
--- diff --git a/src/core/pv_core.c b/src/core/pv_core.c index 54fc6e6123..2b3132ccb4 100644 --- a/src/core/pv_core.c +++ b/src/core/pv_core.c @@ -141,11 +141,11 @@ static pv_export_t core_pvs[] = { { STR_STATIC_INIT("rc"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, { STR_STATIC_INIT("retcode"), PVT_OTHER, pv_get_retcode, 0, 0, 0, 0, 0 }, { STR_STATIC_INIT("env"), PVT_OTHER, pv_get_env, 0, - pv_parse_env_name, 0, 0, 0}, - {{"def", (sizeof("def")-1)}, PVT_OTHER, pv_get_def, 0, - pv_parse_def_name, 0, 0, 0}, - {{"defn", (sizeof("defn")-1)}, PVT_OTHER, pv_get_defn, 0, - pv_parse_defn_name, 0, 0, 0}, + pv_parse_env_name, 0, 0, 0 }, + { STR_STATIC_INIT("def"), PVT_OTHER, pv_get_def, 0, + pv_parse_def_name, 0, 0, 0 }, + { STR_STATIC_INIT("defn"), PVT_OTHER, pv_get_defn, 0, + pv_parse_defn_name, 0, 0, 0 }, { {0, 0}, 0, 0, 0, 0, 0, 0, 0 } };
3 years, 10 months
1
0
0
0
← Newer
1
...
16
17
18
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200