THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Daniel-Constantin Mierla (miconda)
----------
Second patch doesn't seem good. The memset on &ci should set to 0 the instance and received.
I think the fields that are are set out of the IF block:
<code>
if (_m!=0) {
...
}
</code>
have to be reset. Like:
<code>
if (_m!=0) {
...
+} else {
+ memset( &ci.instance, 0, sizeof(str));
}
</code>
I am not sure if received has to be reset. From a quick look over the code, it can be taken from and avp, which is done first time. If ci.received is reset, probably received_found has to be reset as well. That code about setting ci.received seems to need a bit of a review. I can do it once you do the patches about the issues you found (once they are ready).
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1143
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Víctor Seva (linuxmaniac)
----------
This second patch fixes this issue. The static value was not properly cleaned.
<code>
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5173-1-0..From: <sip:testuser1003@spce.test>;tag=517
3SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5173@127.0.0.1..CSeq: 1 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:6666;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5173-1-0..From: <sip:testuser1003@spce.test>;tag=5173SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.30a0..Call-ID: 1-5173@127.0.0.1..CSeq: 1 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:6666;ob>;expires=600;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linux
))..Content-Length: 0....
#
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5179-1-0..From: <sip:testuser1003@spce.test>;tag=517
9SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5179@127.0.0.1..CSeq: 3 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:50602;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Contact: "TestBria" <sip:testuser1003@127.0.0.1:6666;ob
>;expires=0..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5179-1-0..From: <sip:testuser1003@spce.test>;tag=5179SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.ba64..Call-ID: 1-5179@127.0.0.1..CSeq: 3 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:50602;ob>;expires=600;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linu
x))..Content-Length: 0....
</code>
----------
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1142
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#355 - presence_dialoginfo to send initial NOTIFY with body
User who did this - Daniel-Constantin Mierla (miconda)
----------
Can you make the patch for master branch? In can be backported from there into the stable versions.
Also, remove the code that is not used anymore -- putting it in comments or in between #if 0 ... #endif makes it unmanageable over the time.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=355#comment1141
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Daniel-Constantin Mierla (miconda)
----------
Check the ci to see if has instance value set - maybe is kept from previous contact via pack_ci(), which uses some static variables.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1140
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Víctor Seva (linuxmaniac)
----------
<code>
3(5964) DEBUG: registrar [save.c:682]: update_contacts(): aor <testuser1003> expires:1383300931
3(5964) DEBUG: <core> [sruid.c:176]: sruid_next(): new sruid is [uloc-52737cde-174c-1] (1 / 20)
3(5964) DEBUG: registrar [save.c:408]: pack_ci(): generated ruid is: uloc-52737cde-174c-1
3(5964) DEBUG: usrloc [ucontact.c:1063]: db_update_ucontact_instance(): instance:<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>
3(5964) DEBUG: usrloc [ucontact.c:1070]: db_update_ucontact_instance(): reg-id:1
3(5964) DEBUG: usrloc [ucontact.c:1167]: db_update_ucontact_instance(): contact:sip:testuser1003@127.0.0.1:50602;ob
3(5964) DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: update location set expires=?1,q=?2,cseq=?3,flags=?4,cflags=?5,user_agent=?6,received=?7,path=?8,socket=?9,methods=?10,last_modified=?11,callid=?12,contact=?13 where instance=?14 AND reg_id=?15
3(5964) DEBUG: registrar [save.c:682]: update_contacts(): aor <testuser1003> expires:0
3(5964) DEBUG: <core> [sruid.c:176]: sruid_next(): new sruid is [uloc-52737cde-174c-2] (2 / 20)
3(5964) DEBUG: registrar [save.c:408]: pack_ci(): generated ruid is: uloc-52737cde-174c-2
3(5964) DEBUG: usrloc [ucontact.c:1497]: uldb_delete_attrs(): trying to delete location attributes
3(5964) DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: delete from location where username=?1 AND contact=?2 AND callid=?3
</code>
No that is not the problem. I think the problem is at registrar update_contacts:
<code>
_c = get_first_contact(_m);
updated=0;
for( ; _c ; _c = get_next_contact(_c) ) {
/* calculate expires */
calc_contact_expires(_m, _c->expires, &expires);
LM_DBG("aor <%.*s> expires:%d\n", _r->aor.len,_r->aor.s, expires);
/* pack the contact info */
if ( (ci=pack_ci( 0, _c, expires, 0, _use_regid))==0 ) {
LM_ERR("failed to pack contact specific info\n");
goto error;
}
/* search for the contact*/
LM_DBG("_c contact:%.*s\n", _c->uri.len, _c->uri.s);
ret = ul.get_ucontact_by_instance( _r, &_c->uri, ci, &c);
LM_DBG("c contact:%.*s\n", c->c.len, c->c.s);
if (ret==-1) {
LM_ERR("invalid cseq for aor <%.*s>\n",_r->aor.len,_r->aor.s);
rerrno = R_INV_CSEQ;
goto error;
} else if (ret==-2) {
if(expires!=0 && _mode)
break;
continue;
}
</code>
ul.get_ucontact_by_instance returns the wrong contact for the second contact...
<code>
3(6572) DEBUG: registrar [save.c:682]: update_contacts(): aor <testuser1003> expires:1383301645
3(6572) DEBUG: <core> [sruid.c:176]: sruid_next(): new sruid is [uloc-52737fb0-19ac-1] (1 / 20)
3(6572) DEBUG: registrar [save.c:408]: pack_ci(): generated ruid is: uloc-52737fb0-19ac-1
3(6572) DEBUG: registrar [save.c:691]: update_contacts(): _c contact:sip:testuser1003@127.0.0.1:50602;ob
3(6572) DEBUG: registrar [save.c:693]: update_contacts(): c contact:sip:testuser1003@127.0.0.1:6666;ob
3(6572) DEBUG: usrloc [ucontact.c:1063]: db_update_ucontact_instance(): instance:<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>
3(6572) DEBUG: usrloc [ucontact.c:1070]: db_update_ucontact_instance(): reg-id:1
3(6572) DEBUG: usrloc [ucontact.c:1167]: db_update_ucontact_instance(): contact:sip:testuser1003@127.0.0.1:50602;ob
3(6572) DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: update location set expires=?1,q=?2,cseq=?3,flags=?4,cflags=?5,user_agent=?6,received=?7,path=?8,socket=?9,methods=?10,last_modified=?11,callid=?12,contact=?13 where instance=?14 AND reg_id=?15
3(6572) DEBUG: registrar [save.c:682]: update_contacts(): aor <testuser1003> expires:0
3(6572) DEBUG: <core> [sruid.c:176]: sruid_next(): new sruid is [uloc-52737fb0-19ac-2] (2 / 20)
3(6572) DEBUG: registrar [save.c:408]: pack_ci(): generated ruid is: uloc-52737fb0-19ac-2
3(6572) DEBUG: registrar [save.c:691]: update_contacts(): _c contact:sip:testuser1003@127.0.0.1:6666;ob
3(6572) DEBUG: registrar [save.c:693]: update_contacts(): c contact:sip:testuser1003@127.0.0.1:50602;ob
3(6572) DEBUG: usrloc [ucontact.c:1497]: uldb_delete_attrs(): trying to delete location attributes
3(6572) DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: delete from location where username=?1 AND contact=?2 AND callid=?3
</code>
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1139
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Daniel-Constantin Mierla (miconda)
----------
The problem can be in other place, because the Contact URI addresses don't match:
<code>
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5438-1-0..From: <sip:testuser1003@spce.test>;tag=543
8SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5438@127.0.0.1..CSeq: 3 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:50602;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Contact: "TestBria" <sip:testuser1003@127.0.0.1:6666;ob
>;expires=0..Expires: 600..Max-Forwards: 70..Content-Length: 0....
</code>
So even when updating by address, then the second contact should not affect the first one.
Add some debug message to see if the first contact doesn't get expires=0 mistakenly.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1138
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Víctor Seva (linuxmaniac)
----------
But we still have the initial problem
<code>
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5432-1-0..From: <sip:testuser1003@spce.test>;tag=543
2SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5432@127.0.0.1..CSeq: 1 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:6666;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5432-1-0..From: <sip:testuser1003@spce.test>;tag=5432SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.841e..Call-ID: 1-5432@127.0.0.1..CSeq: 1 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:6666;ob>;expires=600;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linux
))..Content-Length: 0....
#
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5438-1-0..From: <sip:testuser1003@spce.test>;tag=543
8SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5438@127.0.0.1..CSeq: 3 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:50602;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Contact: "TestBria" <sip:testuser1003@127.0.0.1:6666;ob
>;expires=0..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5438-1-0..From: <sip:testuser1003@spce.test>;tag=5438SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.0eda..Call-ID: 1-5438@127.0.0.1..CSeq: 3 REGISTER..Server: kamailio (4.1.0-pre0
(x86_64/linux))..Content-Length: 0....
</code>
Result on no location at all. But if I split the second register in two:
<code>
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5460-1-0..From: <sip:testuser1003@spce.test>;tag=546
0SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5460@127.0.0.1..CSeq: 1 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:6666;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5460-1-0..From: <sip:testuser1003@spce.test>;tag=5460SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.743e..Call-ID: 1-5460@127.0.0.1..CSeq: 1 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:6666;ob>;expires=600;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linux
))..Content-Length: 0....
#
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5466-1-0..From: <sip:testuser1003@spce.test>;tag=546
6SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5466@127.0.0.1..CSeq: 3 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:50602;ob>;reg-id=1;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>"..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5466-1-0..From: <sip:testuser1003@spce.test>;tag=5466SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.fd8d..Call-ID: 1-5466@127.0.0.1..CSeq: 3 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:50602;ob>;expires=600;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linu
x))..Content-Length: 0....
#
U 127.0.0.1:50602 -> 127.0.0.1:5060
REGISTER sip:testuser1003@spce.test SIP/2.0..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5472-1-0..From: <sip:testuser1003@spce.test>;tag=547
2SIPpTag001..To: "TestBria" <sip:testuser1003@spce.test>..Call-ID: 1-5472@127.0.0.1..CSeq: 4 REGISTER..Contact: "TestBria" <sip:testuser1003@127.
0.0.1:6666;ob>;expires=0..Expires: 600..Max-Forwards: 70..Content-Length: 0....
#
U 127.0.0.1:5060 -> 127.0.0.1:50602
SIP/2.0 200 OK..Via: SIP/2.0/UDP 127.0.0.1:50602;branch=z9hG4bK-5472-1-0..From: <sip:testuser1003@spce.test>;tag=5472SIPpTag001..To: "TestBria" <
sip:testuser1003@spce.test>;tag=b27e1a1d33761e85846fc98f5f3a7e58.4e1f..Call-ID: 1-5472@127.0.0.1..CSeq: 4 REGISTER..Contact: <sip:testuser1003@12
7.0.0.1:50602;ob>;expires=598;+sip.instance="<urn:uuid:C3DD6013-20E8-40E3-8EA2-5849B02ED0C4>";reg-id=1..Server: kamailio (4.1.0-pre0 (x86_64/linu
x))..Content-Length: 0....
</code>
All is fine in memory and in db.
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1137
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#351 - registrar: memory and db get not synced
User who did this - Víctor Seva (linuxmaniac)
----------
Are you saying something like this?
<code>
@@ -1032,7 +1226,12 @@ int db_update_ucontact_ruid(ucontact_t* _c)
int db_update_ucontact(ucontact_t* _c)
{
if(ul_db_ops_ruid==0)
- return db_update_ucontact_addr(_c);
+ if (_c->instance.len<=0) {
+ return db_update_ucontact_addr(_c);
+ }
+ else {
+ return db_update_ucontact_instance(_c);
+ }
else
return db_update_ucontact_ruid(_c);
}
</code>
----------
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=351#comment1136
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#350 - pua_reginfo: Duplicate contacts in the location table
User who did this - Daniel-Constantin Mierla (miconda)
----------
The patch doesn't look good. It removes and adds some files.
Just clone the git repo, edit the file inside that source code directory, then do:
git diff >/path/to/file.patch
----------
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=350#comment1135
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.