[sr-dev] [kamailio/kamailio] could not resolve hostname (#1443)

Fyodor notifications at github.com
Thu Feb 15 20:01:00 CET 2018


### Description
I'm trying to set call redirection to another sip server.
But now i receive only error. Check reproduction and logs section.

On client side: in softphone i try to call: `z#8888` 

### Troubleshooting

>From server's ssh:
```
root at 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
```

#### Reproduction

In my `kamailio.cfg`:
```
...
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);
    }
...
```
#### Log Messages

kamailio.log:
```
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)
```

same in syslog:
```
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)

```

### Additional Information

System:
```
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
```

kernel:
```
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
```

Kamailio version:
```
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
```

Kamailio is running on ports:
```
tcp:5060
udp:5060
tls: 20060
tcp: 20059
```

### Thoughts
Maybe i have some mistakes in my kamailio config? Or something with DNS lookup permissions for kamailio?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1443
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180215/18b276d2/attachment-0001.html>


More information about the sr-dev mailing list