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
July 2018
----- 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
229 discussions
Start a n
N
ew thread
git:master:951df23f: topoh: try to use sip uri parameters for decoding
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 951df23f8ab9f4428e143949f1e580f76b4d8fc9 URL:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-14T09:20:29+02:00 topoh: try to use sip uri parameters for decoding - when UA adds user=phone, turns the uri type in tel mapped over sip uri, default params pointing to tel params - reported by GH #1541 --- Modified: src/modules/topoh/th_msg.c --- Diff:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
Patch:
https://github.com/kamailio/kamailio/commit/951df23f8ab9f4428e143949f1e580f…
--- diff --git a/src/modules/topoh/th_msg.c b/src/modules/topoh/th_msg.c index 8f46382c8e..2ba5688395 100644 --- a/src/modules/topoh/th_msg.c +++ b/src/modules/topoh/th_msg.c @@ -108,17 +108,25 @@ int th_get_param_value(str *in, str *name, str *value) int th_get_uri_param_value(str *uri, str *name, str *value) { - struct sip_uri puri; + sip_uri_t puri; memset(value, 0, sizeof(str)); if(parse_uri(uri->s, uri->len, &puri)<0) return -1; + + LM_DBG("uri params: [%.*s] - sip uri params: [%.*s]\n", + puri.params.len, (puri.params.s)?puri.params.s:"", + puri.sip_params.len, (puri.sip_params.s)?puri.sip_params.s:""); + + if(puri.sip_params.len>0) + return th_get_param_value(&puri.sip_params, name, value); + return th_get_param_value(&puri.params, name, value); } int th_get_uri_type(str *uri, int *mode, str *value) { - struct sip_uri puri; + sip_uri_t puri; int ret; str r2 = {"r2", 2};
6 years, 4 months
1
0
0
0
git:master:464bf617: textops: set the buffer size for re transformation to 8196
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 464bf61788e86551509c08e07f9eed2a9bba0b58 URL:
https://github.com/kamailio/kamailio/commit/464bf61788e86551509c08e07f9eed2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-14T08:14:07+02:00 textops: set the buffer size for re transformation to 8196 - 2048 is rather small for handlin message body - reported by #1592 --- Modified: src/modules/textops/txt_var.c --- Diff:
https://github.com/kamailio/kamailio/commit/464bf61788e86551509c08e07f9eed2…
Patch:
https://github.com/kamailio/kamailio/commit/464bf61788e86551509c08e07f9eed2…
--- diff --git a/src/modules/textops/txt_var.c b/src/modules/textops/txt_var.c index 6970b66bc7..c4d777e6a6 100644 --- a/src/modules/textops/txt_var.c +++ b/src/modules/textops/txt_var.c @@ -45,13 +45,13 @@ int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype, struct subst_expr *se = NULL; int nmatches; str* result; -#define TR_TXT_BUF_SIZE 2048 +#define TR_TXT_BUF_SIZE 8192 static char tr_txt_buf[TR_TXT_BUF_SIZE]; pv_value_t v; if(val==NULL || (!(val->flags&PV_VAL_STR)) || val->rs.len<=0) return -1; - + switch(subtype) { case TR_TXT_RE_SUBST:
6 years, 4 months
1
0
0
0
git:master:1a20bcaa: core: mem - added shm_address_in(p)
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 1a20bcaa35db4aa80d6460dfb0fb9c70026248c9 URL:
https://github.com/kamailio/kamailio/commit/1a20bcaa35db4aa80d6460dfb0fb9c7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T14:05:27+02:00 core: mem - added shm_address_in(p) - return 1 if pointer p is inside shared memory zone, 0 otherwise --- Modified: src/core/mem/shm.c Modified: src/core/mem/shm.h --- Diff:
https://github.com/kamailio/kamailio/commit/1a20bcaa35db4aa80d6460dfb0fb9c7…
Patch:
https://github.com/kamailio/kamailio/commit/1a20bcaa35db4aa80d6460dfb0fb9c7…
--- diff --git a/src/core/mem/shm.c b/src/core/mem/shm.c index 3dbc34f11a..2cecb1110e 100644 --- a/src/core/mem/shm.c +++ b/src/core/mem/shm.c @@ -165,6 +165,28 @@ void* shm_core_get_pool(void) return _shm_core_pools_mem[0]; } +/** + * + */ +int shm_address_in(void *p) +{ + int i; + + for(i = 0; i < _shm_core_pools_num; i++) { + if(_shm_core_pools_mem[i] == (void *)-1) { + continue; + } + if(((char*)p >= (char*)_shm_core_pools_mem[i]) + && ((char*)p < ((char*)_shm_core_pools_mem[i]) + shm_mem_size)) { + /* address in shm zone */ + return 1; + } + } + + /* address not in shm zone */ + return 0; +} + /** * */ diff --git a/src/core/mem/shm.h b/src/core/mem/shm.h index 5d58071359..e36a94accc 100644 --- a/src/core/mem/shm.h +++ b/src/core/mem/shm.h @@ -86,6 +86,8 @@ int shm_init_manager(char *name); void shm_destroy_manager(void); void shm_print_manager(void); +int shm_address_in(void *p); + #define shm_available_safe() shm_available() #define shm_malloc_on_fork() do{}while(0)
6 years, 4 months
1
0
0
0
git:master:74dcbe87: modules: readme files regenerated - dialog ... [skip ci]
by Kamailio Dev
Module: kamailio Branch: master Commit: 74dcbe875d3978ba7e16bb346ea8c034468237e0 URL:
https://github.com/kamailio/kamailio/commit/74dcbe875d3978ba7e16bb346ea8c03…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2018-07-13T13:01:44+02:00 modules: readme files regenerated - dialog ... [skip ci] --- Modified: src/modules/dialog/README Modified: src/modules/textops/README --- Diff:
https://github.com/kamailio/kamailio/commit/74dcbe875d3978ba7e16bb346ea8c03…
Patch:
https://github.com/kamailio/kamailio/commit/74dcbe875d3978ba7e16bb346ea8c03…
6 years, 4 months
1
0
0
0
git:master:8dd610ed: dialog: removed invalid closing section tag from previous commit
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 8dd610eddca40810af92d2d7131e7e3dd8323554 URL:
https://github.com/kamailio/kamailio/commit/8dd610eddca40810af92d2d7131e7e3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T12:47:53+02:00 dialog: removed invalid closing section tag from previous commit --- Modified: src/modules/dialog/doc/dialog_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/8dd610eddca40810af92d2d7131e7e3…
Patch:
https://github.com/kamailio/kamailio/commit/8dd610eddca40810af92d2d7131e7e3…
--- diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml index 18a0e9b0a8..2240a72c85 100644 --- a/src/modules/dialog/doc/dialog_admin.xml +++ b/src/modules/dialog/doc/dialog_admin.xml @@ -2601,7 +2601,6 @@ if(has_totag()) { ... </programlisting> </section> - </section> <section id="dlg.r.stats_active"> <title>dlg.stats_active</title>
6 years, 4 months
1
0
0
0
git:master:6c06e84d: textops: docs for replace_hdrs_str()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 6c06e84db693698dde6b7cd50aeffc111073f1a3 URL:
https://github.com/kamailio/kamailio/commit/6c06e84db693698dde6b7cd50aeffc1…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T12:46:45+02:00 textops: docs for replace_hdrs_str() --- Modified: src/modules/textops/doc/textops_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/6c06e84db693698dde6b7cd50aeffc1…
Patch:
https://github.com/kamailio/kamailio/commit/6c06e84db693698dde6b7cd50aeffc1…
--- diff --git a/src/modules/textops/doc/textops_admin.xml b/src/modules/textops/doc/textops_admin.xml index 7d7f2d62ce..6be825efc9 100644 --- a/src/modules/textops/doc/textops_admin.xml +++ b/src/modules/textops/doc/textops_admin.xml @@ -476,6 +476,44 @@ replace_body_str("&kamailio;", "&kamailio; SIP Proxy", "a"); </example> </section> + <section id="textops.f.replace_hdrs_str"> + <title> + <function moreinfo="none">replace_hdrs_str(match, repl, mode)</function> + </title> + <para> + Replaces the first or all occurrence of 'match' with 'repl' by doing + string comparison for matching. It is applied over the part with headers + of the SIP message. + </para> + <para>Meaning of the parameters is as follows:</para> + <itemizedlist> + <listitem> + <para><emphasis>match</emphasis> - string to be matched. + </para> + </listitem> + <listitem> + <para><emphasis>repl</emphasis> - string to be used as replacement. + </para> + </listitem> + <listitem> + <para><emphasis>mode</emphasis> - 'f' - replace only first match; + 'a' - replace all matches. + </para> + </listitem> + </itemizedlist> + <para> + This function can be used from ANY_ROUTE. + </para> + <example> + <title><function>replace_hdrs_str</function> usage</title> + <programlisting format="linespecific"> +... +replace_hdrs_str("&kamailio;", "&kamailio; SIP Proxy", "a"); +... +</programlisting> + </example> + </section> + <section id="textops.f.subst"> <title> <function moreinfo="none">subst('/re/repl/flags')</function>
6 years, 4 months
1
0
0
0
git:master:3577cc94: textops: new function replace_hdrs_str()
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 3577cc9497a0fcde5a3d004c74281bfbe75d8923 URL:
https://github.com/kamailio/kamailio/commit/3577cc9497a0fcde5a3d004c74281bf…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T12:46:45+02:00 textops: new function replace_hdrs_str() - replace the matched string in the headers zone --- Modified: src/modules/textops/textops.c --- Diff:
https://github.com/kamailio/kamailio/commit/3577cc9497a0fcde5a3d004c74281bf…
Patch:
https://github.com/kamailio/kamailio/commit/3577cc9497a0fcde5a3d004c74281bf…
--- diff --git a/src/modules/textops/textops.c b/src/modules/textops/textops.c index cc08a96089..a986f78ed3 100644 --- a/src/modules/textops/textops.c +++ b/src/modules/textops/textops.c @@ -91,6 +91,7 @@ static int replace_f(struct sip_msg*, char*, char*); static int replace_str_f(struct sip_msg*, char*, char*, char*); static int replace_body_f(struct sip_msg*, char*, char*); static int replace_body_str_f(struct sip_msg*, char*, char*, char*); +static int replace_hdrs_str_f(struct sip_msg*, char*, char*, char*); static int replace_all_f(struct sip_msg*, char*, char*); static int replace_body_all_f(struct sip_msg*, char*, char*); static int replace_body_atonce_f(struct sip_msg*, char*, char*); @@ -189,6 +190,9 @@ static cmd_export_t cmds[]={ {"replace_body_str", (cmd_function)replace_body_str_f,3, fixup_spve_all, fixup_free_spve_all, ANY_ROUTE}, + {"replace_hdrs_str", (cmd_function)replace_hdrs_str_f,3, + fixup_spve_all, fixup_free_spve_all, + ANY_ROUTE}, {"replace_all", (cmd_function)replace_all_f, 2, fixup_regexp_none, fixup_free_regexp_none, ANY_ROUTE}, @@ -1010,6 +1014,50 @@ static int replace_body_str_f(sip_msg_t* msg, char* pmkey, char* prval, char* pr return ki_replace_body_str(msg, &mkey, &rval, &rmode); } +static int ki_replace_hdrs_str(sip_msg_t* msg, str* mkey, str* rval, str *rmode) +{ + str lbuf; + + if ( parse_headers(msg, HDR_EOH_F, 0)==-1 ) { + LM_ERR("failed to parse to end of headers\n"); + return -1; + } + + lbuf.s = get_header(msg); + lbuf.len = (int)(msg->unparsed - lbuf.s); + + if (lbuf.len==0) { + LM_DBG("message headers part has zero length\n"); + return -1; + } + + return ki_replace_str_helper(msg, &lbuf, mkey, rval, rmode); +} + +static int replace_hdrs_str_f(sip_msg_t* msg, char* pmkey, char* prval, char* prmode) +{ + str mkey; + str rval; + str rmode; + + if(fixup_get_svalue(msg, (gparam_t*)pmkey, &mkey)<0) { + LM_ERR("failed to get the matching string parameter\n"); + return -1; + } + + if(fixup_get_svalue(msg, (gparam_t*)prval, &rval)<0) { + LM_ERR("failed to get the replacement string parameter\n"); + return -1; + } + + if(fixup_get_svalue(msg, (gparam_t*)prmode, &rmode)<0) { + LM_ERR("failed to get the replacement mode parameter\n"); + return -1; + } + + return ki_replace_hdrs_str(msg, &mkey, &rval, &rmode); +} + /* sed-perl style re: s/regular expression/replacement/flags */ static int subst_helper_f(sip_msg_t* msg, struct subst_expr* se) { @@ -4420,6 +4468,11 @@ static sr_kemi_t sr_kemi_textops_exports[] = { { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } }, + { str_init("textops"), str_init("replace_hdrs_str"), + SR_KEMIP_INT, ki_replace_hdrs_str, + { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_STR, + SR_KEMIP_NONE, SR_KEMIP_NONE, SR_KEMIP_NONE } + }, { str_init("textops"), str_init("replace_body_all"), SR_KEMIP_INT, ki_replace_body_all, { SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE,
6 years, 4 months
1
0
0
0
git:master:6d87a1ab: modules: readme files regenerated - dialog ... [skip ci]
by Kamailio Dev
Module: kamailio Branch: master Commit: 6d87a1abacc1383c241f1aa9d3c6f1a182213273 URL:
https://github.com/kamailio/kamailio/commit/6d87a1abacc1383c241f1aa9d3c6f1a…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org> Committer: Kamailio Dev <kamailio.dev(a)kamailio.org> Date: 2018-07-13T12:31:43+02:00 modules: readme files regenerated - dialog ... [skip ci] --- Modified: src/modules/dialog/README --- Diff:
https://github.com/kamailio/kamailio/commit/6d87a1abacc1383c241f1aa9d3c6f1a…
Patch:
https://github.com/kamailio/kamailio/commit/6d87a1abacc1383c241f1aa9d3c6f1a…
6 years, 4 months
1
0
0
0
git:master:c005354f: dialog: docs for rpc command dlg.stats_active
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: c005354f58c493250a3428c58ebeb8fc46e6a0b2 URL:
https://github.com/kamailio/kamailio/commit/c005354f58c493250a3428c58ebeb8f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T12:25:05+02:00 dialog: docs for rpc command dlg.stats_active --- Modified: src/modules/dialog/doc/dialog_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/c005354f58c493250a3428c58ebeb8f…
Patch:
https://github.com/kamailio/kamailio/commit/c005354f58c493250a3428c58ebeb8f…
--- diff --git a/src/modules/dialog/doc/dialog_admin.xml b/src/modules/dialog/doc/dialog_admin.xml index 6d936491cb..18a0e9b0a8 100644 --- a/src/modules/dialog/doc/dialog_admin.xml +++ b/src/modules/dialog/doc/dialog_admin.xml @@ -2603,6 +2603,45 @@ if(has_totag()) { </section> </section> + <section id="dlg.r.stats_active"> + <title>dlg.stats_active</title> + <para> + Get stats about active dialogs by scanning internal list of dialogs + (not relying on core stats framework). + </para> + <para>Name: <emphasis>dlg.stats_active</emphasis></para> + <para>Parameters: none.</para> + <para>Returned fields</para> + <itemizedlist> + <listitem><para> + <emphasis>starting</emphasis> - initial INVITE has been processed, + no ringing or 1xx has been received. + </para></listitem> + <listitem><para> + <emphasis>connecting</emphasis> - initial INVITE was forwarded + and rining or 1xx has been received. + </para></listitem> + <listitem><para> + <emphasis>answering</emphasis> - initial INVITE received 200ok, + but ACK was not handled yet. + </para></listitem> + <listitem><para> + <emphasis>ongoing</emphasis> - ongoing active dialog, after the + ACK was processed. + </para></listitem> + <listitem><para> + <emphasis>all</emphasis> - all active dialogs, respectively the + sum of the above values. + </para></listitem> + </itemizedlist> + <para>RPC Command Format:</para> + <programlisting format="linespecific"> +... +&kamcmd; dlg.stats_active +... + </programlisting> + </section> + </section> <section> <title>Exported Variables</title>
6 years, 4 months
1
0
0
0
git:master:ebb14906: dialog: new rpc command dlg.stats_active
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: ebb149066690f7d96f45e1639e0c5ca9616bbbe0 URL:
https://github.com/kamailio/kamailio/commit/ebb149066690f7d96f45e1639e0c5ca…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-07-13T12:17:04+02:00 dialog: new rpc command dlg.stats_active - return stats about active dialogs by scanning internal hash table --- Modified: src/modules/dialog/dialog.c --- Diff:
https://github.com/kamailio/kamailio/commit/ebb149066690f7d96f45e1639e0c5ca…
Patch:
https://github.com/kamailio/kamailio/commit/ebb149066690f7d96f45e1639e0c5ca…
--- diff --git a/src/modules/dialog/dialog.c b/src/modules/dialog/dialog.c index 7f6e692125..84262ea25f 100644 --- a/src/modules/dialog/dialog.c +++ b/src/modules/dialog/dialog.c @@ -2324,6 +2324,7 @@ static void rpc_profile_print_dlgs(rpc_t *rpc, void *c) { } return; } + static void rpc_dlg_bridge(rpc_t *rpc, void *c) { str from = {NULL,0}; str to = {NULL,0}; @@ -2362,6 +2363,60 @@ static void rpc_dlg_bridge(rpc_t *rpc, void *c) { dlg_bridge(&from, &to, &op, &bd); } +static const char *rpc_dlg_stats_active_doc[2] = { + "Get stats about active dialogs", 0 +}; + +/*! + * \brief Print stats of active dialogs + */ +static void rpc_dlg_stats_active(rpc_t *rpc, void *c) +{ + dlg_cell_t *dlg; + unsigned int i; + int dlg_starting = 0; + int dlg_connecting = 0; + int dlg_answering = 0; + int dlg_ongoing = 0; + void *h; + + for( i=0 ; i<d_table->size ; i++ ) { + dlg_lock( d_table, &(d_table->entries[i]) ); + + for( dlg=d_table->entries[i].first ; dlg ; dlg=dlg->next ) { + switch(dlg->state) { + case DLG_STATE_UNCONFIRMED: + dlg_starting++; + break; + case DLG_STATE_EARLY: + dlg_connecting++; + break; + case DLG_STATE_CONFIRMED_NA: + dlg_answering++; + break; + case DLG_STATE_CONFIRMED: + dlg_ongoing++; + break; + default: + LM_DBG("not active - state: %d\n", dlg->state); + } + } + dlg_unlock( d_table, &(d_table->entries[i]) ); + } + + if (rpc->add(c, "{", &h) < 0) { + rpc->fault(c, 500, "Server failure"); + return; + } + + rpc->struct_add(h, "ddddd", + "starting", dlg_starting, + "connecting", dlg_connecting, + "answering", dlg_answering, + "ongoing", dlg_ongoing, + "all", dlg_starting + dlg_connecting + dlg_answering + dlg_ongoing); +} + static rpc_export_t rpc_methods[] = { {"dlg.list", rpc_print_dlgs, rpc_print_dlgs_doc, RET_ARRAY}, {"dlg.list_ctx", rpc_print_dlgs_ctx, rpc_print_dlgs_ctx_doc, RET_ARRAY}, @@ -2372,5 +2427,6 @@ static rpc_export_t rpc_methods[] = { {"dlg.profile_list", rpc_profile_print_dlgs, rpc_profile_print_dlgs_doc, RET_ARRAY}, {"dlg.bridge_dlg", rpc_dlg_bridge, rpc_dlg_bridge_doc, 0}, {"dlg.terminate_dlg", rpc_dlg_terminate_dlg, rpc_dlg_terminate_dlg_doc, 0}, + {"dlg.stats_active", rpc_dlg_stats_active, rpc_dlg_stats_active_doc, 0}, {0, 0, 0, 0} };
6 years, 4 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
23
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
Results per page:
10
25
50
100
200