[sr-dev] [kamailio/kamailio] Hostname only (no ports) in the advertise parameter should be allowed (#1884)

jklingenmeyer notifications at github.com
Fri Mar 8 09:51:57 CET 2019


### Description

The `advertise` option in a `listen` parameter seems to only allow the following syntax:
`advertise ip_or_host:port`
The `advertise ip_or_host` syntax is not allowed and gives the following error:
> CRITICAL: <core> [core/cfg.y:3507]: yyerror_at(): parse error in config file /etc/kamailio/kamailio.cfg, line 49, column 1-6: ip address, interface name or hostname expected

This can be blocking when using DNS SRV features in order to retrieve both host and port to send the SIP messages: when a port is present in the record-route/via headers no DNS SRV are done.
So it prevents from doing some DNS-based load-balancing / failover things.

### Troubleshooting

We get the same behaviour with using the deprecated `advertised_address` parameter: default port is set by Kamailio (because it is not possible to force a _null_ value for  `advertised_port`) in the _Via_ header (but does not seem to affect the _R-R_ header).
The advertised address can only be forced for the _Record-Route_ header using the `record_route_advertised_address` function in the script.

### Additional Information

Tested with last Kamailio release on Debian 9.8

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


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


More information about the sr-dev mailing list