[Asterisk-Dev] Multi asterisk installation

Andy lists at automated.it
Tue May 3 02:47:49 MST 2005


On 03/05/2005 at 11:31 Marcin wrote:

>project I design needs 2 running asterisks with different configurations
>running on one machine, binded too different ports of course. Have anyone
>tried this before ? Any ideas how to do it ?
>
>The sipmle problem I've ,,meet is that already running asterisk does not
>let the second one to start. so the simple solution using 2x asterisk -C
><config file> is not working.
>Alsoe start_daemon is not helpfull.
>

The first problem you'll probably encounter is in /var/run - asterisk creates:

asterisk.ctl
asterisk.pid 

You could modify the code to pick up what it uses for those from a config. 

asterisk/asterisk.c:                      snprintf((char *)ast_config_AST_SOCKET,sizeof(ast_config_AST_SOCKET),"%s/%s",v->value,"asterisk.ctl");
asterisk/asterisk.h:#define AST_SOCKET    ASTVARRUNDIR "/asterisk.ctl"

asterisk/asterisk.c:                      snprintf((char *)ast_config_AST_PID,sizeof(ast_config_AST_PID),"%s/%s",v->value,"asterisk.pid");
asterisk/asterisk.h:#define AST_PID               ASTVARRUNDIR "/asterisk.pid"


If you really want to run 2 *'s then I'd suggest compiling both of them with
a prefix - you can them make install to the prefix dir for each, creating isolated
installs. You'll still need to sort the first issue tho...which leads to the next 
problem, how are you going to determine which one an

asterisk -r

connects to. Perhaps asterisk -r 'pid' ? Agan, more code hacking required.

Are they meant to be totally separate or are you going to share some things 
(like sound files)?


Andy




More information about the asterisk-dev mailing list