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 2021
----- 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
12 participants
287 discussions
Start a n
N
ew thread
git:master:80c906d5: core: ut - functions to convert from str to long
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 80c906d5418ece5e4a3e993cc632a0e6ae3d24be URL:
https://github.com/kamailio/kamailio/commit/80c906d5418ece5e4a3e993cc632a0e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-03T08:00:32+02:00 core: ut - functions to convert from str to long --- Modified: src/core/ut.h --- Diff:
https://github.com/kamailio/kamailio/commit/80c906d5418ece5e4a3e993cc632a0e…
Patch:
https://github.com/kamailio/kamailio/commit/80c906d5418ece5e4a3e993cc632a0e…
--- diff --git a/src/core/ut.h b/src/core/ut.h index 4ab08024a7..61ff696e13 100644 --- a/src/core/ut.h +++ b/src/core/ut.h @@ -628,69 +628,88 @@ static inline void strlower(str* _s) } +#define str2unval(_s, _r) do { \ + int i; \ + if (_r == NULL) return -1; \ + *_r = 0; \ + if (_s == NULL) return -1; \ + if (_s->len < 0) return -1; \ + if (_s->s == NULL) return -1; \ + for(i = 0; i < _s->len; i++) { \ + if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { \ + *_r *= 10; \ + *_r += _s->s[i] - '0'; \ + } else { \ + return -1; \ + } \ + } \ + return 0; \ + } while(0) + /* - * Convert a str into integer + * Convert an str to unsigned long */ -static inline int str2int(str* _s, unsigned int* _r) +static inline int str2ulong(str* _s, unsigned long* _r) { - int i; + str2unval(_s, _r); +} - if (_r == NULL) return -1; - *_r = 0; - if (_s == NULL) return -1; - if (_s->len < 0) return -1; - if (_s->s == NULL) return -1; +/* + * Convert an str to unsigned integer + */ +static inline int str2int(str* _s, unsigned int* _r) +{ + str2unval(_s, _r); +} - for(i = 0; i < _s->len; i++) { - if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { - *_r *= 10; - *_r += _s->s[i] - '0'; - } else { - return -1; - } - } +#define str2snval(_s, _r) do { \ + int i; \ + int sign; \ + if (_s == NULL) return -1; \ + if (_r == NULL) return -1; \ + if (_s->len < 0) return -1; \ + if (_s->s == NULL) return -1; \ + *_r = 0; \ + sign = 1; \ + i = 0; \ + if (_s->s[0] == '+') { \ + i++; \ + } else if (_s->s[0] == '-') { \ + sign = -1; \ + i++; \ + } \ + for(; i < _s->len; i++) { \ + if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { \ + *_r *= 10; \ + *_r += _s->s[i] - '0'; \ + } else { \ + return -1; \ + } \ + } \ + *_r *= sign; \ + return 0; \ + } while(0) - return 0; +/* + * Convert an str to signed long + */ +static inline int str2slong(str* _s, long* _r) +{ + str2snval(_s, _r); } + /* * Convert an str to signed integer */ static inline int str2sint(str* _s, int* _r) { - int i; - int sign; - - if (_s == NULL) return -1; - if (_r == NULL) return -1; - if (_s->len < 0) return -1; - if (_s->s == NULL) return -1; - - *_r = 0; - sign = 1; - i = 0; - if (_s->s[0] == '+') { - i++; - } else if (_s->s[0] == '-') { - sign = -1; - i++; - } - for(; i < _s->len; i++) { - if ((_s->s[i] >= '0') && (_s->s[i] <= '9')) { - *_r *= 10; - *_r += _s->s[i] - '0'; - } else { - return -1; - } - } - *_r *= sign; - - return 0; + str2snval(_s, _r); } /* - * Convert a str into integer + * Convert an strz to integer */ static inline int strz2int(char* _s, unsigned int* _r) { @@ -713,7 +732,7 @@ static inline int strz2int(char* _s, unsigned int* _r) } /* - * Convert an str to signed integer + * Convert an strz to signed integer */ static inline int strz2sint(char* _s, int* _r) {
3 years, 7 months
1
0
0
0
git:master:201c219a: lost: error response fix in lost_function(), lost_held_dereference() and lost_held_function()
by Wolfgang Kampichler
Module: kamailio Branch: master Commit: 201c219a5496924e701cc2b17fb0a439ee530813 URL:
https://github.com/kamailio/kamailio/commit/201c219a5496924e701cc2b17fb0a43…
Author: Wolfgang Kampichler <dev(a)kampichler.info> Committer: Wolfgang Kampichler <dev(a)kampichler.info> Date: 2021-05-02T17:28:44+02:00 lost: error response fix in lost_function(), lost_held_dereference() and lost_held_function() - error variable was set to 0 (clean up) before return. Lost functions now returns 500 in case of LOST/HELD server error, or 400 in case of internal error, otherwise 2xx. --- Modified: src/modules/lost/functions.c Modified: src/modules/lost/response.c Modified: src/modules/lost/response.h --- Diff:
https://github.com/kamailio/kamailio/commit/201c219a5496924e701cc2b17fb0a43…
Patch:
https://github.com/kamailio/kamailio/commit/201c219a5496924e701cc2b17fb0a43…
3 years, 7 months
1
0
0
0
git:master:824920d5: topos_redis: use initial transaction method for early dialog branch loading
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 824920d5b159d80ce3c241313bf647b5dbbf6661 URL:
https://github.com/kamailio/kamailio/commit/824920d5b159d80ce3c241313bf647b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-01T14:38:36+02:00 topos_redis: use initial transaction method for early dialog branch loading --- Modified: src/modules/topos_redis/topos_redis_storage.c --- Diff:
https://github.com/kamailio/kamailio/commit/824920d5b159d80ce3c241313bf647b…
Patch:
https://github.com/kamailio/kamailio/commit/824920d5b159d80ce3c241313bf647b…
--- diff --git a/src/modules/topos_redis/topos_redis_storage.c b/src/modules/topos_redis/topos_redis_storage.c index d63543dc38..c2d43b4c33 100644 --- a/src/modules/topos_redis/topos_redis_storage.c +++ b/src/modules/topos_redis/topos_redis_storage.c @@ -588,6 +588,7 @@ int tps_redis_load_initial_method_branch(sip_msg_t *msg, tps_data_t *md, tps_dat str skey = STR_NULL; str sval = STR_NULL; str xuuid = str_init(""); + str smethod = str_init("INVITE"); if(msg==NULL || md==NULL || sd==NULL) return -1; @@ -622,12 +623,17 @@ int tps_redis_load_initial_method_branch(sip_msg_t *msg, tps_data_t *md, tps_dat xuuid.len = sd->b_uuid.len - 1; } + if(md->s_method_id & (METHOD_SUBSCRIBE|METHOD_NOTIFY)) { + smethod.s = "SUBSCRIBE"; + smethod.len =9; + } + rp = _tps_redis_cbuf; rkey.len = snprintf(rp, TPS_REDIS_DATA_SIZE, "%.*s%.*s:%.*s:%.*s:x%.*s", _tps_redis_bprefix.len, _tps_redis_bprefix.s, - md->s_method.len, md->s_method.s, + smethod.len, smethod.s, md->a_callid.len, md->a_callid.s, md->b_tag.len, md->b_tag.s, xuuid.len, xuuid.s); @@ -1161,15 +1167,11 @@ int tps_redis_update_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd, return -1; } - if(md->s_method.len==6 && strncmp(md->s_method.s, "INVITE", 6)==0) { - if(tps_redis_insert_initial_method_branch(md, sd)<0) { - LM_ERR("failed to insert INVITE extra branch data\n"); - return -1; - } - } - if(md->s_method.len==9 && strncmp(md->s_method.s, "SUBSCRIBE", 9)==0) { + if(md->s_method_id==METHOD_INVITE + || md->s_method_id==METHOD_SUBSCRIBE) { if(tps_redis_insert_initial_method_branch(md, sd)<0) { - LM_ERR("failed to insert SUBSCRIBE extra branch data\n"); + LM_ERR("failed to insert %.*s extra initial branch data\n", + md->s_method.len, md->s_method.s); return -1; } }
3 years, 7 months
1
0
0
0
git:master:7b3a33d8: topos_redis: use also stored record to get uuid for branch replies
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 7b3a33d88ae3e3bbef88294720aa21ba34118b8e URL:
https://github.com/kamailio/kamailio/commit/7b3a33d88ae3e3bbef88294720aa21b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-01T13:28:32+02:00 topos_redis: use also stored record to get uuid for branch replies --- Modified: src/modules/topos_redis/topos_redis_storage.c --- Diff:
https://github.com/kamailio/kamailio/commit/7b3a33d88ae3e3bbef88294720aa21b…
Patch:
https://github.com/kamailio/kamailio/commit/7b3a33d88ae3e3bbef88294720aa21b…
3 years, 7 months
1
0
0
0
git:master:b798fda3: pkg: small spelling fix in comments
by Henning Westerholt
Module: kamailio Branch: master Commit: b798fda339b74e9595d2a5d44af9835ec196ca3e URL:
https://github.com/kamailio/kamailio/commit/b798fda339b74e9595d2a5d44af9835…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2021-05-01T08:17:28Z pkg: small spelling fix in comments --- Modified: pkg/kamailio/deb/debian/backports/precise Modified: pkg/kamailio/deb/debian/backports/wheezy --- Diff:
https://github.com/kamailio/kamailio/commit/b798fda339b74e9595d2a5d44af9835…
Patch:
https://github.com/kamailio/kamailio/commit/b798fda339b74e9595d2a5d44af9835…
--- diff --git a/pkg/kamailio/deb/debian/backports/precise b/pkg/kamailio/deb/debian/backports/precise index 8b060e0956..27dc6c6122 100755 --- a/pkg/kamailio/deb/debian/backports/precise +++ b/pkg/kamailio/deb/debian/backports/precise @@ -91,7 +91,7 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ ruby/' ${DIST}/rules # no python3 for app_python3 sed -i -e '/python3-dev/d' -e '/^Package: kamailio-python3-modules/,/^$/d' \ ${DIST}/control -# this removes python3 from Package: kamalio +# this removes python3 from Package: kamailio sed -i -e '/python3/d' ${DIST}/control # add that again sed -i '/lsb-base,/a \ python3,' ${DIST}/control diff --git a/pkg/kamailio/deb/debian/backports/wheezy b/pkg/kamailio/deb/debian/backports/wheezy index 95180221f0..d08477b0ad 100755 --- a/pkg/kamailio/deb/debian/backports/wheezy +++ b/pkg/kamailio/deb/debian/backports/wheezy @@ -91,7 +91,7 @@ sed -i -e '/^EXTRA_EXCLUDED_MODULES=/s/$/ ruby/' ${DIST}/rules # no python3 for app_python3 sed -i -e '/python3-dev/d' -e '/^Package: kamailio-python3-modules/,/^$/d' \ ${DIST}/control -# this removes python3 from Package: kamalio +# this removes python3 from Package: kamailio sed -i -e '/python3/d' ${DIST}/control # add that again sed -i '/lsb-base,/a \ python3,' ${DIST}/control
3 years, 7 months
1
0
0
0
topos_redis enhancement
by Juha Heinanen
Daniel, I studied a bit topos_redis source and noticed that it lacks x_context td and tt keys. Is there something else missing in order to make spirals work also when redis backend is in use? -- Juha
3 years, 7 months
2
4
0
0
git:master:5707f9ef: topos_redis: use uuid for initial transaction indexing
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: 5707f9ef7f6a0d9b9bcd00ff85168b977591a30a URL:
https://github.com/kamailio/kamailio/commit/5707f9ef7f6a0d9b9bcd00ff85168b9…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-01T08:07:08+02:00 topos_redis: use uuid for initial transaction indexing --- Modified: src/modules/topos_redis/topos_redis_storage.c --- Diff:
https://github.com/kamailio/kamailio/commit/5707f9ef7f6a0d9b9bcd00ff85168b9…
Patch:
https://github.com/kamailio/kamailio/commit/5707f9ef7f6a0d9b9bcd00ff85168b9…
--- diff --git a/src/modules/topos_redis/topos_redis_storage.c b/src/modules/topos_redis/topos_redis_storage.c index 5f0fda701e..78013993fe 100644 --- a/src/modules/topos_redis/topos_redis_storage.c +++ b/src/modules/topos_redis/topos_redis_storage.c @@ -314,6 +314,7 @@ int tps_redis_insert_initial_method_branch(tps_data_t *td) redisc_server_t *rsrv = NULL; redisReply *rrpl = NULL; unsigned long lval = 0; + str xuuid = str_init(""); if(td->x_vbranch1.len<=0) { LM_INFO("no via branch for this message\n"); @@ -331,13 +332,22 @@ int tps_redis_insert_initial_method_branch(tps_data_t *td) memset(argvlen, 0, TPS_REDIS_NR_KEYS * sizeof(size_t)); argc = 0; + if(td->a_uuid.len>1) { + xuuid.s = td->a_uuid.s + 1; + xuuid.len = td->a_uuid.len - 1; + } else if(td->b_uuid.len>1) { + xuuid.s = td->b_uuid.s + 1; + xuuid.len = td->b_uuid.len - 1; + } + rp = _tps_redis_cbuf; rkey.len = snprintf(rp, TPS_REDIS_DATA_SIZE-128, - "%.*s%.*s:%.*s:%.*s", + "%.*s%.*s:%.*s:%.*s:x%.*s", _tps_redis_bprefix.len, _tps_redis_bprefix.s, td->s_method.len, td->s_method.s, td->a_callid.len, td->a_callid.s, - td->b_tag.len, td->b_tag.s); + td->b_tag.len, td->b_tag.s, + xuuid.len, xuuid.s); if(rkey.len<0 || rkey.len>=TPS_REDIS_DATA_SIZE-128) { LM_ERR("error or insufficient buffer size: %d\n", rkey.len); return -1; @@ -571,6 +581,7 @@ int tps_redis_load_initial_method_branch(sip_msg_t *msg, tps_data_t *md, tps_dat redisReply *rrpl = NULL; str skey = STR_NULL; str sval = STR_NULL; + str xuuid = str_init(""); if(msg==NULL || md==NULL || sd==NULL) return -1; @@ -591,14 +602,23 @@ int tps_redis_load_initial_method_branch(sip_msg_t *msg, tps_data_t *md, tps_dat memset(argvlen, 0, TPS_REDIS_NR_KEYS * sizeof(size_t)); argc = 0; + if(md->a_uuid.len>1) { + xuuid.s = md->a_uuid.s + 1; + xuuid.len = md->a_uuid.len - 1; + } else if(md->b_uuid.len>1) { + xuuid.s = md->b_uuid.s + 1; + xuuid.len = md->b_uuid.len - 1; + } + rp = _tps_redis_cbuf; rkey.len = snprintf(rp, TPS_REDIS_DATA_SIZE, - "%.*s%.*s:%.*s:%.*s", + "%.*s%.*s:%.*s:%.*s:x%.*s", _tps_redis_bprefix.len, _tps_redis_bprefix.s, md->s_method.len, md->s_method.s, md->a_callid.len, md->a_callid.s, - md->b_tag.len, md->b_tag.s); + md->b_tag.len, md->b_tag.s, + xuuid.len, xuuid.s); if(rkey.len<0 || rkey.len>=TPS_REDIS_DATA_SIZE) { LM_ERR("error or insufficient buffer size: %d\n", rkey.len); return -1;
3 years, 7 months
1
0
0
0
← Newer
1
...
26
27
28
29
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
Results per page:
10
25
50
100
200