<h3>Description</h3>
<p>I'm trying to set call redirection to another sip server.<br>
But now i receive only error. Check reproduction and logs section.</p>
<p>On client side: in softphone i try to call: <code>z#8888</code></p>
<h3>Troubleshooting</h3>
<p>From server's ssh:</p>
<pre><code>root@serv:~# ping sip.zadarma.com
PING sip.zadarma.com (185.45.152.174) 56(84) bytes of data.
64 bytes from sipbalancer-2.fr.zadarma.com (185.45.152.174): icmp_seq=1 ttl=59 time=0.746 ms
64 bytes from sipbalancer-2.fr.zadarma.com (185.45.152.174): icmp_seq=2 ttl=59 time=0.839 ms
64 bytes from sipbalancer-2.fr.zadarma.com (185.45.152.174): icmp_seq=3 ttl=59 time=0.852 ms
64 bytes from sipbalancer-2.fr.zadarma.com (185.45.152.174): icmp_seq=4 ttl=59 time=0.827 ms
^C
</code></pre>
<h4>Reproduction</h4>
<p>In my <code>kamailio.cfg</code>:</p>
<pre><code>...
request_route {
    if($rU=~"^(z\#)[0-9][0-9]{1,20}$"){
        # get normal DestNum without prefix
        $var(nuu) = $(var(nu){s.strip,2});

        #set FROM Caller ID /TEST/
        # @TODO: Set from callerID HERE
        $fU = "74951277197";

        # new sip uri
        $ru = "sip:" + $var(nuu) + "@sip.zadarma.com";
        route(RELAY);
    }
...
</code></pre>
<h4>Log Messages</h4>
<p>kamailio.log:</p>
<pre><code>Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: <core> [core/resolve.c:1710]: sip_hostport2su(): could not resolve hostname: "@sip.zadarma.com"
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "@sip.zadarma.com"
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: tm [t_fwd.c:1735]: t_forward_nonack(): failure to add branches
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: sl [sl_funcs.c:362]: sl_reply_error(): stateless error reply used: Unresolvable destination (478/SL)
</code></pre>
<p>same in syslog:</p>
<pre><code>Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: <core> [core/resolve.c:1710]: sip_hostport2su(): could not resolve hostname: "@sip.zadarma.com"
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "@sip.zadarma.com"
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: tm [t_fwd.c:1735]: t_forward_nonack(): failure to add branches
Feb 15 21:30:13 serv /usr/sbin/kamailio[20999]: ERROR: sl [sl_funcs.c:362]: sl_reply_error(): stateless error reply used: Unresolvable destination (478/SL)

</code></pre>
<h3>Additional Information</h3>
<p>System:</p>
<pre><code>Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
</code></pre>
<p>kernel:</p>
<pre><code>Linux server.com 4.4.0-67-generic #88-Ubuntu SMP Wed Mar 8 16:34:45 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
</code></pre>
<p>Kamailio version:</p>
<pre><code>version: kamailio 5.1.1 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 5.3.1
</code></pre>
<p>Kamailio is running on ports:</p>
<pre><code>tcp:5060
udp:5060
tls: 20060
tcp: 20059
</code></pre>
<h3>Thoughts</h3>
<p>Maybe i have some mistakes in my kamailio config? Or something with DNS lookup permissions for kamailio?</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/1443">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZZJIiV9WYdAnJNJvzWJ7AhvGpKssks5tVH7rgaJpZM4SHV2f">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZRS_XZb0I9BNYA9-oxXKn6Kzfuc6ks5tVH7rgaJpZM4SHV2f.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/1443"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"could not resolve hostname (#1443)"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1443"}}}</script>