<p>Hi Daniel!</p>

<p>have the same errors in logs (as in first post) in kamailio-4.2.5<br>
Tried your patch suggested here, have <a href="https://github.com/kamailio/kamailio/issues/345#issuecomment-153397799">the same result as sternik</a></p>

<p>Added the check for "from_tag", now my test code looks like:</p>

<pre><code>--- pua.c   (revision 30772)
+++ pua.c   (working copy)
@@ -1112,8 +1112,24 @@
                        q_vals[puri_col].val.str_val = *(p->pres_uri);
                        q_vals[pid_col].val.str_val = p->id;
                        q_vals[flag_col].val.int_val = p->flag;
-                       q_vals[callid_col].val.str_val = p->call_id;
-                       q_vals[fromtag_col].val.str_val = p->from_tag;
+
+                       if(p->call_id.s) {
+                           LM_DBG("p->callid = %.*s\n", p->call_id.len, p->call_id.s);
+                           q_vals[callid_col].val.str_val = p->call_id;
+                       } else {
+                           LM_DBG("p->callid is empty\n");
+                           q_vals[callid_col].val.str_val.s = "";
+                           q_vals[callid_col].val.str_val.len = 0;
+                       }
+                           if(p->from_tag.s) {
+                           LM_DBG("p->from_tag = %.*s\n", p->from_tag.len, p->from_tag.s);
+                           q_vals[fromtag_col].val.str_val = p->from_tag;
+                       } else {
+                           LM_DBG("p->from_tag is empty\n");
+                           q_vals[fromtag_col].val.str_val.s = "";
+                           q_vals[fromtag_col].val.str_val.len = 0;
+                       }
+
</code></pre>

<p>testing this I get read of initial errors, now the log looks like:</p>

<pre><code>Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1111]: db_update(): INSERTDB_FLAG
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1119]: db_update(): p->callid is empty
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1131]: db_update(): p->from_tag is empty
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: insert into pua (pres_uri,pres_id,flag,event,watcher_uri,call_id,to_tag,from_tag,etag,tuple_id,cseq,expires,desired_expires,record_route,contact,remote_contact,version,extra_headers ) values (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12,?13,?14,?15,?16,?17,?18)
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1111]: db_update(): INSERTDB_FLAG
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1119]: db_update(): p->callid is empty
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: pua [pua.c:1131]: db_update(): p->from_tag is empty
Dec 18 15:35:58 /usr/sbin/kamailio[15101]: DEBUG: db_sqlite [dbase.c:183]: db_sqlite_submit_query(): submit_query: insert into pua (pres_uri,pres_id,flag,event,watcher_uri,call_id,to_tag,from_tag,etag,tuple_id,cseq,expires,desired_expires,record_route,contact,remote_contact,version,extra_headers ) values (?1,?2,?3,?4,?5,?6,?7,?8,?9,?10,?11,?12,?13,?14,?15,?16,?17,?18)
</code></pre>

<p>Now, as I understood, the suggested patch, is not for release usage?<br>
Do you have explanation, why the callid and from_tag could be empty?<br>
Do you need any additional info or testing?</p>

<p>Cheers!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/kamailio/kamailio/issues/345#issuecomment-165793474">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQMK1jyT0GTxUKqxsgdvdQehXHrVks5pRBLLgaJpZM4GDIh4.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/kamailio/kamailio/issues/345#issuecomment-165793474"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>