Setting up multiple servers is fairly straight forward and this note attempts to explain what you need to do.
Asterisk and A2Billing must be installed on each server as A2billing uses the local php files to process the calls.
There are two elements to this exercise. Firstly the database, and secondly the SIP and IAX additional.conf files
The database is pretty straight forward and is merely a case of pointing the slave servers to the master database.
Such as shown below
A2billing.conf
[database]
hostname = 192.168.10.118
port = 5432
user = a2buser
password = a2bpass
dbname = mya2billing
;dbtype = postgres
dbtype = mysql
IP 192.168.10.118 being the remote database. Make sure that you set the db permissions to allow access from the remote host
The second part is a little more complex. You need to synchronize the .conf files, so when you add/delete/change users via the UI, these changes get replicated.
The way I do it, is the use the Rsync program. This will copy any changes across the network. It’s very efficient as it only copies the differential.
On each slave machine you setup rsync to run every five minutes to sync with the master server
You’ll need to setup permissions, so have a read of the rsync docs. Below is an example of the command line
/usr/bin/rsync -v -t --exclude=sip.conf --exclude= a2billing.conf --exclude=manager.conf --exclude=iax.conf --progress --partial rsync://[email protected]/asterisk /etc/asterisk >/dev/null 2>&1
Of note, I’m excluding some files, the reason being that these are specific to a server
192.168.10.118 is the master machine, so it’s a pull rather than push operation
Finally you need to reload asterisk. Don’t set this too often as it’s been known to hang asterisk, so I set mine to happen every 15 minutes and only during working hours
/usr/sbin/asterisk -rx 'reload' > /dev/null 2> /dev/null
That’s pretty much it.
Regards