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
July 2015
----- 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
26 participants
301 discussions
Start a n
N
ew thread
git:4.1:10c1c00e: pua_reginfo: use ruid to fix comparation of contact
by Victor Seva
Module: kamailio Branch: 4.1 Commit: 10c1c00ed184fc3d13a0b244618a32151ec403ed URL:
https://github.com/kamailio/kamailio/commit/10c1c00ed184fc3d13a0b244618a321…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:21:00+02:00 pua_reginfo: use ruid to fix comparation of contact (ptr == c) is always false. Using ruid instead. (cherry picked from commit 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/10c1c00ed184fc3d13a0b244618a321…
Patch:
https://github.com/kamailio/kamailio/commit/10c1c00ed184fc3d13a0b244618a321…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 8c45763..d4e9d5f 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -102,10 +102,14 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { buf_len = snprintf(buf, sizeof(buf), "%p", record); xmlNewProp(registration_node, BAD_CAST "id", BAD_CAST buf); + LM_DBG("Updated Contact %.*s[%.*s]\n", c->c.len, c->c.s, + c->ruid.len, c->ruid.s); + ptr = record->contacts; while (ptr) { if (VALID_CONTACT(ptr, cur_time)) { - LM_DBG("Contact %.*s, %p\n", ptr->c.len, ptr->c.s, ptr); + LM_DBG("Contact %.*s[%.*s]\n", ptr->c.len, ptr->c.s, + ptr->ruid.len, ptr->ruid.s); /* Contact-Node */ contact_node =xmlNewChild(registration_node, NULL, BAD_CAST "contact", NULL) ; if( contact_node ==NULL) { @@ -116,7 +120,9 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { buf_len = snprintf(buf, sizeof(buf), "%p", ptr); xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf); /* Check, if this is the modified contact: */ - if (ptr == c) { + if ((c->ruid.len == ptr->ruid.len) && + !memcmp(c->ruid.s, ptr->ruid.s, c->ruid.len)) + { if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE)) { reg_active = 1; xmlNewProp(contact_node, BAD_CAST "state", BAD_CAST "active");
9 years, 5 months
1
0
0
0
git:4.1:bb16ed70: pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord
by Victor Seva
Module: kamailio Branch: 4.1 Commit: bb16ed70ed07b51f08a2abc2582ee61ea1cc4fb8 URL:
https://github.com/kamailio/kamailio/commit/bb16ed70ed07b51f08a2abc2582ee61…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:21:00+02:00 pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord (cherry picked from commit 63bd356cc3c7aa64d64361283f630f88b8db88af) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/bb16ed70ed07b51f08a2abc2582ee61…
Patch:
https://github.com/kamailio/kamailio/commit/bb16ed70ed07b51f08a2abc2582ee61…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 8587889..8c45763 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -219,9 +219,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { str content_type; udomain_t * domain; urecord_t * record; + ucontact_t* _c = NULL; int res; str uri = {NULL, 0}; - str user = {NULL, 0}; char* at = NULL; char id_buf[512]; @@ -246,9 +246,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { LM_ERR("Unknown Type %i\n", type); return; } - /* make a local copy of the AOR */ - user.len = c->aor->len; - user.s = c->aor->s; /* Get the UDomain for this account */ res = ul.get_udomain(c->domain->s, &domain); @@ -257,10 +254,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { return; } - /* Get the URecord for this AOR */ - res = ul.get_urecord(domain, &user, &record); - if (res > 0) { - LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); + /* Get the URecord for this ruid */ + res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid), + &record, &_c); + if (res < 0) { + LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); return; }
9 years, 5 months
1
0
0
0
git:4.2:547f1489: pua_reginfo: use ruid to fix comparation of contact
by Victor Seva
Module: kamailio Branch: 4.2 Commit: 547f1489cb51a3c72dba72adaa1f6df5429f425e URL:
https://github.com/kamailio/kamailio/commit/547f1489cb51a3c72dba72adaa1f6df…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:20:23+02:00 pua_reginfo: use ruid to fix comparation of contact (ptr == c) is always false. Using ruid instead. (cherry picked from commit 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/547f1489cb51a3c72dba72adaa1f6df…
Patch:
https://github.com/kamailio/kamailio/commit/547f1489cb51a3c72dba72adaa1f6df…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 6f68e03..e1abef9 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -102,10 +102,14 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { buf_len = snprintf(buf, sizeof(buf), "%p", record); xmlNewProp(registration_node, BAD_CAST "id", BAD_CAST buf); + LM_DBG("Updated Contact %.*s[%.*s]\n", c->c.len, c->c.s, + c->ruid.len, c->ruid.s); + ptr = record->contacts; while (ptr) { if (VALID_CONTACT(ptr, cur_time)) { - LM_DBG("Contact %.*s, %p\n", ptr->c.len, ptr->c.s, ptr); + LM_DBG("Contact %.*s[%.*s]\n", ptr->c.len, ptr->c.s, + ptr->ruid.len, ptr->ruid.s); /* Contact-Node */ contact_node =xmlNewChild(registration_node, NULL, BAD_CAST "contact", NULL) ; if( contact_node ==NULL) { @@ -116,7 +120,9 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { buf_len = snprintf(buf, sizeof(buf), "%p", ptr); xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf); /* Check, if this is the modified contact: */ - if (ptr == c) { + if ((c->ruid.len == ptr->ruid.len) && + !memcmp(c->ruid.s, ptr->ruid.s, c->ruid.len)) + { if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE)) { reg_active = 1; xmlNewProp(contact_node, BAD_CAST "state", BAD_CAST "active");
9 years, 5 months
1
0
0
0
git:4.2:eb97d380: pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord
by Victor Seva
Module: kamailio Branch: 4.2 Commit: eb97d380a2fca3b9ce30596aad9493bc11cd5d8d URL:
https://github.com/kamailio/kamailio/commit/eb97d380a2fca3b9ce30596aad9493b…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:20:23+02:00 pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord (cherry picked from commit 63bd356cc3c7aa64d64361283f630f88b8db88af) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/eb97d380a2fca3b9ce30596aad9493b…
Patch:
https://github.com/kamailio/kamailio/commit/eb97d380a2fca3b9ce30596aad9493b…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 0164a67..6f68e03 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -219,9 +219,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { str content_type; udomain_t * domain; urecord_t * record; + ucontact_t* _c = NULL; int res; str uri = {NULL, 0}; - str user = {NULL, 0}; char* at = NULL; char id_buf[512]; @@ -246,9 +246,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { LM_ERR("Unknown Type %i\n", type); return; } - /* make a local copy of the AOR */ - user.len = c->aor->len; - user.s = c->aor->s; /* Get the UDomain for this account */ res = ul.get_udomain(c->domain->s, &domain); @@ -257,10 +254,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { return; } - /* Get the URecord for this AOR */ - res = ul.get_urecord(domain, &user, &record); - if (res > 0) { - LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); + /* Get the URecord for this ruid */ + res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid), + &record, &_c); + if (res < 0) { + LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); return; }
9 years, 5 months
1
0
0
0
git:4.3:6e6f679c: pua_reginfo: use ruid to fix comparation of contact
by Victor Seva
Module: kamailio Branch: 4.3 Commit: 6e6f679c7d7894bd0e268581022ed111c33384c5 URL:
https://github.com/kamailio/kamailio/commit/6e6f679c7d7894bd0e268581022ed11…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:19:40+02:00 pua_reginfo: use ruid to fix comparation of contact (ptr == c) is always false. Using ruid instead. (cherry picked from commit 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/6e6f679c7d7894bd0e268581022ed11…
Patch:
https://github.com/kamailio/kamailio/commit/6e6f679c7d7894bd0e268581022ed11…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 0c68cec..95ec762 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -101,10 +101,14 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", record); xmlNewProp(registration_node, BAD_CAST "id", BAD_CAST buf); + LM_DBG("Updated Contact %.*s[%.*s]\n", c->c.len, c->c.s, + c->ruid.len, c->ruid.s); + ptr = record->contacts; while (ptr) { if (VALID_CONTACT(ptr, cur_time)) { - LM_DBG("Contact %.*s, %p\n", ptr->c.len, ptr->c.s, ptr); + LM_DBG("Contact %.*s[%.*s]\n", ptr->c.len, ptr->c.s, + ptr->ruid.len, ptr->ruid.s); /* Contact-Node */ contact_node =xmlNewChild(registration_node, NULL, BAD_CAST "contact", NULL) ; if( contact_node ==NULL) { @@ -115,7 +119,9 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", ptr); xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf); /* Check, if this is the modified contact: */ - if (ptr == c) { + if ((c->ruid.len == ptr->ruid.len) && + !memcmp(c->ruid.s, ptr->ruid.s, c->ruid.len)) + { if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE)) { reg_active = 1; xmlNewProp(contact_node, BAD_CAST "state", BAD_CAST "active");
9 years, 5 months
1
0
0
0
git:4.3:9a6d8d2b: pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord
by Victor Seva
Module: kamailio Branch: 4.3 Commit: 9a6d8d2bffe13b442ed5e880fb0dd2c6572c29e2 URL:
https://github.com/kamailio/kamailio/commit/9a6d8d2bffe13b442ed5e880fb0dd2c…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-16T09:19:40+02:00 pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord (cherry picked from commit 63bd356cc3c7aa64d64361283f630f88b8db88af) --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/9a6d8d2bffe13b442ed5e880fb0dd2c…
Patch:
https://github.com/kamailio/kamailio/commit/9a6d8d2bffe13b442ed5e880fb0dd2c…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 6b8cd68..0c68cec 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -218,9 +218,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { str content_type; udomain_t * domain; urecord_t * record; + ucontact_t* _c = NULL; int res; str uri = {NULL, 0}; - str user = {NULL, 0}; char* at = NULL; char id_buf[512]; @@ -245,9 +245,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { LM_ERR("Unknown Type %i\n", type); return; } - /* make a local copy of the AOR */ - user.len = c->aor->len; - user.s = c->aor->s; /* Get the UDomain for this account */ res = ul.get_udomain(c->domain->s, &domain); @@ -256,10 +253,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { return; } - /* Get the URecord for this AOR */ - res = ul.get_urecord(domain, &user, &record); - if (res > 0) { - LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); + /* Get the URecord for this ruid */ + res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid), + &record, &_c); + if (res < 0) { + LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); return; }
9 years, 5 months
1
0
0
0
git:master:8f3caea2: Merge pull request #247 from kamailio/vseva/pua_reginfo
by ng-voice GmbH
Module: kamailio Branch: master Commit: 8f3caea21172893abb3f6be8856058f41f2bb17f URL:
https://github.com/kamailio/kamailio/commit/8f3caea21172893abb3f6be8856058f…
Author: ng-voice GmbH <carsten(a)ng-voice.com> Committer: ng-voice GmbH <carsten(a)ng-voice.com> Date: 2015-07-15T21:36:04+02:00 Merge pull request #247 from kamailio/vseva/pua_reginfo pua_reginfo: fix NOTIFY xml --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/8f3caea21172893abb3f6be8856058f…
Patch:
https://github.com/kamailio/kamailio/commit/8f3caea21172893abb3f6be8856058f…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 6b8cd68..95ec762 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -101,10 +101,14 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", record); xmlNewProp(registration_node, BAD_CAST "id", BAD_CAST buf); + LM_DBG("Updated Contact %.*s[%.*s]\n", c->c.len, c->c.s, + c->ruid.len, c->ruid.s); + ptr = record->contacts; while (ptr) { if (VALID_CONTACT(ptr, cur_time)) { - LM_DBG("Contact %.*s, %p\n", ptr->c.len, ptr->c.s, ptr); + LM_DBG("Contact %.*s[%.*s]\n", ptr->c.len, ptr->c.s, + ptr->ruid.len, ptr->ruid.s); /* Contact-Node */ contact_node =xmlNewChild(registration_node, NULL, BAD_CAST "contact", NULL) ; if( contact_node ==NULL) { @@ -115,7 +119,9 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", ptr); xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf); /* Check, if this is the modified contact: */ - if (ptr == c) { + if ((c->ruid.len == ptr->ruid.len) && + !memcmp(c->ruid.s, ptr->ruid.s, c->ruid.len)) + { if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE)) { reg_active = 1; xmlNewProp(contact_node, BAD_CAST "state", BAD_CAST "active"); @@ -218,9 +224,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { str content_type; udomain_t * domain; urecord_t * record; + ucontact_t* _c = NULL; int res; str uri = {NULL, 0}; - str user = {NULL, 0}; char* at = NULL; char id_buf[512]; @@ -245,9 +251,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { LM_ERR("Unknown Type %i\n", type); return; } - /* make a local copy of the AOR */ - user.len = c->aor->len; - user.s = c->aor->s; /* Get the UDomain for this account */ res = ul.get_udomain(c->domain->s, &domain); @@ -256,10 +259,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { return; } - /* Get the URecord for this AOR */ - res = ul.get_urecord(domain, &user, &record); - if (res > 0) { - LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); + /* Get the URecord for this ruid */ + res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid), + &record, &_c); + if (res < 0) { + LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); return; }
9 years, 5 months
1
0
0
0
git:master:7d31d78e: pua_reginfo: use ruid to fix comparation of contact
by Victor Seva
Module: kamailio Branch: master Commit: 7d31d78e3ac861cddfcb70c9940242ec7f3f0dbc URL:
https://github.com/kamailio/kamailio/commit/7d31d78e3ac861cddfcb70c9940242e…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-15T16:00:03+02:00 pua_reginfo: use ruid to fix comparation of contact (ptr == c) is always false. Using ruid instead. --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/7d31d78e3ac861cddfcb70c9940242e…
Patch:
https://github.com/kamailio/kamailio/commit/7d31d78e3ac861cddfcb70c9940242e…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 0c68cec..95ec762 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -101,10 +101,14 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", record); xmlNewProp(registration_node, BAD_CAST "id", BAD_CAST buf); + LM_DBG("Updated Contact %.*s[%.*s]\n", c->c.len, c->c.s, + c->ruid.len, c->ruid.s); + ptr = record->contacts; while (ptr) { if (VALID_CONTACT(ptr, cur_time)) { - LM_DBG("Contact %.*s, %p\n", ptr->c.len, ptr->c.s, ptr); + LM_DBG("Contact %.*s[%.*s]\n", ptr->c.len, ptr->c.s, + ptr->ruid.len, ptr->ruid.s); /* Contact-Node */ contact_node =xmlNewChild(registration_node, NULL, BAD_CAST "contact", NULL) ; if( contact_node ==NULL) { @@ -115,7 +119,9 @@ str* build_reginfo_full(urecord_t * record, str uri, ucontact_t* c, int type) { snprintf(buf, sizeof(buf), "%p", ptr); xmlNewProp(contact_node, BAD_CAST "id", BAD_CAST buf); /* Check, if this is the modified contact: */ - if (ptr == c) { + if ((c->ruid.len == ptr->ruid.len) && + !memcmp(c->ruid.s, ptr->ruid.s, c->ruid.len)) + { if ((type & UL_CONTACT_INSERT) || (type & UL_CONTACT_UPDATE)) { reg_active = 1; xmlNewProp(contact_node, BAD_CAST "state", BAD_CAST "active");
9 years, 5 months
1
0
0
0
git:master:63bd356c: pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord
by Victor Seva
Module: kamailio Branch: master Commit: 63bd356cc3c7aa64d64361283f630f88b8db88af URL:
https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f8…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2015-07-15T15:51:26+02:00 pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord --- Modified: modules/pua_reginfo/usrloc_cb.c --- Diff:
https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f8…
Patch:
https://github.com/kamailio/kamailio/commit/63bd356cc3c7aa64d64361283f630f8…
--- diff --git a/modules/pua_reginfo/usrloc_cb.c b/modules/pua_reginfo/usrloc_cb.c index 6b8cd68..0c68cec 100644 --- a/modules/pua_reginfo/usrloc_cb.c +++ b/modules/pua_reginfo/usrloc_cb.c @@ -218,9 +218,9 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { str content_type; udomain_t * domain; urecord_t * record; + ucontact_t* _c = NULL; int res; str uri = {NULL, 0}; - str user = {NULL, 0}; char* at = NULL; char id_buf[512]; @@ -245,9 +245,6 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { LM_ERR("Unknown Type %i\n", type); return; } - /* make a local copy of the AOR */ - user.len = c->aor->len; - user.s = c->aor->s; /* Get the UDomain for this account */ res = ul.get_udomain(c->domain->s, &domain); @@ -256,10 +253,11 @@ void reginfo_usrloc_cb(ucontact_t* c, int type, void* param) { return; } - /* Get the URecord for this AOR */ - res = ul.get_urecord(domain, &user, &record); - if (res > 0) { - LM_ERR("' %.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); + /* Get the URecord for this ruid */ + res = ul.get_urecord_by_ruid(domain, ul.get_aorhash(c->aor), &(c->ruid), + &record, &_c); + if (res < 0) { + LM_ERR("'%.*s (%.*s)' Not found in usrloc\n", c->aor->len, c->aor->s, c->domain->len, c->domain->s); return; }
9 years, 5 months
1
0
0
0
[kamailio] pua_reginfo: fix NOTIFY xml (#247)
by Victor Seva
Before the changes the xml was always the same: UL_CONTACT_UPDATE -> state="active" event="registered" ``` Jul 15 13:48:14 sp1 proxy[25780]: DEBUG: pua_reginfo [usrloc_cb.c:240]: reginfo_usrloc_cb(): AOR: 88835677110000(a)A.A.A.A (location) Jul 15 13:48:14 sp1 proxy[25780]: DEBUG: pua_reginfo [usrloc_cb.c:242]: reginfo_usrloc_cb(): type= UL_CONTACT_UPDATE Jul 15 13:48:14 sp1 proxy[25780]: DEBUG: pua_reginfo [usrloc_cb.c:108]: build_reginfo_full(): Contact sip:88835677110000@D.D.D.D:35315;transport=TLS;ob, 0x7f916090ce38 Jul 15 13:48:14 sp1 proxy[25780]: DEBUG: pua_reginfo [usrloc_cb.c:296]: reginfo_usrloc_cb(): XML-Body:#012<?xml version="1.0"?>#012<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">#012 <registration aor="sip:88835677110000@A.A.A.A" id="0x7f9224e47260" state="active">#012 <contact id="0x7f916090ce38" state="active" event="registered" expires="300" callid="KlIcAz1dRJNMn-Le.83MbT8tqGFZ4nXp" cseq="35175" received="sip:B.B.B.B:44214;transport=tls" path="<sip:lb@C.C.C.C;lr;received=sip:B.B.B.B:44214%3Btransport%3Dtls;socket=sip:A.A.A.A:5061>" user_agent="forfoneSip r1 / hammerhead-22">#012 <uri>sip:88835677110000@D.D.D.D:35315;transport=TLS;ob</uri>#012 </contact>#012 </registration>#012</reginfo>#012 Jul 15 13:48:14 sp1 proxy[25780]: DEBUG: pua_reginfo [usrloc_cb.c:298]: reginfo_usrloc_cb(): Contact sip:88835677110000@D.D.D.D:35315;transport=TLS;ob, 0x7f916090c908 ``` UL_CONTACT_DELETE -> state="active" event="registered" ``` Jul 15 13:49:29 sp1 proxy[25775]: DEBUG: pua_reginfo [usrloc_cb.c:240]: reginfo_usrloc_cb(): AOR: 88835677220000(a)A.A.A.A (location) Jul 15 13:49:29 sp1 proxy[25775]: DEBUG: pua_reginfo [usrloc_cb.c:244]: reginfo_usrloc_cb(): type= UL_CONTACT_DELETE Jul 15 13:49:29 sp1 proxy[25775]: DEBUG: pua_reginfo [usrloc_cb.c:108]: build_reginfo_full(): Contact sip:88835677220000@E.E.E.E:55323;transport=TLS;ob, 0x7f916090d360 Jul 15 13:49:29 sp1 proxy[25775]: DEBUG: pua_reginfo [usrloc_cb.c:296]: reginfo_usrloc_cb(): XML-Body:#012<?xml version="1.0"?>#012<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">#012 <registration aor="sip:88835677220000@A.A.A.A" id="0x7f9224e47260" state="active">#012 <contact id="0x7f916090d360" state="active" event="registered" expires="153" callid="tx2XjrkuqYlZ44PfliHvGEK4Her3IYcU" cseq="38095" received="sip:F.F.F.F:55323;transport=tls" path="<sip:lb@C.C.C.C;lr;received=sip:F.F.F.F:55323%3Btransport%3Dtls;socket=sip:A.A.A.A:5061>" user_agent="forfoneSip r1 / mako-22">#012 <uri>sip:88835677220000@E.E.E.E:55323;transport=TLS;ob</uri>#012 </contact>#012 </registration>#012</reginfo>#012 Jul 15 13:49:29 sp1 proxy[25775]: DEBUG: pua_reginfo [usrloc_cb.c:298]: reginfo_usrloc_cb(): Contact sip:88835677220000@E.E.E.E:55323;transport=TLS;ob, 0x7f916090ce38 ``` After changes: UL_CONTACT_DELETE -> state="terminated" event="unregistered" ``` Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:248]: reginfo_usrloc_cb(): AOR: 88835677110000(a)A.A.A.A (location) Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:252]: reginfo_usrloc_cb(): type= UL_CONTACT_DELETE Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:106]: build_reginfo_full(): Updated Contact sip:88835677110000@B.B.B.B:58446;transport=TLS;ob[uloc-55a66069-1c88-4], 0x7f6cb06f2170 Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:112]: build_reginfo_full(): Contact sip:88835677110000@B.B.B.B:58446;transport=TLS;ob[uloc-55a66069-1c88-4], 0x7f6cb06f2170 Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:304]: reginfo_usrloc_cb(): XML-Body:#012<?xml version="1.0"?>#012<reginfo xmlns="urn:ietf:params:xml:ns:reginfo" version="0" state="full">#012 <re gistration aor="sip:88835677110000@A.A.A.A" id="0x7f6d74c44260" state="terminated">#012 <contact id="0x7f6cb073b0c0" state="terminated" event="unregistered" expires="163" callid="bpTyIZoJHDoF1edNqQ9oHmEgT7 tBEq25" cseq="20241" received="sip:C.C.C.C:54129;transport=tls" path="<sip:lb@F.F.F.F;lr;received=sip:C.C.C.C:54129%3Btransport%3Dtls;socket=sip:A.A.A.A:5061>" user_agent="forfoneSip r1 / hammerhead-22">#012 <uri>sip:88835677110000@B.B.B.B:58446;transport=TLS;ob</uri>#012 </contact>#012 </registration>#012</reginfo>#012 Jul 15 15:44:04 sp1 proxy[7305]: DEBUG: pua_reginfo [usrloc_cb.c:306]: reginfo_usrloc_cb(): Contact sip:88 835677110000@B.B.B.B:58446;transport=TLS;ob, 0x7f6cb073ab90 ``` UL_CONTACT_UPDATE -> state="active" event="refreshed" You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/247
-- Commit Summary -- * pua_reginfo: use ul.get_urecord_by_ruid instead of ul.get_urecord * pua_reginfo: use ruid to fix comparation of contact -- File Changes -- M modules/pua_reginfo/usrloc_cb.c (24) -- Patch Links --
https://github.com/kamailio/kamailio/pull/247.patch
https://github.com/kamailio/kamailio/pull/247.diff
--- Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/247
9 years, 5 months
3
2
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
31
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
31
Results per page:
10
25
50
100
200