[sr-dev] [tracker] Comment added: registrar: memory and db get not synced

sip-router bugtracker at sip-router.org
Fri Nov 1 11:21:41 CET 2013


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 at 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 at 127.0.0.1:50602;ob
 3(6572) DEBUG: registrar [save.c:693]: update_contacts(): c contact:sip:testuser1003 at 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 at 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 at 127.0.0.1:6666;ob
 3(6572) DEBUG: registrar [save.c:693]: update_contacts(): c contact:sip:testuser1003 at 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.



More information about the sr-dev mailing list