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 2010
----- 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
29 participants
223 discussions
Start a n
N
ew thread
git:master: msilo(k): parameter to control contact header
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 8ffb09ce908088af89e70a5acd87a318baf5a029 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8ffb09c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 20:56:23 2010 +0200 msilo(k): parameter to control contact header - add_contact parameter controls whether contact header is added to msilo generated messages - default is off (no contact added, as per RFC3428), reported by Juha Heinanen --- modules_k/msilo/msfuncs.c | 32 ++++++++++++++++++++++++++------ modules_k/msilo/msfuncs.h | 2 +- modules_k/msilo/msilo.c | 6 ++++-- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/modules_k/msilo/msfuncs.c b/modules_k/msilo/msfuncs.c index 735b8d6..eed73bd 100644 --- a/modules_k/msilo/msfuncs.c +++ b/modules_k/msilo/msfuncs.c @@ -36,7 +36,13 @@ #include "../../udp_server.h" #include "../../pt.h" +#define CONTACT_PREFIX "Contact: <" +#define CONTACT_SUFFIX ">;msilo=yes"CRLF +#define CONTACT_PREFIX_LEN (sizeof(CONTACT_PREFIX)-1) +#define CONTACT_SUFFIX_LEN (sizeof(CONTACT_SUFFIX)-1) + extern int ms_add_date; +extern int ms_add_contact; /** * apostrophes escaping @@ -181,21 +187,26 @@ error: /** build MESSAGE headers * - * Add Content-Type, Date, and extra headers if they exist + * Add Content-Type, Contact, Date, and extra headers if they exist * expects - max buf len of the resulted body in body->len * - body->s MUST be allocated * return: 0 OK ; -1 error * */ -int m_build_headers(str *buf, str ctype, time_t date, str extra) +int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra) { char *p; char strDate[48]; int lenDate = 0; + int newLen = 0; + + if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0) + goto error; - if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0 - || buf->len <= ctype.len+extra.len+14 - /*Content-Type: */ - +CRLF_LEN) + newLen = 14 + ctype.len + CRLF_LEN + extra.len; + if(contact.len > 0 && ms_add_contact) + newLen += CONTACT_PREFIX_LEN + contact.len + CONTACT_SUFFIX_LEN; + + if(buf->len <= newLen) goto error; p = buf->s; @@ -215,6 +226,15 @@ int m_build_headers(str *buf, str ctype, time_t date, str extra) p += CRLF_LEN; } + if(contact.len > 0 && ms_add_contact) + { + strncpy(p, CONTACT_PREFIX, CONTACT_PREFIX_LEN); + p += CONTACT_PREFIX_LEN; + strncpy(p, contact.s, contact.len); + p += contact.len; + strncpy(p, CONTACT_SUFFIX, CONTACT_SUFFIX_LEN); + p += CONTACT_SUFFIX_LEN; + } if (extra.len > 0) { strncpy(p, extra.s, extra.len); p += extra.len; diff --git a/modules_k/msilo/msfuncs.h b/modules_k/msilo/msfuncs.h index 79a8fdd..8a70fc4 100644 --- a/modules_k/msilo/msfuncs.h +++ b/modules_k/msilo/msfuncs.h @@ -49,7 +49,7 @@ int m_apo_escape(char*, int, char*, int); int m_extract_content_type(char*, int, content_type_t*, int); /** build MESSAGE headers */ -int m_build_headers(str *buf, str ctype, time_t date, str extra); +int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra); /** build MESSAGE body */ int m_build_body(str *body, time_t date, str msg, time_t sdate); diff --git a/modules_k/msilo/msilo.c b/modules_k/msilo/msilo.c index 1c59073..b7ffd6a 100644 --- a/modules_k/msilo/msilo.c +++ b/modules_k/msilo/msilo.c @@ -144,6 +144,7 @@ int ms_send_time = 0; int ms_clean_period = 10; int ms_use_contact = 1; int ms_add_date = 1; +int ms_add_contact = 0; int ms_max_messages = 0; static str ms_snd_time_avp_param = {NULL, 0}; @@ -210,6 +211,7 @@ static param_export_t params[]={ { "snd_time_avp", STR_PARAM, &ms_snd_time_avp_param.s }, { "add_date", INT_PARAM, &ms_add_date }, { "max_messages", INT_PARAM, &ms_max_messages }, + { "add_contact", INT_PARAM, &ms_add_contact }, { 0,0,0 } }; @@ -1030,7 +1032,7 @@ static int m_dump(struct sip_msg* msg, char* owner, char* str2) hdr_str.len = 1024; if(m_build_headers(&hdr_str, str_vals[3] /*ctype*/, - rtime /*Date*/, + str_vals[0]/*from*/, rtime /*Date*/, extra_hdrs_str /*extra_hdrs*/) < 0) { LM_ERR("headers building failed [%d]\n", mid); @@ -1297,7 +1299,7 @@ void m_send_ontimer(unsigned int ticks, void *param) extra_hdrs_str.len = 0; hdr_str.len = 1024; if(m_build_headers(&hdr_str, str_vals[3] /*ctype*/, - 0/*Date*/, + ms_reminder/*from*/,0/*Date*/, extra_hdrs_str/*extra*/) < 0) {
14 years, 4 months
1
0
0
0
git:master: msilo(k): updated readme file
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 9d8c55287ea9ac93440d762c511afe531c629552 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9d8c552…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 21:03:36 2010 +0200 msilo(k): updated readme file - documented the new parameter add_contact - readme file regenerated --- modules_k/msilo/README | 212 +++++++++++++++++++---------------- modules_k/msilo/doc/msilo_admin.xml | 21 ++++ 2 files changed, 135 insertions(+), 98 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=9d8…
14 years, 4 months
1
0
0
0
git:master: pdb: avoid child re-init
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: bc34a82fbf5bd903cc50cb34c73afb7b685603a7 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bc34a82…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 19:19:17 2010 +0200 pdb: avoid child re-init - for mi cmd when used over xmlrpc module --- modules/pdb/pdb.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/pdb/pdb.c b/modules/pdb/pdb.c index 9720a13..721363c 100644 --- a/modules/pdb/pdb.c +++ b/modules/pdb/pdb.c @@ -667,17 +667,20 @@ static int mod_init(void) return 0; } - static int child_init (int rank) { - if (init_server_socket() != 0) return -1; - return 0; + return mi_child_init(); } +static int pdb_child_initialized = 0; + static int mi_child_init(void) { + if(pdb_child_initialized) + return 0; if (init_server_socket() != 0) return -1; + pdb_child_initialized = 1; return 0; }
14 years, 4 months
1
1
0
0
git:master: mtree: avoid re-init of db handler
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 6c1e441f8c137503e3edd0a92d9bec5a7bd11379 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6c1e441…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 19:13:46 2010 +0200 mtree: avoid re-init of db handler - applies for mi cmd usage with xmlrpc module --- modules/mtree/mtree_mod.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mtree/mtree_mod.c b/modules/mtree/mtree_mod.c index 23e06a1..2ab5ae5 100644 --- a/modules/mtree/mtree_mod.c +++ b/modules/mtree/mtree_mod.c @@ -313,16 +313,16 @@ error1: mt_destroy_trees(); if(db_con!=NULL) - { mt_dbf.close(db_con); - db_con = 0; - } + db_con = 0; return -1; } static int child_init(void) { + if(db_con!=NULL) + return 0; db_con = mt_dbf.init(&db_url); if(db_con==NULL) {
14 years, 4 months
1
0
0
0
git:master: kex: check if uptime value was initialized
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 7537d27782b185a20d32b08f7bcb30557bb3b7ff URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7537d27…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 19:00:51 2010 +0200 kex: check if uptime value was initialized --- modules_k/kex/mi_core.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/modules_k/kex/mi_core.c b/modules_k/kex/mi_core.c index 7d9a09c..157d9f4 100644 --- a/modules_k/kex/mi_core.c +++ b/modules_k/kex/mi_core.c @@ -66,6 +66,8 @@ static int init_mi_uptime(void) { char *p; + if (kmi_up_since_ctime.s!=0) + return 0; time(&kmi_up_since); p = ctime(&kmi_up_since); kmi_up_since_ctime.len = strlen(p)-1;
14 years, 4 months
1
0
0
0
git:master: presence: avoid re-init of db handler
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 8a1d985743fe6ec544a215b8ddb6e54adbb024d9 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8a1d985…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 19:07:18 2010 +0200 presence: avoid re-init of db handler - safety check for usage of xmlrpc for mi cmds --- modules_k/presence/presence.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/modules_k/presence/presence.c b/modules_k/presence/presence.c index a07cf21..b826e39 100644 --- a/modules_k/presence/presence.c +++ b/modules_k/presence/presence.c @@ -363,6 +363,8 @@ static int child_init(int rank) LM_CRIT("child_init: database not bound\n"); return -1; } + if (pa_db) + return 0; pa_db = pa_dbf.init(&db_url); if (!pa_db) { @@ -404,6 +406,8 @@ static int mi_child_init(void) LM_CRIT("database not bound\n"); return -1; } + if (pa_db) + return 0; pa_db = pa_dbf.init(&db_url); if (!pa_db) {
14 years, 4 months
1
0
0
0
git:master: presence_xml: avoid re-init of db handler
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 098deec785ab7c4e927104e83fc84b6c1b347719 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=098deec…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 19:08:04 2010 +0200 presence_xml: avoid re-init of db handler - safety check for usage of xmlrpc module for mi cmds --- modules_k/presence_xml/presence_xml.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/modules_k/presence_xml/presence_xml.c b/modules_k/presence_xml/presence_xml.c index ab3f8f3..dbea378 100644 --- a/modules_k/presence_xml/presence_xml.c +++ b/modules_k/presence_xml/presence_xml.c @@ -277,6 +277,8 @@ static int mi_child_init(void) LM_CRIT("database not bound\n"); return -1; } + if(pxml_db) + return 0; pxml_db = pxml_dbf.init(&db_url); if (pxml_db== NULL) { @@ -310,6 +312,8 @@ static int child_init(int rank) LM_CRIT("database not bound\n"); return -1; } + if(pxml_db) + return 0; pxml_db = pxml_dbf.init(&db_url); if (pxml_db== NULL) {
14 years, 4 months
1
0
0
0
git:master: userblacklist: avoid double child initialization
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 3f2ca85f4254746240177830e85a87b81d8cfd85 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3f2ca85…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 18:57:09 2010 +0200 userblacklist: avoid double child initialization - safety check for cases when xmlrpc module is used to run mi commands --- modules_k/userblacklist/userblacklist.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/modules_k/userblacklist/userblacklist.c b/modules_k/userblacklist/userblacklist.c index 51cb4db..531aed2 100644 --- a/modules_k/userblacklist/userblacklist.c +++ b/modules_k/userblacklist/userblacklist.c @@ -662,21 +662,16 @@ static int child_init(int rank) if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN) return 0; /* do nothing for the main process */ - if (userblacklist_db_open() != 0) return -1; - dtrie_root=dtrie_init(10); - if (dtrie_root == NULL) { - LM_ERR("could not initialize data"); - return -1; - } - /* because we've added new sources during the fixup */ - if (reload_sources() != 0) return -1; - - return 0; + return mi_child_init(); } +static int userblacklist_child_initialized = 0; + static int mi_child_init(void) { + if(userblacklist_child_initialized) + return 0; if (userblacklist_db_open() != 0) return -1; dtrie_root=dtrie_init(10); if (dtrie_root == NULL) { @@ -686,6 +681,8 @@ static int mi_child_init(void) /* because we've added new sources during the fixup */ if (reload_sources() != 0) return -1; + userblacklist_child_initialized = 1; + return 0; }
14 years, 4 months
1
0
0
0
git:master: domain(k): safety check for db handler initialization
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: c65fc04ff83c6304d5889f3426b3b96b5ac7ee69 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c65fc04…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 18:35:27 2010 +0200 domain(k): safety check for db handler initialization - avoid double initialization of db handler when using xmlrpc module for mi commands --- modules_k/domain/domain.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/modules_k/domain/domain.c b/modules_k/domain/domain.c index 942a6ce..3e71c35 100644 --- a/modules_k/domain/domain.c +++ b/modules_k/domain/domain.c @@ -63,6 +63,9 @@ int domain_db_init(const str* db_url) LM_ERR("Unbound database module\n"); goto error; } + if (db_handle!=0) + return 0; + db_handle=domain_dbf.init(db_url); if (db_handle==0){ LM_ERR("Cannot initialize database connection\n");
14 years, 4 months
1
0
0
0
git:master: usrloc(k): avoid re-initialization of db handler
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 8948fe654b83217979b2d2154934a973aefa9ae3 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8948fe6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Thu Jul 1 18:43:54 2010 +0200 usrloc(k): avoid re-initialization of db handler - can happen if mi commands are used over rpc interface via xmlrpc module --- modules_k/usrloc/ul_mod.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/modules_k/usrloc/ul_mod.c b/modules_k/usrloc/ul_mod.c index 3c74008..7a1cdbd 100644 --- a/modules_k/usrloc/ul_mod.c +++ b/modules_k/usrloc/ul_mod.c @@ -340,7 +340,8 @@ static int child_init(int _rank) break; } - ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */ + if (!ul_dbh) + ul_dbh = ul_dbf.init(&db_url); /* Get a new database connection */ if (!ul_dbh) { LM_ERR("child(%d): failed to connect to database\n", _rank); return -1; @@ -370,6 +371,10 @@ static int mi_child_init(void) return 0; if (db_mode != NO_DB) { + if (ul_dbh) { + done = 1; + return 0; + } ul_dbh = ul_dbf.init(&db_url); if (!ul_dbh) { LM_ERR("failed to connect to database\n");
14 years, 4 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
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