<p></p>
<p dir="auto">Actually, I misread the code and it should return 2, the log:</p>
<pre class="notranslate"><code class="notranslate">Jun 24 17:14:52 ip-172-31-3-158 /usr/local/sbin/kamailio[49325]: DEBUG: {1 53491654 INVITE 00a98cb1-6e84-123b-fca2-069c0e3bf50e} sqlops [sql_api.c:494]: sql_exec_xquery(): no result after query
</code></pre>
<p dir="auto">It is from the file and line:</p>
<ul dir="auto">
<li><a href="https://github.com/kamailio/kamailio/blob/master/src/modules/sqlops/sql_api.c#L494">https://github.com/kamailio/kamailio/blob/master/src/modules/sqlops/sql_api.c#L494</a></li>
</ul>
<p dir="auto">It could be the IF evaluation, try:</p>
<pre class="notranslate"><code class="notranslate">sql_xquery("con", "SELECT * FROM sbc_uacreg WHERE l_uuid = '$hdr(X-Gateway)'", "ra");
if($rc == 1) {
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3163#issuecomment-1172262791">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJ5C33YCNTGXJR2S7TVR3LT7ANCNFSM5ZYPREVQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZK3LH6CRCNGXD23VM3VR3LT7A5CNFSM5ZYPREV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIXPU7BY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3163/1172262791</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3163#issuecomment-1172262791",
"url": "https://github.com/kamailio/kamailio/issues/3163#issuecomment-1172262791",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>