we have a dedicated server and want to run a 2nd instance of asterisk mapped to another ip to run a ip-pbx for my brothers office. ideally also with it’s own freepbx frontend too. is this possible and what is the best way to do it ? must i use xen or is it possible just configuring asterisk to do this ?
copy all the contents of the /var/lib/asterisk directory in the new directory /var/lib/asterisk;
Check h323.conf, http.conf, iax.conf, manager.conf, mgcp.conf, sip.conf and skinny.conf and be sure that the Asterisk instance listen to a different ip or port respect to the other instances;
If the ip used is the same use different rtp ports per instance (rtp.conf);
copy all the contents of the /var/spool/asterisk directory in the new directory /var/spool/asterisk;
copy all the contents of the /var/log/asterisk directory in the new directory /var/log/asterisk;
create the directory /var/run/<instance
when you start Asterisk tell it where is the configuration file asterisk.conf with the -C parameter;
modifify the init script to pass the right parameters to Asterisk when starting it and to look for control files in the right subdirectories.
This is an extract from my docs, hope it helps you start.
vn ~ # /usr/sbin/asterisk -f -U asterisk -G asterisk -C /etc/asterisk_2/asterisk.conf
Privilege escalation protection disabled!
See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details.
Asterisk already running on /var/run/asterisk/asterisk.ctl. Use 'asterisk -r' to connect.
Trying to connect to the second Asterisk:
But this connects me to the first (and only running) Asterisk.
Some time ago I started several instances on FreeBSD. Now it CentOS 6.6.
I also tried to kill ‘safe_asterisk’ first and then start the 2nd instance.
And also tried killing ‘safe_asterisk’, then aserisk itself. Then starting Asterisk manually, not with init scripts (not with ‘service asterisk start’). Then starting the 2nd one with ‘-C /etc/asterisk_2/asteris.conf’.
But in all cases I get a message that Asterisk is already running.
You didn’t specify an alternative directory for the .ctl file. You will need alternative directories for at least the run directory and the ASTDB one, and I’d advise do so for the log directories.