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
August 2011
----- 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
33 participants
291 discussions
Start a n
N
ew thread
git:master: modules_k/presence_xml: Adding file missed out on previous commit
by Peter Dunkley
Module: sip-router Branch: master Commit: 15e1eea33c24413abca5ff480fe432307245e0b2 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=15e1eea…
Author: pd <peter.dunkley(a)crocodile-rcs.com> Committer: pd <peter.dunkley(a)crocodile-rcs.com> Date: Sat Aug 20 13:01:42 2011 +0100 modules_k/presence_xml: Adding file missed out on previous commit --- modules_k/presence_xml/api.h | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/modules_k/presence_xml/api.h b/modules_k/presence_xml/api.h new file mode 100644 index 0000000..a80cd63 --- /dev/null +++ b/modules_k/presence_xml/api.h @@ -0,0 +1,28 @@ +#ifndef PXML_API_H +#define PXML_API_H +#include "../../str.h" + +typedef int (*pres_check_basic_t)(struct sip_msg*, str presentity_uri, str status); +typedef int (*pres_check_activities_t)(struct sip_msg*, str presentity_uri, str activity); + +typedef struct presence_xml_binds { + pres_check_basic_t pres_check_basic; + pres_check_activities_t pres_check_activities; +} presence_xml_api_t; + +typedef int (*bind_presence_xml_f)(presence_xml_api_t*); + +int bind_presence_xml(struct presence_xml_binds*); + +inline static int presence_xml_load_api(presence_xml_api_t *pxb) +{ + bind_presence_xml_f bind_presence_xml_exports; + if (!(bind_presence_xml_exports = (bind_presence_xml_f)find_export("bind_presence_xml", 1, 0))) + { + LM_ERR("Failed to import bind_presence_xml\n"); + return -1; + } + return bind_presence_xml_exports(pxb); +} + +#endif /*PXML_API_H*/
13 years, 3 months
1
0
0
0
git:master: lib/srdb1: introduce helper to convert db_val to pv_spec
by Alex Hermann
Module: sip-router Branch: master Commit: ed78c0967b69abc6e8333924460641de08b73e8f URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ed78c09…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Sat Aug 20 09:48:00 2011 +0200 lib/srdb1: introduce helper to convert db_val to pv_spec --- lib/srdb1/db_ut.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/srdb1/db_ut.h | 12 ++++++ 2 files changed, 111 insertions(+), 0 deletions(-) diff --git a/lib/srdb1/db_ut.c b/lib/srdb1/db_ut.c index 16e2f4f..fbc037c 100644 --- a/lib/srdb1/db_ut.c +++ b/lib/srdb1/db_ut.c @@ -34,6 +34,7 @@ #include "../../mem/mem.h" #include "../../dprint.h" +#include "../../pvar.h" #include <limits.h> #include <errno.h> #include <stdio.h> @@ -371,3 +372,101 @@ int db_print_set(const db1_con_t* _c, char* _b, const int _l, const db_key_t* _k LM_ERR("Error in snprintf\n"); return -1; } + +/* + * Convert db_val to pv_spec + */ +int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs) +{ + pv_value_t pv; + str sv = {NULL, 0}; + static str _str_empty = { "", 0 }; + + if(dbval->nul) + { + pv.flags = PV_VAL_NULL; + } else + { + switch(dbval->type) + { + case DB1_STRING: + pv.flags = PV_VAL_STR; + sv.s = (char*)dbval->val.string_val; + sv.len = strlen(sv.s); + break; + case DB1_STR: + pv.flags = PV_VAL_STR; + sv.s = (char*)dbval->val.str_val.s; + sv.len = dbval->val.str_val.len; + break; + case DB1_BLOB: + pv.flags = PV_VAL_STR; + sv.s = (char*)dbval->val.blob_val.s; + sv.len = dbval->val.blob_val.len; + break; + case DB1_INT: + pv.flags = PV_VAL_INT | PV_TYPE_INT; + pv.ri = (int)dbval->val.int_val; + break; + case DB1_DATETIME: + pv.flags = PV_VAL_INT | PV_TYPE_INT; + pv.ri = (int)dbval->val.time_val; + break; + case DB1_BITMAP: + pv.flags = PV_VAL_INT | PV_TYPE_INT; + pv.ri = (int)dbval->val.bitmap_val; + break; + case DB1_BIGINT: + /* BIGINT is stored as string */ + pv.flags = PV_VAL_STR; + pv.rs.len = 21*sizeof(char); + pv.rs.s = (char*)pkg_malloc(pv.rs.len); + if (pv.rs.s==NULL) + { + LM_ERR("no more memory\n"); + return -1; + } + db_longlong2str(dbval->val.ll_val, pv.rs.s, &pv.rs.len); + break; + default: + LM_NOTICE("unknown field type: %d, setting value to null\n", + dbval->type); + pv.flags = PV_VAL_NULL; + } + } + + /* null values are ignored for avp type PV */ + if (pv.flags == PV_VAL_NULL && pvs->type == PVT_AVP) + return 0; + + /* handle string values */ + if(pv.flags == PV_VAL_STR && sv.s) + { + if(sv.len==0) + { + pv.rs = _str_empty; + } else + { + /* create copy of string value in pkg mem */ + pv.rs.s = (char*)pkg_malloc(sv.len*sizeof(char)); + if(pv.rs.s==NULL) + { + LM_ERR("no more memory\n"); + return -1; + } + memcpy(pv.rs.s, sv.s, sv.len); + pv.rs.len = sv.len; + } + } + + /* add value to result pv */ + if (pv_set_spec_value(msg, pvs, 0, &pv) != 0) + { + LM_ERR("Failed to add value to spec\n"); + if (pv.flags == PV_VAL_STR) + pkg_free(pv.rs.s); + return -1; + } + + return 0; +} diff --git a/lib/srdb1/db_ut.h b/lib/srdb1/db_ut.h index 85cbe48..0531dc4 100644 --- a/lib/srdb1/db_ut.h +++ b/lib/srdb1/db_ut.h @@ -54,6 +54,7 @@ #include "db_key.h" #include "db.h" +#include "../../pvar.h" /** @@ -204,4 +205,15 @@ int db_print_set(const db1_con_t* _c, char* _b, const int _l, const db_key_t* _k, const db_val_t* _v, const int _n, int (*val2str) (const db1_con_t*, const db_val_t*, char*, int*)); + +/** + * Convert db_val to pv_spec_t + * + * \param msg sip msg structure + * \param dbval database value + * \param pvs pv_spec wher to put the database value + * \return 1 on success, 0 on failure + */ +int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs); + #endif
13 years, 3 months
2
2
0
0
git:master: srdb1: fixed compilation on Mac OS X
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 0a8e9ea74191e1231abf431f87212f7508b8cc92 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0a8e9ea…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Sat Aug 20 13:37:27 2011 +0200 srdb1: fixed compilation on Mac OS X - pvar.h included before changing OS compile flags for time functions --- lib/srdb1/db_ut.h | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/srdb1/db_ut.h b/lib/srdb1/db_ut.h index c0d5ad0..9440467 100644 --- a/lib/srdb1/db_ut.h +++ b/lib/srdb1/db_ut.h @@ -33,6 +33,8 @@ #ifndef DB1_UT_H #define DB1_UT_H +#include "../../pvar.h" + /** * make strptime available * use 600 for 'Single UNIX Specification, Version 3' @@ -54,7 +56,6 @@ #include "db_key.h" #include "db.h" -#include "../../pvar.h" /**
13 years, 3 months
1
0
0
0
git:master: lib/srdb1: fix typos in db_val2pv_spec comments
by Alex Hermann
Module: sip-router Branch: master Commit: 33654b5ceebbcbbdb0062dc8dd8fad143a185c24 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=33654b5…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Sat Aug 20 10:30:07 2011 +0200 lib/srdb1: fix typos in db_val2pv_spec comments --- lib/srdb1/db_ut.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/srdb1/db_ut.h b/lib/srdb1/db_ut.h index 0531dc4..c0d5ad0 100644 --- a/lib/srdb1/db_ut.h +++ b/lib/srdb1/db_ut.h @@ -211,8 +211,8 @@ int db_print_set(const db1_con_t* _c, char* _b, const int _l, * * \param msg sip msg structure * \param dbval database value - * \param pvs pv_spec wher to put the database value - * \return 1 on success, 0 on failure + * \param pvs pv_spec where to put the database value + * \return 0 on success, -1 on failure */ int db_val2pv_spec(struct sip_msg* msg, db_val_t *dbval, pv_spec_t *pvs);
13 years, 3 months
1
0
0
0
git:master: modules_k/sqlops: add sql_pvquery(). Query function that stores results in arbitrary PV's
by Alex Hermann
Module: sip-router Branch: master Commit: ab4e481be8efa9daed925c8a20546a10653f4b91 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ab4e481…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 13:33:32 2011 +0200 modules_k/sqlops: add sql_pvquery(). Query function that stores results in arbitrary PV's --- modules_k/sqlops/README | 60 +++++++++++++++++++++----- modules_k/sqlops/doc/sqlops_admin.xml | 66 ++++++++++++++++++++++++++++- modules_k/sqlops/sql_api.c | 56 +++++++++++++++++++++++++ modules_k/sqlops/sql_api.h | 2 + modules_k/sqlops/sqlops.c | 74 +++++++++++++++++++++++++++++++++ 5 files changed, 244 insertions(+), 14 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=ab4…
13 years, 3 months
1
0
0
0
git:master: modules_k/auth_db: allow arbitrary PV's in load_credentials
by Alex Hermann
Module: sip-router Branch: master Commit: 560bf0f68eccce7741f171c73c4e5cfa61a1e3d2 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=560bf0f…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 17:53:23 2011 +0200 modules_k/auth_db: allow arbitrary PV's in load_credentials Instead of just avp's, now every writable PV can be used. --- modules_k/auth_db/aaa_avps.h | 188 ---------------------------------------- modules_k/auth_db/authdb_mod.c | 106 ++++++++++++++++++++++- modules_k/auth_db/authdb_mod.h | 2 +- modules_k/auth_db/authorize.c | 75 ++-------------- 4 files changed, 113 insertions(+), 258 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=560…
13 years, 3 months
1
0
0
0
git:master: core/pvapi: more verbose error logging in parse_pvname_list()
by Alex Hermann
Module: sip-router Branch: master Commit: e23d26e3c1e5b54a8573f17f9d779dcdee212a33 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e23d26e…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 13:08:54 2011 +0200 core/pvapi: more verbose error logging in parse_pvname_list() --- pvapi.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pvapi.c b/pvapi.c index d4104c2..ff76eb2 100644 --- a/pvapi.c +++ b/pvapi.c @@ -1102,15 +1102,20 @@ pvname_list_t* parse_pvname_list(str *in, unsigned int type) if(!is_in_str(p, in)) { if(head==NULL) - LM_ERR("wrong item name list [%.*s]\n", in->len, in->s); + LM_ERR("parse error in name list [%.*s]\n", in->len, in->s); return head; } - s.s=p; - s.len = in->s+in->len-p; + s.s = p; + s.len = in->s + in->len - p; p = pv_parse_spec(&s, &spec); - if(p==NULL || (type && spec.type!=type)) + if(p==NULL) + { + LM_ERR("parse error in item [%.*s]\n", s.len, s.s); + goto error; + } + if(type && spec.type!=type) { - LM_ERR("wrong item name list [%.*s]!\n", in->len, in->s); + LM_ERR("wrong type for item [%.*s]\n", (int)(p-s.s), s.s); goto error; } al = (pvname_list_t*)pkg_malloc(sizeof(pvname_list_t));
13 years, 3 months
1
0
0
0
git:master: core: add is_in_str macro to ut. h and remove all local definitions
by Alex Hermann
Module: sip-router Branch: master Commit: 7d5f08c3b594bf2444901caa6f8bdf56dcb60ba5 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7d5f08c…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 11:40:57 2011 +0200 core: add is_in_str macro to ut.h and remove all local definitions --- modules_k/pv/pv_trans.c | 1 - modules_k/sqlops/sql_trans.c | 3 +-- modules_k/textops/txt_var.c | 3 +-- pvapi.c | 2 -- ut.h | 3 +++ 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c index a3175f6..0b38238 100644 --- a/modules_k/pv/pv_trans.c +++ b/modules_k/pv/pv_trans.c @@ -47,7 +47,6 @@ #include "../../lib/kcore/strcommon.h" #include "pv_trans.h" -#define is_in_str(p, in) (p<in->s+in->len && *p) /*! transformation buffer size */ #define TR_BUFFER_SIZE 65536 diff --git a/modules_k/sqlops/sql_trans.c b/modules_k/sqlops/sql_trans.c index 50ecc06..eaf3fb8 100644 --- a/modules_k/sqlops/sql_trans.c +++ b/modules_k/sqlops/sql_trans.c @@ -28,12 +28,11 @@ #include "../../mem/mem.h" #include "../../dprint.h" #include "../../trim.h" +#include "../../ut.h" #include "../../lib/kcore/strcommon.h" #include "sql_trans.h" -#define is_in_str(p, in) (p<in->s+in->len && *p) - #define TR_BUFFER_SIZE 2048 diff --git a/modules_k/textops/txt_var.c b/modules_k/textops/txt_var.c index c63e3a0..ca11a9e 100644 --- a/modules_k/textops/txt_var.c +++ b/modules_k/textops/txt_var.c @@ -29,11 +29,10 @@ #include "../../dprint.h" #include "../../trim.h" #include "../../re.h" +#include "../../ut.h" #include "txt_var.h" -#define is_in_str(p, in) (p<in->s+in->len && *p) - int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype, pv_value_t *val) { diff --git a/pvapi.c b/pvapi.c index 242093c..eb3069c 100644 --- a/pvapi.c +++ b/pvapi.c @@ -40,8 +40,6 @@ #include "pvapi.h" #include "pvar.h" -#define is_in_str(p, in) (p<in->s+in->len && *p) - #define PV_TABLE_SIZE 16 /*!< pseudo-variable table size */ #define TR_TABLE_SIZE 4 /*!< PV transformation size */ diff --git a/ut.h b/ut.h index 04ce934..eaec93f 100644 --- a/ut.h +++ b/ut.h @@ -158,6 +158,9 @@ *((_dest)++) = _c; +#define is_in_str(p, in) (p < in->s + in->len && *p) + + /* links a value to a msgid */ struct msgid_var{ union{
13 years, 3 months
1
0
0
0
git:master: core/pvapi: allow newline in parse_pvname_list()
by Alex Hermann
Module: sip-router Branch: master Commit: b7376fe2ed4d9df55183a827e393dcb4f7ab6a5b URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b7376fe…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 13:07:47 2011 +0200 core/pvapi: allow newline in parse_pvname_list() --- pvapi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/pvapi.c b/pvapi.c index eb3069c..d4104c2 100644 --- a/pvapi.c +++ b/pvapi.c @@ -1097,7 +1097,7 @@ pvname_list_t* parse_pvname_list(str *in, unsigned int type) p = in->s; while(is_in_str(p, in)) { - while(is_in_str(p, in) && (*p==' '||*p=='\t'||*p==','||*p==';')) + while(is_in_str(p, in) && (*p==' '||*p=='\t'||*p==','||*p==';'||*p=='\n')) p++; if(!is_in_str(p, in)) {
13 years, 3 months
1
0
0
0
git:master: modules_k/sqlops: fix typo in sql_parse_param()
by Alex Hermann
Module: sip-router Branch: master Commit: a470a5e5502fc677c4029d9a4870479676a6259c URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a470a5e…
Author: Alex Hermann <alex(a)speakup.nl> Committer: Alex Hermann <alex(a)speakup.nl> Date: Fri Aug 19 13:10:12 2011 +0200 modules_k/sqlops: fix typo in sql_parse_param() --- modules_k/sqlops/sql_api.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/modules_k/sqlops/sql_api.c b/modules_k/sqlops/sql_api.c index a61b00a..5924b8f 100644 --- a/modules_k/sqlops/sql_api.c +++ b/modules_k/sqlops/sql_api.c @@ -586,7 +586,7 @@ int sql_parse_param(char *val) return sql_init_con(&name, &tok); error: - LM_ERR("invalid htable parameter [%.*s] at [%d]\n", in.len, in.s, + LM_ERR("invalid sqlops parameter [%.*s] at [%d]\n", in.len, in.s, (int)(p-in.s)); return -1; }
13 years, 3 months
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
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