<p></p>

<h3>Description</h3>
<p>Kamailio's ims_usrloc_pcscf module fetches all contact informations from location table at startup.<br>
I noticed that it fails to fetch protocol information. I checked the function which reads the contact row:</p>
<p><a href="https://github.com/kamailio/kamailio/blob/c3629f877500373028d2c7cdefd976cddda31c15/src/modules/ims_usrloc_pcscf/udomain.c#L831">https://github.com/kamailio/kamailio/blob/c3629f877500373028d2c7cdefd976cddda31c15/src/modules/ims_usrloc_pcscf/udomain.c#L831</a></p>
<p>I saw that it is read the value as INT. Then checked database table and saw that protocol field is CHAR(5).<br>
<a href="https://github.com/kamailio/kamailio/blob/master/utils/kamctl/mysql/ims_usrloc_pcscf-create.sql">https://github.com/kamailio/kamailio/blob/master/utils/kamctl/mysql/ims_usrloc_pcscf-create.sql</a></p>
<pre><code>CREATE TABLE `location` (
...
  `protocol` char(5) DEFAULT NULL,
...
);
</code></pre>
<p>The protocol fields needs to be INT in location table as well.</p>
<p>This bug leads to other bugs because protocol information is used in aor_hash calculation.</p>
<p>Best regards<br>
Erhan Sendag</p>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Put a record in location table with protocol value as 1.<br>
Set  ims_usrloc_pcscf module parameter db_mode as 1.<br>
After kamailio startup, on debug log, protocol information will be seen as a big integer value.</p>
<h4>Debugging Data</h4>

<pre><code>(paste your debugging data here)
</code></pre>
<h4>Log Messages</h4>

<pre><code>(paste your log messages here)
</code></pre>
<h4>SIP Traffic</h4>

<pre><code>(paste your sip traffic here)
</code></pre>
<h3>Possible Solutions</h3>

<p>The protocol fields can be defined as INT in location table.</p>
<h3>Additional Information</h3>
<ul>
<li><strong>Kamailio Version</strong> - output of <code>kamailio -v</code></li>
</ul>
<pre><code>(paste your output here)
</code></pre>
<ul>
<li><strong>Operating System</strong>:</li>
</ul>

<pre><code>(paste your output here)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/2871">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJT6YJFMLY5KNEZDGDUFQEZ7ANCNFSM5FN5ZSFA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/ABO7UZKA3FAFHXYLBSDFHKLUFQEZ7A5CNFSM5FN5ZSFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4PFKXFJQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/2871",
"url": "https://github.com/kamailio/kamailio/issues/2871",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>