# Configuration ## 3cx Configuration 1. Configuration settings need to be applied on the 3CX server as indicated below: [CDR Configuration](https://www.3cx.com/docs/cdr-call-data-records) ### Configuring CDRs in 3CX 1. For TCP transfer: Ensure to indicate "3CX CDR service is client / Active Socket" for the 3CX server to connect to our TCP server. 2. For FTP/SFTP/SCP transfer: Ensure file generation. It's recommended to generate 1 file per call for seamless integration throughout the day. 1. Note that this mode requires setting up an FTP server where CDR files will be available and accessible by the application. 3. The CDR configuration in 3CX should follow this order: + historyid + callid + duration + time_start + time_answered + time_end + reason_terminated + from_no + to_no + from_dn + to_dn + dial_no + reason_changed + final_number + final_dn + bill_code + bill_rate + bill_cost + bill_name + chain + from_type + to_type + final_type + from_dispname + to_dispname + final_dispname + missed_queue_calls ## .env configuration 1. Copy .env_template file and rename it to .env ``` bash cp .env_template .env ``` 2. Open the newly create file 3. Commplete the differents parameters : 1. TZ (Timezone): + Sets the timezone for the application + Example: TZ=Europe/Paris + Find a list of valid timezones here: list_of_tz_database_time_zones 2. LOCALE_LANGUAGE: + Sets the locale for translating day of week + Example: LOCALE_LANGUAGE=fr_FR + More information on locales: 3. Docker network configuration: + DOCKER_SUBNET: Sets the subnet for Docker network + DOCKER_GATEWAY: Sets the gateway for Docker network + Example: DOCKER_SUBNET=172.18.0.0/24, DOCKER_GATEWAY=172.18.0.1 + Learn more about Docker networking: 4. Traefik informations: + WEB_SERVER_NAME: Set a FQDN for Traefik, this is optionnal , if not set, localhost will be used 5. Database information: + POSTGRES_USER: PostgreSQL username + POSTGRES_PASSWORD: PostgreSQL password + POSTGRES_SERVER: PostgreSQL server address + POSTGRES_PORT: PostgreSQL server port + POSTGRES_DB: PostgreSQL database name 6. PgAdmin information: + PGADMIN_DEFAULT_EMAIL: Default email for PgAdmin login + PGADMIN_DEFAULT_PASSWORD: Default password for PgAdmin login 7. Grafana information: + GF_SECURITY_ADMIN_PASSWORD: Sets the admin password for Grafana + Default Grafana credentials: 8. Server type: + SERVER_TYPE: Choose between FTP, SFTP, or TCP 9. TCP configuration: + SERVER_PORT:set up you TCP server port , if not set 5000 will be used 10. FTP/SFTP configuration: + FTP_3CX_HOST: FTP/SFTP server hostname + FTP_3CX_PORT: FTP/SFTP server port + FTP_3CX_LOGIN: FTP/SFTP username + FTP_3CX_PASSWORD: FTP/SFTP password + FTP_3CX_SRVDIR: FTP/SFTP server directory 11. File handling configuration: + 3CX_FILES_INTERVAL: Interval for checking new files (in seconds) + 3CX_FILES_ARCHIVE_OR_DELETE: Choose between ARCHIVE or DELETE for file handling + LOCAL_CDR_FOLDER_ARCHIVE: Local folder for archiving CDR files + 3CX_FILEEXT: File extension for 3CX CDR files 12. SCP configuration: + SCP_3CX_HOST: SCP server hostname + SCP_3CX_PORT: SCP server port + SCP_3CX_LOGIN: SCP username + SCP_3CX_PASSWORD: SCP password + SCP_3CX_SRVDIR: SCP server directory These parameters allow you to customize the application's behavior, set up connections to various services, and configure file handling options.