<p>I'm trying to configure opensips (2.2 dev) to save usrlocation on a dbtext, in order to keep after a restart of opensips all the contact already registered.</p>

<p>I've followed the documentation but after having created dbtext, opensips fails to start with the following errors:</p>

<p>Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_load_file: request for table [location]<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_load_file: db is [/usr/etc/opensips/dbtext/opensips]<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_load_file: loading file [/usr/etc/opensips/dbtext/opensips/location]<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_table_new: mtime is 1440574657<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_load_file: column[0] is BIGINT!<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: DBG:db_text:dbt_load_file: error at row=0 col=0 c=a<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: ERROR:db_text:dbt_query: table 'location' does not exist!<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: ERROR:usrloc:testdb_udomain: failure in db_query<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: ERROR:usrloc:register_udomain: testing domain 'location' failed<br>
Aug 26 09:37:57 dev2-c2m-el4 /usr/sbin/opensips[26886]: ERROR:registrar:domain_fixup: failed to register domain</p>

<p>It seems that the DB schema is wrong.<br>
The following is the location file generated by the opensipsdbctl:</p>

<p>contact_id(long,auto) username(string) domain(string) contact(string) received(string,null) path(string,null) expires(int) q(double) callid(string) cseq(int) last_modified(int) flags(int) cflags(string,null) user_agent(string) socket(string,null) methods(int,null) sip_instance(string,null) attr(string,null)</p>

<p>I've tried to change the contact_id using the int type and allowing domain to accept null string:</p>

<p>contact_id(int,auto) username(string) domain(string,null) contact(string) received(string,null) path(string,null) expires(int) q(double) callid(string) cseq(int) last_modified(int) flags(int) cflags(string,null) user_agent(string) socket(string,null) methods(int,null) sip_instance(string,null) attr(string,null)</p>

<p>Using the previous schema, opensips successfully starts and contacts are written on it, but when opensips restarts, the reload fails with the following errors:</p>

<p>DBG:core:db_allocate_rows: allocate 16072 bytes for result rows and values at 0xb7d9b07c<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:usrloc:preload_udomain: loading records - cycle [1]<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:evi_param_set: adding string param<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:destroy_avp_list: destroying list (nil)<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: ERROR:usrloc:preload_udomain: failed to match aorhashes for user b2buaepchat1,db aorhash [0] new aorhash [170],db contactid [1376]<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:usrloc:preload_udomain: release bogus urecord<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:evi_param_set: adding string param<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:destroy_avp_list: destroying list (nil)<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:evi_param_set: adding string param<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: DBG:core:destroy_avp_list: destroying list (nil)<br>
Aug 26 09:51:10 dev2-c2m-el4 /usr/sbin/opensips[432]: ERROR:usrloc:preload_udomain: failed to match aorhashes for user siprpin2,db aorhash [0] new aorhash [191],db contactid [1536]</p>

<p>Can you help me?</p>

<p>Thank you</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/issues/617">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOciSvSWL_i3ldpOAQOzqvbq5OGzbJDks5orWhsgaJpZM4FyWMq.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/issues/617"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>