Running multiple amtmitel executables at a site, each connecting to a different PABX

There are scripts to create new instances of a default amtmitel configuration, and to update the executables being used for each instance.

Those scripts are create_amtmitel_instance.sh and update_amtmitel_instance.sh.
They must be placed in /opt/datatex/.
You also need to create a default amtmitel configuration in /opt/datatex/amtmitel-template.

The layout is basically:
/opt/datatex/amtmitel-template
/opt/datatex/create_amtmitel_instance.sh
/opt/datatex/update_amtmitel_instance.sh

In the amtmitel-template folder are these files:
amtmitel
amtmitel.bin
reloadamtmitel.sh
startamtmitel
stopamtmitel

When you need a new amtmitel for another PABX, you run the create_amtmitel_instance.sh to make it. Then you change the new configuration to be correct and start it. You will find the new amtmitel instance in /opt/datatex/amtmitel_n, where n is the instance number. It starts at 1 and is incremented for each amtmitel instance that is created.

When you run the create_amtmitel_instance.sh, it will copy amtmitel-template to amtmitel_1. The next copy that is created will be amtmitel_2. The command to run it is:
bash ./create_amtmitel_instance.sh

For using it to install the first time:

  1. create an amtmitel-template folder with a typical amtmitel setup, as described above.
  2. Run the create_amtmitel_instance.sh and then go to /opt/datatex/amtmitel_1. Set that up correctly, then copy the amtmitel_1.ini file back to the amtmitel-template folder as amtmitel.ini so it can be used to create a default template that is more-or-less correct. You can remove the PABX-specific entries.

For subsequent installations:

  1. For the next PABX, you run create_amtmitel_instance.sh again (bash ./create_amtmitel_instance.sh). You then edit the configuration for amtmitel_2 to be correct.

All of these have to be added manually to /opt/datatex/bin/check_running_apps.local.
An example for amtmitel_2 would be:
APP=amtmitel_2
APPLOC=/opt/datatex/amtmitel_2
APPSTART=/opt/datatex/amtmitel_2/startamtmitel_2
CheckAndStart $APP $APPLOC $APPSTART