<p></p>
<p>I just tested with this configuration file:</p>
<pre><code>#!KAMAILIO

debug=2
children=2

listen=udp:0.0.0.0:8280

loadmodule "pv.so"
#!substdef "/BASE_HOST/$env(BASE_HOST)/"

alias="BASE_HOST"

loadmodule "jsonrpcs.so"
loadmodule "sl.so"
loadmodule "corex.so"
loadmodule "kex.so"

request_route {
        # ...
        if (uri!=myself) {
                sl_send_reply("403","Not relaying");
                exit;
        }
        sl_send_reply("200", "OK");

        exit;
}
</code></pre>
<p>Then:</p>
<pre><code>export BASE_HOST=lab01.asipto.com
</code></pre>
<p>Started kamailio and used sipsak to push a request:</p>
<pre><code>sipsak -p 127.0.0.1 -r 8280 -s sip:lab01.asipto.com -vvv
</code></pre>
<p>And I got 200ok, so myself matched, logs showing that as well:</p>
<pre><code>1(19850) DEBUG: <core> [core/parser/msg_parser.c:152]: get_hdr_field(): cseq <CSeq>: <1> <OPTIONS>
 1(19850) DEBUG: <core> [core/receive.c:324]: receive_msg(): --- received sip message - request - call-id: [2107224131@192.168.178.75] - cseq: [1 OPTIONS]
 1(19850) DEBUG: <core> [core/receive.c:379]: receive_msg(): preparing to run routing scripts...
 1(19850) DEBUG: <core> [core/socket_info.c:646]: grep_sock_info(): checking if host==us: 20==7 && [lab01.asipto.com] == [0.0.0.0]
 1(19850) DEBUG: <core> [core/socket_info.c:649]: grep_sock_info(): checking if port 8280 (advertise 0) matches port 5060
 1(19850) DEBUG: <core> [core/name_alias.h:64]: grep_aliases(): matching (0:lab01.asipto.com:5060) vs. (0:lab01.asipto.com:0)
 1(19850) DEBUG: <core> [core/forward.c:422]: check_self(): host (0:lab01.asipto.com:5060) == me
</code></pre>
<p>I used master for seend the debug messages, but the alias value is taken in cosideration via the environment variable. Closing this one, if still an issue, reopen and provide the logs with latest master branch.</p>

<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/2310#issuecomment-627312475">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZJC5M3ZVD3ALFE25T3RRE6ORANCNFSM4MVSIDMQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZNXF4NEUFHOAX2XTGTRRE6ORA5CNFSM4MVSIDM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEVSAOWY.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/2310#issuecomment-627312475",
"url": "https://github.com/kamailio/kamailio/issues/2310#issuecomment-627312475",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>