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
December
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
May 2016
----- 2024 -----
December 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
28 participants
348 discussions
Start a n
N
ew thread
git:master:4463258d: async: fixed list format for dependencies in docs
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 4463258d5bb8cb1460f51791d2c3a367ec68e5fb URL:
https://github.com/kamailio/kamailio/commit/4463258d5bb8cb1460f51791d2c3a36…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:10:35+02:00 async: fixed list format for dependencies in docs --- Modified: modules/async/README Modified: modules/async/doc/async.xml Modified: modules/async/doc/async_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/4463258d5bb8cb1460f51791d2c3a36…
Patch:
https://github.com/kamailio/kamailio/commit/4463258d5bb8cb1460f51791d2c3a36…
--- diff --git a/modules/async/README b/modules/async/README index ce4daf3..eb12ead 100644 --- a/modules/async/README +++ b/modules/async/README @@ -83,7 +83,7 @@ Chapter 1. Admin Guide The following modules must be loaded before this module: * tm - transaction management. - tmx - transaction management extensions. + * tmx - transaction management extensions. 2.2. External Libraries or Applications diff --git a/modules/async/doc/async.xml b/modules/async/doc/async.xml index a722fb0..e6fea0d 100644 --- a/modules/async/doc/async.xml +++ b/modules/async/doc/async.xml @@ -8,7 +8,7 @@ ]> -<book xmlns:xi="
http://www.w3.org/2001/XInclude
"> +<book> <bookinfo> <title>ASYNC Module</title> <productname class="trade">
sip-router.org
</productname> @@ -30,8 +30,7 @@ </copyright> </bookinfo> <toc></toc> - - <xi:include href="async_admin.xml"/> - - + + <xi:include xmlns:xi="
http://www.w3.org/2001/XInclude
" href="async_admin.xml"/> + </book> diff --git a/modules/async/doc/async_admin.xml b/modules/async/doc/async_admin.xml index 31ad797..c6d33e2 100644 --- a/modules/async/doc/async_admin.xml +++ b/modules/async/doc/async_admin.xml @@ -42,6 +42,8 @@ <para> <emphasis>tm</emphasis> - transaction management. </para> + </listitem> + <listitem> <para> <emphasis>tmx</emphasis> - transaction management extensions. </para>
8 years, 7 months
1
0
0
0
git:master:0d33ab80: pv: use core helper function inside pv_evalx()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 0d33ab80491a57799c0664c531ee6e534c9e938c URL:
https://github.com/kamailio/kamailio/commit/0d33ab80491a57799c0664c531ee6e5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:36+02:00 pv: use core helper function inside pv_evalx() --- Modified: modules/pv/pv.c --- Diff:
https://github.com/kamailio/kamailio/commit/0d33ab80491a57799c0664c531ee6e5…
Patch:
https://github.com/kamailio/kamailio/commit/0d33ab80491a57799c0664c531ee6e5…
--- diff --git a/modules/pv/pv.c b/modules/pv/pv.c index 4862a7d..1aa53ed 100644 --- a/modules/pv/pv.c +++ b/modules/pv/pv.c @@ -835,7 +835,6 @@ int w_pv_evalx(struct sip_msg *msg, char *dst, str *fmt) { pv_spec_t *ispec=NULL; pv_elem_t *imodel=NULL; - pv_elem_t *xmodel=NULL; str tstr = {0, 0}; pv_value_t val; @@ -850,24 +849,16 @@ int w_pv_evalx(struct sip_msg *msg, char *dst, str *fmt) goto error; } - if(pv_parse_format(&tstr, &xmodel)<0) { - LM_ERR("error in parsing evaluated second parameter\n"); - return -1; - } - - if(pv_printf_s(msg, xmodel, &val.rs)!=0) { + if(pv_eval_str(msg, &val.rs, &tstr)<0){ LM_ERR("cannot eval reparsed value of second parameter\n"); - pv_elem_free_all(xmodel); - goto error; + return -1; } val.flags = PV_VAL_STR; if(ispec->setf(msg, &ispec->pvp, EQ_T, &val)<0) { LM_ERR("setting PV failed\n"); - pv_elem_free_all(xmodel); goto error; } - pv_elem_free_all(xmodel); return 1; error:
8 years, 7 months
1
0
0
0
git:master:fe0e9842: core: pv - helper function to evaluate a dynamic string
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: fe0e98427b703d9ca41d626b24d99fc5a1c1f9d0 URL:
https://github.com/kamailio/kamailio/commit/fe0e98427b703d9ca41d626b24d99fc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:36+02:00 core: pv - helper function to evaluate a dynamic string --- Modified: pv_core.c Modified: pvar.h --- Diff:
https://github.com/kamailio/kamailio/commit/fe0e98427b703d9ca41d626b24d99fc…
Patch:
https://github.com/kamailio/kamailio/commit/fe0e98427b703d9ca41d626b24d99fc…
--- diff --git a/pv_core.c b/pv_core.c index 3d49552..3279a0a 100644 --- a/pv_core.c +++ b/pv_core.c @@ -53,7 +53,8 @@ static int pv_get_retcode(struct sip_msg* msg, pv_param_t* p, pv_value_t* res) -/** register built-in core pvars. +/** + * register built-in core pvars. * should be called before parsing the config script. * @return 0 on success */ @@ -62,4 +63,32 @@ int pv_register_core_vars(void) return register_pvars_mod("core", core_pvs); } +/** + * + */ +int pv_eval_str(sip_msg_t *msg, str *dst, str *src) +{ + pv_elem_t *xmodel=NULL; + str sval = STR_NULL; + + if(pv_parse_format(src, &xmodel)<0) { + LM_ERR("error in parsing src parameter\n"); + return -1; + } + + if(pv_printf_s(msg, xmodel, &sval)!=0) { + LM_ERR("cannot eval parsed parameter\n"); + pv_elem_free_all(xmodel); + goto error; + } + + dst->s = sval.s; + dst->len = sval.len; + pv_elem_free_all(xmodel); + + return 1; +error: + return -1; +} + /* vi: set ts=4 sw=4 tw=79:ai:cindent: */ diff --git a/pvar.h b/pvar.h index 6ad3d8c..68955ad 100644 --- a/pvar.h +++ b/pvar.h @@ -300,5 +300,7 @@ typedef struct _pv_xavp_name { struct _pv_xavp_name *next; } pv_xavp_name_t; +int pv_eval_str(sip_msg_t *msg, str *dst, str *src); + #endif
8 years, 7 months
1
0
0
0
git:master:4ffe8b0f: core: pv - coherent indentation and whitespacing
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 4ffe8b0f917ec49b3f68afa99d65e384fb011283 URL:
https://github.com/kamailio/kamailio/commit/4ffe8b0f917ec49b3f68afa99d65e38…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:36+02:00 core: pv - coherent indentation and whitespacing --- Modified: pv_core.c Modified: pv_core.h Modified: pvapi.c Modified: pvar.h --- Diff:
https://github.com/kamailio/kamailio/commit/4ffe8b0f917ec49b3f68afa99d65e38…
Patch:
https://github.com/kamailio/kamailio/commit/4ffe8b0f917ec49b3f68afa99d65e38…
8 years, 7 months
1
0
0
0
git:master:6e0062eb: sipcapture: removed unused variable to fix complier warning
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 6e0062eb2ed99112ddd267dde07618157737c923 URL:
https://github.com/kamailio/kamailio/commit/6e0062eb2ed99112ddd267dde076181…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:35+02:00 sipcapture: removed unused variable to fix complier warning --- Modified: modules/sipcapture/sipcapture.c --- Diff:
https://github.com/kamailio/kamailio/commit/6e0062eb2ed99112ddd267dde076181…
Patch:
https://github.com/kamailio/kamailio/commit/6e0062eb2ed99112ddd267dde076181…
--- diff --git a/modules/sipcapture/sipcapture.c b/modules/sipcapture/sipcapture.c index 3b0a021..8a3fb7b 100644 --- a/modules/sipcapture/sipcapture.c +++ b/modules/sipcapture/sipcapture.c @@ -1556,7 +1556,6 @@ static int sip_capture(struct sip_msg *msg, str *_table, _capture_mode_data_t * struct timeval tvb; struct timezone tz; char tmp_node[100]; - unsigned int len = 0; LM_DBG("CAPTURE DEBUG...\n");
8 years, 7 months
1
0
0
0
git:master:0135d9a3: core: kemi - added identifier for int-str type
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 0135d9a38a78c20090a92e947c2acc57c05b57fd URL:
https://github.com/kamailio/kamailio/commit/0135d9a38a78c20090a92e947c2acc5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:35+02:00 core: kemi - added identifier for int-str type - useful for dumping attributes for special kemi functions --- Modified: kemi.c Modified: kemi.h --- Diff:
https://github.com/kamailio/kamailio/commit/0135d9a38a78c20090a92e947c2acc5…
Patch:
https://github.com/kamailio/kamailio/commit/0135d9a38a78c20090a92e947c2acc5…
--- diff --git a/kemi.c b/kemi.c index d32843f..5052885 100644 --- a/kemi.c +++ b/kemi.c @@ -1027,10 +1027,11 @@ typedef struct sr_kemi_param_map { * */ static sr_kemi_param_map_t _sr_kemi_param_map[] = { - { SR_KEMIP_NONE, str_init("none") }, - { SR_KEMIP_INT, str_init("int") }, - { SR_KEMIP_STR, str_init("str") }, - { SR_KEMIP_BOOL, str_init("bool") }, + { SR_KEMIP_NONE, str_init("none") }, + { SR_KEMIP_INT, str_init("int") }, + { SR_KEMIP_STR, str_init("str") }, + { SR_KEMIP_BOOL, str_init("bool") }, + { SR_KEMIP_INTSTR, str_init("int-str") }, { 0, STR_NULL } }; diff --git a/kemi.h b/kemi.h index 0671518..f98448e 100644 --- a/kemi.h +++ b/kemi.h @@ -30,6 +30,7 @@ #define SR_KEMIP_INT (1<<0) /* type integer */ #define SR_KEMIP_STR (1<<1) /* type str* */ #define SR_KEMIP_BOOL (1<<2) /* type boolean (0/1) */ +#define SR_KEMIP_INTSTR (1<<3) /* type integer or str* */ #define SR_KEMI_FALSE 0 #define SR_KEMI_TRUE 1
8 years, 7 months
1
0
0
0
git:master:7cc31c59: app_lua: rpc command to get the list of available kemi functions
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 7cc31c591436c11cc60b25d932d2c53fdf74843b URL:
https://github.com/kamailio/kamailio/commit/7cc31c591436c11cc60b25d932d2c53…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:35+02:00 app_lua: rpc command to get the list of available kemi functions - those exported by module directly are not listed yet (the pv and x modules) --- Modified: modules/app_lua/app_lua_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/7cc31c591436c11cc60b25d932d2c53…
Patch:
https://github.com/kamailio/kamailio/commit/7cc31c591436c11cc60b25d932d2c53…
--- diff --git a/modules/app_lua/app_lua_mod.c b/modules/app_lua/app_lua_mod.c index 8cf74a1..fea80bb 100644 --- a/modules/app_lua/app_lua_mod.c +++ b/modules/app_lua/app_lua_mod.c @@ -32,6 +32,7 @@ #include "../../kemi.h" #include "app_lua_api.h" +#include "app_lua_kemi_export.h" MODULE_VERSION @@ -461,11 +462,65 @@ static void app_lua_rpc_list(rpc_t* rpc, void* ctx) return; } + +static const char* app_lua_rpc_api_list_doc[2] = { + "list kemi exports to lua", + 0 +}; + +static void app_lua_rpc_api_list(rpc_t* rpc, void* ctx) +{ + int i; + int n; + sr_kemi_t *ket; + void* th; + void* sh; + void* ih; + + if (rpc->add(ctx, "{", &th) < 0) { + rpc->fault(ctx, 500, "Internal error root reply"); + return; + } + n = 0; + for(i=0; i<SR_KEMI_LUA_EXPORT_SIZE; i++) { + ket = sr_kemi_lua_export_get(i); + if(ket==NULL) continue; + n++; + } + + if(rpc->struct_add(th, "d[", + "msize", n, + "methods", &ih)<0) + { + rpc->fault(ctx, 500, "Internal error array structure"); + return; + } + for(i=0; i<SR_KEMI_LUA_EXPORT_SIZE; i++) { + ket = sr_kemi_lua_export_get(i); + if(ket==NULL) continue; + if(rpc->struct_add(ih, "{", "func", &sh)<0) { + rpc->fault(ctx, 500, "Internal error internal structure"); + return; + } + if(rpc->struct_add(sh, "SSSS", + "ret", sr_kemi_param_map_get_name(ket->rtype), + "module", &ket->mname, + "name", &ket->fname, + "params", sr_kemi_param_map_get_params(ket->ptypes))<0) { + LM_ERR("failed to add the structure with attributes (%d)\n", i); + rpc->fault(ctx, 500, "Internal error creating dest struct"); + return; + } + } +} + rpc_export_t app_lua_rpc_cmds[] = { {"app_lua.reload", app_lua_rpc_reload, app_lua_rpc_reload_doc, 0}, {"app_lua.list", app_lua_rpc_list, app_lua_rpc_list_doc, 0}, + {"app_lua.api_list", app_lua_rpc_api_list, + app_lua_rpc_api_list_doc, 0}, {0, 0, 0, 0} };
8 years, 7 months
1
0
0
0
git:master:e68bf3a7: core: helper functions to get str names for kemi types
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: e68bf3a73f02aeab9d4014f18c8b2195684c2399 URL:
https://github.com/kamailio/kamailio/commit/e68bf3a73f02aeab9d4014f18c8b219…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-05-02T09:09:35+02:00 core: helper functions to get str names for kemi types --- Modified: kemi.c Modified: kemi.h --- Diff:
https://github.com/kamailio/kamailio/commit/e68bf3a73f02aeab9d4014f18c8b219…
Patch:
https://github.com/kamailio/kamailio/commit/e68bf3a73f02aeab9d4014f18c8b219…
--- diff --git a/kemi.c b/kemi.c index 7b08a83..d32843f 100644 --- a/kemi.c +++ b/kemi.c @@ -1014,3 +1014,63 @@ str* sr_kemi_cbname_lookup_idx(int idx) } return &_sr_kemi_cbname_list[idx-1].name; } + +/** + * + */ +typedef struct sr_kemi_param_map { + int ptype; + str pname; +} sr_kemi_param_map_t; + +/** + * + */ +static sr_kemi_param_map_t _sr_kemi_param_map[] = { + { SR_KEMIP_NONE, str_init("none") }, + { SR_KEMIP_INT, str_init("int") }, + { SR_KEMIP_STR, str_init("str") }, + { SR_KEMIP_BOOL, str_init("bool") }, + { 0, STR_NULL } +}; + +/** + * + */ +str *sr_kemi_param_map_get_name(int ptype) +{ + int i; + + for(i=0; _sr_kemi_param_map[i].pname.s!=NULL; i++) { + if(_sr_kemi_param_map[i].ptype==ptype) + return &_sr_kemi_param_map[i].pname; + } + return NULL; +} + +/** + * + */ +str *sr_kemi_param_map_get_params(int *ptypes) +{ + int i; + static char pbuf[64]; + static str sret = STR_NULL; + str *pn; + + pbuf[0] = '\0'; + for(i=0; i<SR_KEMI_PARAMS_MAX; i++) { + if(ptypes[i]==SR_KEMIP_NONE) break; + if(i>0) strcat(pbuf, ", "); + pn = sr_kemi_param_map_get_name(ptypes[i]); + if(pn==NULL) return NULL; + strcat(pbuf, pn->s); + } + if(pbuf[0]=='\0') { + pn = sr_kemi_param_map_get_name(SR_KEMIP_NONE); + strcat(pbuf, pn->s); + } + sret.s = pbuf; + sret.len = strlen(sret.s); + return &sret; +} diff --git a/kemi.h b/kemi.h index 57b14a0..0671518 100644 --- a/kemi.h +++ b/kemi.h @@ -120,4 +120,7 @@ str* sr_kemi_cbname_lookup_idx(int idx); void sr_kemi_act_ctx_set(run_act_ctx_t *ctx); run_act_ctx_t* sr_kemi_act_ctx_get(void); +str *sr_kemi_param_map_get_name(int ptype); +str *sr_kemi_param_map_get_params(int *ptypes); + #endif
8 years, 7 months
1
0
0
0
← Newer
1
...
32
33
34
35
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
32
33
34
35
Results per page:
10
25
50
100
200