Integration of OTRS with FreeSWITCH PBX
This article is intended to prepare the work of the PIM module with the FreeSWITCH server (FussionPBX).
This guide covers the case when you have already installed the PIMv1.0.10b package on the OTRS server in accordance with the PIM package documentation.
Settings on the OTRS server
Important note: in the configuration of the module with the FreeSWITCH PBX, the connector works locally on the FreeSWITCH, therefore, you will need to comment out the launch of the connector for the asterisk on OTRS.
To do this, edit the cron job on the OTRS server in the pim_run file:
nano /opt/otrs/var/cron/pim_run
comment out the line:
# */1 * * * * $HOME/var/pim_asterisk.pl >> /dev/null
Save and close the file.
Restart the CRON service on OTRS by running the following command:
/opt/otrs/bin/Cron.sh restart otrs
Next on the PBX settings page, add a PBX with an asterisk type, extension numbers of agents and start the PIM service.
Example of a PBX settings page for working with FreeSWITCH:
To work with FreeSWITCH, these settings are required for configuring agent extensions only. Tracking numbers set on this page are not processed.
Install the PIM Connector on the FreeSWITCH server
To install the connector on FreeSWITCH, follow these steps:
1. Install perl-library on FreeSWITCH server IO::Socket::Timeout:
apt-get install -y libio-socket-timeout-perl
2. Download the archive with the connector and unpack it into the directory (/opt):
wget https://ip-lab.ru/files/fscon.tar.gz
tar -C /opt -xvf fscon.tar.gz --strip-components 1
3. Set permissions (770) on the script:
chmod 770 /opt/pim_freeswitch.pl
4. Edit the script by changing the tracking numbers and ip OTRS to yours:
nano /opt/pim_freeswitch.pl
changing lines 20 and 21
my $otrs_ipaddr = '10.0.0.11'; # IP Address OTRS
my @pd_did=('76543210','12345678'); # Tracking numbers in quotes separated by commas
If you use other than the default parameters (port 8021 and ClueCon password) to connect to mod_event_socket, change lines 113 and 114:
my $fs_port = "8021";
my $fs_pwd = "ClueCon";
save and close the file
5. Perform a test run of the script:
perl /opt/pim_freeswitch.pl
In case of a successful launch, you will see these lines:
Process file is created. Session ID: (session_name)
Connection to the PIM-chat server established
Connection to the FreeSWITCH server (localhost) on port 8021 successful
End the script by pressing Ctrl + C
6. Edit the cron job:
crontab -e
add the line:
*/5 * * * * /opt/pim_freeswitch.pl >> /dev/null
Save and close the file.
This completes the installation of the FreeSWITCH connector. The status (and its launch) will be checked every 5 minutes.
During the connector operation, the event log pim_fs_log_YYYYMM.log will be created in the /var/log/pim/ directory with monthly rotation.
To stop the connector, clean or rename the file /opt/pim_stop.txt:
mv /opt/pim_stop.txt /opt/pim_stop.noload
The script will check this file 1 time per minute and stop its work by exiting if the file does not exist.
2015-2021 IP-LAB.RU
|