antonraharja/playSMS — pull request #92 by lucastx (2013-08-01 04:54:25+00:00)
Title: Split kannel plugin's "bearerbox_host" config

This pull request splits 'bearerbox_host' option into two: one of the same
name, and 'sendsms_host'.

'bearerbox_host' should be the host as it appears to the web server that
hosts playSMS (HTTP_HOST)

'sendsms_host' should be the host of Kannel's `sendsms` HTTP interface.

The reason of the split
-----------------------

Kannel's gateway plugin has the option 'bearerbox_host', which should be
the IP address or hostname of the computer in which kannel runs.

This option is used in two separate occasions:

1. When playSMS sends a SMS through Kannel, it has to know which
IP/hostname to connect to, so it uses this option.

2. When kannel receives a SMS and forwards it to playSMS through the
sms-service group's `get-url` parameter, playSMS checks to see if the
HTTP_HOST that is accessing `geturl.php` is the same as the option.

This works fine on most occasions, but doesn't when these hosts are
different.

In my case, playSMS talks to Kannel's `sendsms` service -- the first
case -- uses the loopback interface (127.0.0.1) directly.

But the internet URL in the sms-service.conf's `get-url` option makes
Kannel use the internet IP to connect to playSMS.

I want to keep a minimum of ports exposed to the internet, and splitting
the option makes me need only one port open.

In all other "normal" cases, the solution is simply to put the same
addresses on both options -- this should not be a problem.