Some scripts in python for 3CX
You need postgresql-server-dev-X.Y installed on the server You also need python3-dev. If using Debian based system :
PSQL_VERION='9.6'
apt-get install postgresql-server-dev-${PSQL_VERION} python3-dev
You also need to create a PostgreSQL Role to be able to write to the specific database. As the postgres user on the server :
psql
CREATE ROLE freshdesk_to_3cx NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT LOGIN PASSWORD 'password' VALID UNTIL 'infinity';
GRANT CONNECT ON DATABASE database_single TO freshdesk_to_3cx;
exit
psql database_single
GRANT USAGE ON SCHEMA public TO freshdesk_to_3cx;
GRANT ALL ON public.extdevice TO freshdesk_to_3cx;
The easiest way to install is inside a virtualenv
- Create the virtualenv (Python 3!) and activate it:
git clone https://github.com/alkivi-sas/3cx-python-scripts
cd 3cx-python-scripts
pipenv install
- Change the conf file :
cp .config-example .config
vim .config
- From a terminal :
pipenv shell
./scripts.py