[sr-dev] [kamailio/kamailio] listen option in cfg cannot contain `dns` in the advertise portion (#1854)

niallmcandrew notifications at github.com
Sat Feb 16 03:09:47 CET 2019


### Description

When setting `listen` with `advertise` in the configuration file the advertise section cannot contain an address that has the string `dns` within it. If at any point the domain used in advertise contains the three letters consecutively without being broken by a hypen or a dot it causes the parser to fail, see logging below.

I tried quoting the string but it didn't seam to parse properly. It interpenetrated the full thing as the listen address portion.

### Troubleshooting

#### Reproduction

Add any advertise address to the config file with the string dns.
e.g.
```
listen=tcp:127.0.0.1:5060 advertise sip.dns.example.com:5060
```

Also using it in the `advertised_address` section without quotes causes the error. 
```
advertised_address=sip.dns.example.com:5060
```

#### Log Messages

``````
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: syntax error                              
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: invalid host or interface name            
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 43-45: ip address, interface name or hostname expected
 0(98) CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 62, column 47-54:                                           
ERROR: bad config file (4 errors)
```

### Possible Solutions

A solution could be to use the a `advertised_address` though the cookbook states that this could be deprecated in future and that the `listen` config parameter is preferred.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.2.1 (x86_64/linux)
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, 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_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 6.3.0
```

* **Operating System**:



Running in Debian container image.
```
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Linux 1498e1ef835d 4.20.6-arch1-1-ARCH #1 SMP PREEMPT Thu Jan 31 08:22:01 UTC 2019 x86_64 GNU/Linux
```


-- 
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/1854
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20190215/a9bb8759/attachment.html>


More information about the sr-dev mailing list