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
February 2023
----- 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
10 participants
296 discussions
Start a n
N
ew thread
git:5.6:07fc4d54: app_python3: use Py_SET_TYPE() from python 3.9
by Victor Seva
Module: kamailio Branch: 5.6 Commit: 07fc4d54e1c00a155dc17c25998ab2cbf75d0862 URL:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2023-02-15T10:35:23+01:00 app_python3: use Py_SET_TYPE() from python 3.9 (cherry picked from commit fc75b4c3f8f9bdba320f74ddf942686c09316b56) --- Modified: src/modules/app_python3/python_msgobj.c --- Diff:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
Patch:
https://github.com/kamailio/kamailio/commit/07fc4d54e1c00a155dc17c25998ab2c…
--- diff --git a/src/modules/app_python3/python_msgobj.c b/src/modules/app_python3/python_msgobj.c index db6da6a07a..22aebd5404 100644 --- a/src/modules/app_python3/python_msgobj.c +++ b/src/modules/app_python3/python_msgobj.c @@ -507,7 +507,11 @@ static PyTypeObject MSGtype = { int python_msgobj_init(void) { +#if PY_VERSION_HEX >= 0x03090000 + Py_SET_TYPE(&MSGtype, &PyType_Type); +#else Py_TYPE(&MSGtype) = &PyType_Type; +#endif if (PyType_Ready(&MSGtype) < 0) return -1; return 0;
1 year, 9 months
1
0
0
0
git:5.6:82caa486: app_python3: proper check of PY_VERSION_HEX for python 3.11
by Victor Seva
Module: kamailio Branch: 5.6 Commit: 82caa486216930ff634e4b9eeee8184eabaf504c URL:
https://github.com/kamailio/kamailio/commit/82caa486216930ff634e4b9eeee8184…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2023-02-15T10:35:23+01:00 app_python3: proper check of PY_VERSION_HEX for python 3.11 (cherry picked from commit 8546fb87e3277b675bd47eba9435f739cf3bb69d) --- Modified: src/modules/app_python3/apy_kemi.c --- Diff:
https://github.com/kamailio/kamailio/commit/82caa486216930ff634e4b9eeee8184…
Patch:
https://github.com/kamailio/kamailio/commit/82caa486216930ff634e4b9eeee8184…
--- diff --git a/src/modules/app_python3/apy_kemi.c b/src/modules/app_python3/apy_kemi.c index 47a34a4cb6..09d0560b39 100644 --- a/src/modules/app_python3/apy_kemi.c +++ b/src/modules/app_python3/apy_kemi.c @@ -1810,7 +1810,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) PyObject *ret = NULL; PyThreadState *pstate = NULL; PyFrameObject *pframe = NULL; -#if PY_VERSION_HEX >= 0x03100000 +#if PY_VERSION_HEX >= 0x030B0000 PyCodeObject *pcode = NULL; #endif struct timeval tvb = {0}, tve = {0}; @@ -1836,7 +1836,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) if(tdiff >= cfg_get(core, core_cfg, latency_limit_action)) { pstate = PyThreadState_GET(); if (pstate != NULL) { -#if PY_VERSION_HEX >= 0x03100000 +#if PY_VERSION_HEX >= 0x030B0000 pframe = PyThreadState_GetFrame(pstate); if(pframe != NULL) { pcode = PyFrame_GetCode(pframe); @@ -1846,7 +1846,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) #endif } -#if PY_VERSION_HEX >= 0x03100000 +#if PY_VERSION_HEX >= 0x030B0000 LOG(cfg_get(core, core_cfg, latency_log), "alert - action KSR.%s%s%s(...)" " took too long [%u ms] (file:%s func:%s line:%d)\n",
1 year, 9 months
1
0
0
0
git:5.6:92f15de3: app_python3: use new Python 3.10+ API functions for tracking execution
by Victor Seva
Module: kamailio Branch: 5.6 Commit: 92f15de3d026405c749ce10fb4b11200c9b365b1 URL:
https://github.com/kamailio/kamailio/commit/92f15de3d026405c749ce10fb4b1120…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2023-02-15T10:35:23+01:00 app_python3: use new Python 3.10+ API functions for tracking execution - GH #3187 (cherry picked from commit b8bf86eb11a17c853450e5c7f81d2446cf719fbc) --- Modified: src/modules/app_python3/apy_kemi.c --- Diff:
https://github.com/kamailio/kamailio/commit/92f15de3d026405c749ce10fb4b1120…
Patch:
https://github.com/kamailio/kamailio/commit/92f15de3d026405c749ce10fb4b1120…
--- diff --git a/src/modules/app_python3/apy_kemi.c b/src/modules/app_python3/apy_kemi.c index 421db19b78..47a34a4cb6 100644 --- a/src/modules/app_python3/apy_kemi.c +++ b/src/modules/app_python3/apy_kemi.c @@ -1810,6 +1810,9 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) PyObject *ret = NULL; PyThreadState *pstate = NULL; PyFrameObject *pframe = NULL; +#if PY_VERSION_HEX >= 0x03100000 + PyCodeObject *pcode = NULL; +#endif struct timeval tvb = {0}, tve = {0}; struct timezone tz; unsigned int tdiff; @@ -1832,10 +1835,27 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) + (tve.tv_usec - tvb.tv_usec); if(tdiff >= cfg_get(core, core_cfg, latency_limit_action)) { pstate = PyThreadState_GET(); - if (pstate != NULL && pstate->frame != NULL) { + if (pstate != NULL) { +#if PY_VERSION_HEX >= 0x03100000 + pframe = PyThreadState_GetFrame(pstate); + if(pframe != NULL) { + pcode = PyFrame_GetCode(pframe); + } +#else pframe = pstate->frame; +#endif } +#if PY_VERSION_HEX >= 0x03100000 + LOG(cfg_get(core, core_cfg, latency_log), + "alert - action KSR.%s%s%s(...)" + " took too long [%u ms] (file:%s func:%s line:%d)\n", + (ket->mname.len>0)?ket->mname.s:"", + (ket->mname.len>0)?".":"", ket->fname.s, tdiff, + (pcode)?PyBytes_AsString(pcode->co_filename):"", + (pcode)?PyBytes_AsString(pcode->co_name):"", + (pframe)?PyFrame_GetLineNumber(pframe):0); +#else LOG(cfg_get(core, core_cfg, latency_log), "alert - action KSR.%s%s%s(...)" " took too long [%u ms] (file:%s func:%s line:%d)\n", @@ -1844,6 +1864,7 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx) (pframe && pframe->f_code)?PyBytes_AsString(pframe->f_code->co_filename):"", (pframe && pframe->f_code)?PyBytes_AsString(pframe->f_code->co_name):"", (pframe && pframe->f_code)?PyCode_Addr2Line(pframe->f_code, pframe->f_lasti):0); +#endif } }
1 year, 9 months
1
0
0
0
git:master:f301ca9c: nat_traversal: cast to uint64_t when using time_t value
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: f301ca9cdcc044dd05e9d82139e1db368be6dc5c URL:
https://github.com/kamailio/kamailio/commit/f301ca9cdcc044dd05e9d82139e1db3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-15T09:33:56+01:00 nat_traversal: cast to uint64_t when using time_t value --- Modified: src/modules/nat_traversal/nat_traversal.c --- Diff:
https://github.com/kamailio/kamailio/commit/f301ca9cdcc044dd05e9d82139e1db3…
Patch:
https://github.com/kamailio/kamailio/commit/f301ca9cdcc044dd05e9d82139e1db3…
--- diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c index c5cf7fa15b..d659aced45 100644 --- a/src/modules/nat_traversal/nat_traversal.c +++ b/src/modules/nat_traversal/nat_traversal.c @@ -39,6 +39,7 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> +#include <stdint.h> #include <ctype.h> #include <errno.h> #include <time.h> @@ -922,7 +923,7 @@ static time_t get_register_expire( } } - LM_DBG("maximum expire for all contacts: %u\n", (unsigned)expire); + LM_DBG("maximum expire for all contacts: %llu\n", (uint64_t)expire); return (expire ? expire + now : 0); }
1 year, 9 months
1
0
0
0
git:master:92934589: avpops: cast db value for avp number field as long
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 929345896700fb116facc41e3542125dfbb79b41 URL:
https://github.com/kamailio/kamailio/commit/929345896700fb116facc41e3542125…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-15T09:28:03+01:00 avpops: cast db value for avp number field as long --- Modified: src/modules/avpops/avpops_db.c --- Diff:
https://github.com/kamailio/kamailio/commit/929345896700fb116facc41e3542125…
Patch:
https://github.com/kamailio/kamailio/commit/929345896700fb116facc41e3542125…
--- diff --git a/src/modules/avpops/avpops_db.c b/src/modules/avpops/avpops_db.c index 9b36709aad..cca0b84b07 100644 --- a/src/modules/avpops/avpops_db.c +++ b/src/modules/avpops/avpops_db.c @@ -21,6 +21,7 @@ #include <stdlib.h> +#include <stdint.h> #include <string.h> #include "../../core/mem/mem.h" @@ -66,7 +67,7 @@ int avpops_db_bind(const str* db_url) int avpops_db_init(const str* db_url, const str* db_table, str** db_cols) { - + db_hdl = avpops_dbf.init(db_url); if (db_hdl==0) { @@ -313,16 +314,16 @@ int db_query_avp(struct sip_msg *msg, char *query, pvname_list_t* dest) int i, j; pvname_list_t* crt; static str query_str; - + if(query==NULL) { LM_ERR("bad parameter\n"); return -1; } - + query_str.s = query; query_str.len = strlen(query); - + if(avpops_dbf.raw_query(db_hdl, &query_str, &db_res)!=0) { LM_ERR("cannot do the query\n"); @@ -338,11 +339,11 @@ int db_query_avp(struct sip_msg *msg, char *query, pvname_list_t* dest) LM_DBG("rows [%d]\n", RES_ROW_N(db_res)); /* reverse order of rows so that first row get's in front of avp list */ - for(i = RES_ROW_N(db_res)-1; i >= 0; i--) + for(i = RES_ROW_N(db_res)-1; i >= 0; i--) { LM_DBG("row [%d]\n", i); crt = dest; - for(j = 0; j < RES_COL_N(db_res); j++) + for(j = 0; j < RES_COL_N(db_res); j++) { if(RES_ROWS(db_res)[i].values[j].nul) goto next_avp; @@ -388,19 +389,19 @@ int db_query_avp(struct sip_msg *msg, char *query, pvname_list_t* dest) break; case DB1_INT: avp_val.n - = (int)RES_ROWS(db_res)[i].values[j].val.int_val; + = (long)RES_ROWS(db_res)[i].values[j].val.int_val; break; case DB1_BIGINT: avp_val.n - = (int)RES_ROWS(db_res)[i].values[j].val.ll_val; + = (long)RES_ROWS(db_res)[i].values[j].val.ll_val; break; case DB1_DATETIME: avp_val.n - = (int)RES_ROWS(db_res)[i].values[j].val.time_val; + = (long)(uint64_t)RES_ROWS(db_res)[i].values[j].val.time_val; break; case DB1_BITMAP: avp_val.n - = (int)RES_ROWS(db_res)[i].values[j].val.bitmap_val; + = (long)RES_ROWS(db_res)[i].values[j].val.bitmap_val; break; default: goto next_avp;
1 year, 9 months
1
0
0
0
git:master:e203aaf7: modules: readme files regenerated - presence ... [skip ci]
by Kamailio Dev
Module: kamailio Branch: master Commit: e203aaf7294b5f320ede58636649246167974983 URL:
https://github.com/kamailio/kamailio/commit/e203aaf7294b5f320ede58636649246…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2023-02-14T17:31:29+01:00 modules: readme files regenerated - presence ... [skip ci] --- Modified: src/modules/presence/README --- Diff:
https://github.com/kamailio/kamailio/commit/e203aaf7294b5f320ede58636649246…
Patch:
https://github.com/kamailio/kamailio/commit/e203aaf7294b5f320ede58636649246…
--- diff --git a/src/modules/presence/README b/src/modules/presence/README index 203283ebed..8d6172584e 100644 --- a/src/modules/presence/README +++ b/src/modules/presence/README @@ -88,6 +88,7 @@ Juha Heinanen 5.3. presence.updateWatchers 5.4. presence.presentity_list 5.5. presence.presentity_show + 5.6. presence.watcher_list 6. Exported Variables @@ -239,6 +240,7 @@ Chapter 1. Admin Guide 5.3. presence.updateWatchers 5.4. presence.presentity_list 5.5. presence.presentity_show + 5.6. presence.watcher_list 6. Exported Variables @@ -1070,6 +1072,7 @@ pres_update_watchers("sip:test@kamailio.org", "presence"); 5.3. presence.updateWatchers 5.4. presence.presentity_list 5.5. presence.presentity_show + 5.6. presence.watcher_list 5.1. presence.cleanup @@ -1169,6 +1172,22 @@ kamctl rpc presence.presentity_show basic alice
sipserver.com
kamctl rpc presence.presentity_show full *
sipserver.com
... +5.6. presence.watcher_list + + Return the watcher records for a specific presentity uri. + + Name: presence.watcher_list + + Parameters: + * mode - it can be 'basic' or 'full' to print a selection or all the + fields of watcher record. + * uri - the presentity uri. + + RPC Command Format: +... +kamctl rpc presence.watcher_list basic sip:alice@sipserver.com +... + 6. Exported Variables 6.1. $subs(attr)
1 year, 9 months
1
0
0
0
git:master:6b30c100: presence: docs for presence.watcher_list rpc command
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 6b30c100e7618cabf4d241f4b5b28bb334cf5340 URL:
https://github.com/kamailio/kamailio/commit/6b30c100e7618cabf4d241f4b5b28bb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-14T17:16:19+01:00 presence: docs for presence.watcher_list rpc command --- Modified: src/modules/presence/doc/presence_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/6b30c100e7618cabf4d241f4b5b28bb…
Patch:
https://github.com/kamailio/kamailio/commit/6b30c100e7618cabf4d241f4b5b28bb…
--- diff --git a/src/modules/presence/doc/presence_admin.xml b/src/modules/presence/doc/presence_admin.xml index cd67be7e54..dbad0acf65 100644 --- a/src/modules/presence/doc/presence_admin.xml +++ b/src/modules/presence/doc/presence_admin.xml @@ -1426,6 +1426,33 @@ kamctl rpc presence.presentity_list full ... kamctl rpc presence.presentity_show basic alice
sipserver.com
kamctl rpc presence.presentity_show full *
sipserver.com
+... + </programlisting> + </section> + <section id="presence.rpc.watcher_list"> + <title>presence.watcher_list</title> + <para> + Return the watcher records for a specific presentity uri. + </para> + <para> + Name: <emphasis>presence.watcher_list</emphasis> + </para> + <para>Parameters:</para> + <itemizedlist> + <listitem> + <para>mode - it can be 'basic' or 'full' to print a selection or + all the fields of watcher record.</para> + </listitem> + <listitem> + <para>uri - the presentity uri.</para> + </listitem> + </itemizedlist> + <para> + RPC Command Format: + </para> + <programlisting format="linespecific"> +... +kamctl rpc presence.watcher_list basic sip:alice@sipserver.com ... </programlisting> </section>
1 year, 9 months
1
0
0
0
git:master:9cbebc1d: presence: added presence.watcher_list rpc command
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 9cbebc1d7c0eda71162ce3d90de1ac3110c10bb0 URL:
https://github.com/kamailio/kamailio/commit/9cbebc1d7c0eda71162ce3d90de1ac3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-14T17:13:09+01:00 presence: added presence.watcher_list rpc command - list the watchers for a presentity uri --- Modified: src/modules/presence/presence.c --- Diff:
https://github.com/kamailio/kamailio/commit/9cbebc1d7c0eda71162ce3d90de1ac3…
Patch:
https://github.com/kamailio/kamailio/commit/9cbebc1d7c0eda71162ce3d90de1ac3…
--- diff --git a/src/modules/presence/presence.c b/src/modules/presence/presence.c index 5138b1381e..06b73df61d 100644 --- a/src/modules/presence/presence.c +++ b/src/modules/presence/presence.c @@ -2029,6 +2029,103 @@ static const char *rpc_presence_presentity_show_doc[2] = { 0 }; +/*! \brief + * rpc cmd: presence.watcher_list + * \mode - output attributes control + * \presuri - filter by presentity uri + */ +void rpc_presence_watcher_list(rpc_t *rpc, void *ctx) +{ + int i = 0; + str omode = {0, 0}; + int imode = 0; + str presuri = str_init(""); + str pempty = str_init(""); + subs_t *s = NULL; + void *th = NULL; + + LM_DBG("listing in memory presentity records\n"); + + imode = rpc->scan(ctx, "SS", &omode, &presuri); + if(imode < 2) { + rpc->fault(ctx, 500, "Not enough parameters"); + return; + } + if(omode.len == 4 && strncmp(omode.s, "full", 4)==0) { + imode = 1; + } else if(omode.len == 5 && strncmp(omode.s, "basic", 5)==0) { + imode = 0; + } else { + rpc->fault(ctx, 500, "Unknown output mode"); + return; + } + + for(i = 0; i < shtable_size; i++) { + lock_get(&subs_htable[i].lock); + for(s = subs_htable[i].entries->next; s!=NULL; s = s->next) { + if(s->pres_uri.len == presuri.len + && strncasecmp(s->pres_uri.s, presuri.s, presuri.len)==0) { + /* add record node */ + if (rpc->add(ctx, "{", &th) < 0) { + rpc->fault(ctx, 500, "Internal error creating response"); + lock_release(&subs_htable[i].lock); + return; + } + + /* add common fields */ + if(rpc->struct_add(th, "SSSSSSSSSSSuudu", + "pres_uri", &s->pres_uri, + "to_user", &s->to_user, + "to_domain", &s->to_domain, + "from_user", &s->from_user, + "from_domain", &s->from_domain, + "watcher_user", &s->watcher_user, + "watcher_domain", &s->watcher_domain, + "contact", &s->contact, + "event_id", &s->event_id, + "callid", &s->callid, + "user_agent", (s->user_agent.s)?&s->user_agent:&pempty, + "expires", s->expires, + "status", s->status, + "version", s->version, + "flags", s->flags)<0) { + rpc->fault(ctx, 500, "Internal error adding attributes"); + lock_release(&subs_htable[i].lock); + return; + } + if(imode==1) { + /* add extra fields */ + if(rpc->struct_add(th, "SSSSSSSuuddd", + "reason", (s->reason.s)?&s->reason:&pempty, + "to_tag", &s->to_tag, + "from_tag", &s->from_tag, + "socket", (s->sockinfo_str.s)?&s->sockinfo_str:&pempty, + "local_contact", (s->local_contact.s)?&s->local_contact:&pempty, + "record_route", (s->record_route.s)?&s->record_route:&pempty, + "auth_rules", (s->auth_rules_doc)?s->auth_rules_doc:&pempty, + "remote_cseq", s->remote_cseq, + "local_cseq", s->local_cseq, + "recv_event", s->recv_event, + "updated", s->updated, + "updated_winfo", s->updated_winfo)<0) { + rpc->fault(ctx, 500, "Internal error adding extra attributes"); + lock_release(&subs_htable[i].lock); + return; + } + } + + } + } + lock_release(&subs_htable[i].lock); + } +} + +static const char *rpc_presence_watcher_list_doc[2] = { + "Show the watcher records for a specific presentity user", + 0 +}; + + rpc_export_t presence_rpc[] = { {"presence.cleanup", rpc_presence_cleanup, rpc_presence_cleanup_doc, 0}, {"presence.refreshWatchers", rpc_presence_refresh_watchers, @@ -2039,6 +2136,8 @@ rpc_export_t presence_rpc[] = { rpc_presence_presentity_list_doc, RET_ARRAY}, {"presence.presentity_show", rpc_presence_presentity_show, rpc_presence_presentity_show_doc, RET_ARRAY}, + {"presence.watcher_list", rpc_presence_watcher_list, + rpc_presence_watcher_list_doc, RET_ARRAY}, {0, 0, 0, 0} };
1 year, 9 months
1
0
0
0
git:master:f66a071d: auth: use time_t instead of casting to int in nonce check
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: f66a071d18820fc71e421d1a73ebd959c4423655 URL:
https://github.com/kamailio/kamailio/commit/f66a071d18820fc71e421d1a73ebd95…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-14T13:48:59+01:00 auth: use time_t instead of casting to int in nonce check - use unsigned int instead of int for building the nonce --- Modified: src/modules/auth/challenge.c Modified: src/modules/auth/nonce.c Modified: src/modules/auth/nonce.h --- Diff:
https://github.com/kamailio/kamailio/commit/f66a071d18820fc71e421d1a73ebd95…
Patch:
https://github.com/kamailio/kamailio/commit/f66a071d18820fc71e421d1a73ebd95…
--- diff --git a/src/modules/auth/challenge.c b/src/modules/auth/challenge.c index c5a769ed21..6f5084a9ae 100644 --- a/src/modules/auth/challenge.c +++ b/src/modules/auth/challenge.c @@ -21,6 +21,8 @@ * */ +#include <stdint.h> + #include "../../core/data_lump.h" #include "../../core/mem/mem.h" #include "../../core/parser/digest/digest.h" @@ -94,14 +96,14 @@ void strip_realm(str* _realm) */ int calc_new_nonce(char* nonce, int *nonce_len, int cfg, struct sip_msg* msg) { - int t; + unsigned int t; #if defined USE_NC || defined USE_OT_NONCE unsigned int n_id; unsigned char pool; unsigned char pool_flags; #endif - t=time(0); + t=(unsigned int)(uint64_t)time(0); #if defined USE_NC || defined USE_OT_NONCE if (nc_enabled || otn_enabled){ pool=nid_get_pool(); diff --git a/src/modules/auth/nonce.c b/src/modules/auth/nonce.c index 3e28df9be4..bd6bc2b755 100644 --- a/src/modules/auth/nonce.c +++ b/src/modules/auth/nonce.c @@ -203,7 +203,8 @@ inline static int calc_bin_nonce_md5(union bin_nonce* b_nonce, int cfg, * message will be included in the generated nonce. * @return 0 on success and -1 on error */ -int calc_nonce(char* nonce, int *nonce_len, int cfg, int since, int expires, +int calc_nonce(char* nonce, int *nonce_len, int cfg, unsigned int since, + unsigned int expires, #if defined USE_NC || defined USE_OT_NONCE unsigned int n_id, unsigned char pf, #endif /* USE_NC || USE_OT_NONCE */ @@ -310,7 +311,8 @@ int check_nonce(auth_body_t* auth, str* secret1, str* secret2, struct sip_msg* msg, int update_nonce) { str * nonce; - int since, b_nonce2_len, b_nonce_len, cfg; + time_t since; + int b_nonce2_len, b_nonce_len, cfg; union bin_nonce b_nonce; union bin_nonce b_nonce2; time_t t; diff --git a/src/modules/auth/nonce.h b/src/modules/auth/nonce.h index 2d04051380..cf8713ea93 100644 --- a/src/modules/auth/nonce.h +++ b/src/modules/auth/nonce.h @@ -208,7 +208,8 @@ int get_auth_checks(struct sip_msg* msg); /* * Calculate nonce value */ -int calc_nonce(char* nonce, int* nonce_len, int cfg, int since, int expires, +int calc_nonce(char* nonce, int* nonce_len, int cfg, unsigned int since, + unsigned int expires, #if defined USE_NC || defined USE_OT_NONCE unsigned int n_id, unsigned char pf, #endif /* USE_NC || USE_OT_NONCE */
1 year, 9 months
1
0
0
0
git:master:41cd4fe9: acc_radius: cast to uint64_t when using time_t value
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 41cd4fe940e2867a348d45840363dfef2b9e05dc URL:
https://github.com/kamailio/kamailio/commit/41cd4fe940e2867a348d45840363dfe…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2023-02-14T13:48:59+01:00 acc_radius: cast to uint64_t when using time_t value --- Modified: src/modules/acc_radius/acc_radius_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/41cd4fe940e2867a348d45840363dfe…
Patch:
https://github.com/kamailio/kamailio/commit/41cd4fe940e2867a348d45840363dfe…
--- diff --git a/src/modules/acc_radius/acc_radius_mod.c b/src/modules/acc_radius/acc_radius_mod.c index 41e70c73fb..59c977a9e4 100644 --- a/src/modules/acc_radius/acc_radius_mod.c +++ b/src/modules/acc_radius/acc_radius_mod.c @@ -364,7 +364,7 @@ int acc_radius_send_request(struct sip_msg *req, acc_info_t *inf) snprintf(smicrosec, 18, "%17.6f", tsecmicro); ADD_RAD_AVPAIR(RA_TIME_STAMP, &smicrosec, -1); } else { - av_type = (uint32_t)inf->env->ts; + av_type = (uint32_t)(uint64_t)inf->env->ts; ADD_RAD_AVPAIR(RA_TIME_STAMP, &av_type, -1); }
1 year, 9 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
30
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
Results per page:
10
25
50
100
200