All,
The Kamailio-Asterisk
integration that is described here
is limited
to Asterisk servers with a fixed IP address. The reason is
that Kamailio identifies and authorizes traffic from Asterisk
based on the source IP address. Attached is a patch to
kamailio.cfg that adds support for dynamic Asterisk hosts. It
introduces the option to define a fully-qualified domain name
instead of the IP address to identify the Asterisk server. The
host name can be dynamically updated to always point at the
(changing) IP address of the Asterisk server. Defining
WITH_ASTERISK_FQDN enables the new option.
When
WITH_ASTERISK_FQDN is set, Kamailio will perform a DNS search
on the host name in the asterisk.bindhost variable. It will
authorize incoming traffic if it originates from one of the IP
addresses the DNS lookup returns (and matches the
asterisk.bindport variable as before).
Furthermore,
the patch introduce the option to automatically set the IP
address of the server that Kamailio is running on. This does
away with the need to properly define kamailio.bindip on every
server that the configuration is running on. This option is
enabled by defining WITH_AUTOIP.
With the
suggested changes I have been able to successfully run an
Asterisk server in my home, having a dynamic public IP address
and connecting to the Kamailio proxy on a VPS server with a
static IP addres.
Please let
me know if you have any comments or suggestions.
Kind
regards,
Rudy
Eschauzier.