A
A
alexeu2014-08-13 22:15:17
Asterisk
alexeu, 2014-08-13 22:15:17

How to install multiple Asterisk on one server?

Good afternoon!
It would be desirable to launch 2 Asterisks on one VDS. VDS has 2 static IPs, one for each asterisk.
Bare Asterisk 1.8.12.2 installed on Debian 6.
Started by trying to run at least one asterisk from another folder.
To do this, I moved (not copied) asterisk.conf from /etc/asterisk to /etc/asterisk/ast1.
I added new directories for configs, folders, etc. to asterisk.conf:

[directories] 
astetcdir => /etc/asterisk/ast1 
astmoddir => /usr/lib/asterisk/ast1/modules 
astvarlibdir => /var/lib/asterisk/ast1 
astdbdir => /var/lib/asterisk/ast1 
astkeydir => /var/lib/asterisk/ast1 
astdatadir => /var/lib/asterisk/ast1 
astagidir => /var/lib/asterisk/ast1/agi-bin 
astspooldir => /var/spool/asterisk/ast1 
astrundir => /var/run/ast1 
astlogdir => /var/log/asterisk/ast1
Ну и дальше все за экранировано, как в стандартном.

Not exactly [directories](!), but [directories].
Accordingly, the folder structure hello in accordance with the prescribed. The files were moved, not copied.
Next, I unloaded the running asterisk from standard folders with the command:
service asterisk stop
I try to start using a non-standard directory key:
asterisk -C /etc/asterisk/ast1/asterisk.conf
The result of asterisk –rvvvv:
Asterisk 1.8.12.2, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
[email protected]:~#

As you can see, asterisk did not start. There are no config connection strings, such as those listed below:
== Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found

End.
For the sake of experiment, I tried the second option in order to understand the files from which directory asterisk accesses at startup and operation.
To do this, we leave all the files of the old (installed by default asteriska) in place and copy them to new folders like ast1.
We do not change the original asterisk.conf file (we just remove (!) in the [directories] line) and leave it in the /etc/asterisk/ folder. The asterisk.conf file copied to /etc/asterisk/ast1 looks like this:
[directories] 
astetcdir => /etc/asterisk/ast1 
astmoddir => /usr/lib/asterisk/ast1/modules 
astvarlibdir => /var/lib/asterisk/ast1 
astdbdir => /var/lib/asterisk/ast1 
astkeydir => /var/lib/asterisk/ast1 
astdatadir => /var/lib/asterisk/ast1 
astagidir => /var/lib/asterisk/ast1/agi-bin 
astspooldir => /var/spool/asterisk/ast1 
astrundir => /var/run/ast1 
astlogdir => /var/log/asterisk/ast1
Ну и дальше все за экранировано, как в стандартном.

Not exactly [directories](!), but [directories].
Accordingly, the folder structure was brought into line with the prescribed ones. I left the original files in place, copied them to the “ast1” folders in accordance with /etc/asterisk/ast1/asterisk.conf.
Next, I unloaded the running asterisk from standard folders with the command:
service asterisk stop
I try to start it using a non-standard directory key
asterisk -C /etc/asterisk/ast1/asterisk.conf
:
Asterisk 1.8.12.2, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
[email protected]:~#

As you can see, asterisk did not start, the following lines look very interesting against the background of the asterisk -C /etc/asterisk/ast1/asterisk.conf start command:
== Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/extconfig.conf':   == Found

The logic is not clear, we look at the next option.
Tried the third option. Compared to the second one, I only changed the /etc/asterisk/asterisk.conf file from the original asterisk.
We make the asterisk.conf files in /etc/asterisk/ast1 and /etc/asterisk/ the same, it looks like:
[directories] 
astetcdir => /etc/asterisk/ast1 
astmoddir => /usr/lib/asterisk/ast1/modules 
astvarlibdir => /var/lib/asterisk/ast1 
astdbdir => /var/lib/asterisk/ast1 
astkeydir => /var/lib/asterisk/ast1 
astdatadir => /var/lib/asterisk/ast1 
astagidir => /var/lib/asterisk/ast1/agi-bin 
astspooldir => /var/spool/asterisk/ast1 
astrundir => /var/run/ast1 
astlogdir => /var/log/asterisk/ast1
Ну и дальше все за экранировано, как в стандартном.

Not exactly [directories] (!), but [directories].
Next, I unloaded the running asterisk from standard folders with the command:
service asterisk stop
I try to start using a non-standard directory key:
asterisk -C /etc/asterisk/ast1/asterisk.conf
The result of asterisk –rvvvv:
Asterisk 1.8.12.2, Copyright (C) 1999 - 2012 Digium, Inc. and others.
Created by Mark Spencer <[email protected]>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf':   == Found
  == Parsing '/etc/asterisk/ast1/extconfig.conf':   == Found
Connected to Asterisk 1.8.12.2 currently running on Proba1 (pid = 7156)
Verbosity was 0 and is now 4
Proba1*CLI>

As you can see, asterisk has started. Files such as sip.conf are used from the new /etc/asterisk/ast1/ folder, but the following line again does not match the enable command:
== Parsing '/etc/asterisk/asterisk.conf':   == Found

The second matches:
== Parsing '/etc/asterisk/ast1/extconfig.conf':   == Found

I ask for advice.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
alekseu, 2014-08-14
@alekseu

Problem solved.
We start the daemon with an indication of where to get the configs:
And it broke into the console without specifying where to get the configs:
And you need to go to the console also with the path to the configuration:
So I saw that my asteriks is not working from the standard directory.

O
Oleg Voitenko, 2014-08-13
@OliverV

and what prevents you from deploying two virtual KVM machines on the server? and put your Asterisk on each. take dedicated and do it. on one VPS you will face a bunch of hemorrhoids.

V
Vladimir, 2014-08-14
@rostel

astmoddir you can not touch
asterisk -r also call with the -C switch

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question