Skip to main content
Quang Liem
💬
0 discussions

GETTING START OF NEW PRIVATE PBX

I. Configure variables capture with client​

1. Default variables​

  • session.remote_identity.display_name: remote phone number ( exp: 039XXXXXX )
  • session.remote_identity.uri.user: remote phone number ( exp: 039XXXXXX )
  • session.local_identity.uri.user: local user ( exp: 101 )
  • session.local_identity.uri.host: local host ( exp: 2-test1.gcalls.vn )
  • request.call_id: call id (exp: 99bfa56d-b1a0-123a-99ac-0050568cc136 )
  • session.direction: call direction (exp: outgoing)
  • originator: call originator (exp: remote)
  • cause: call fail cause (exp: busy)
Check details at [CallBox.js](https://gitlab.com/gcalls-opensource/gcallsfront/-/tree/master/contactApp/client/Agent/components/CallBox.js)

2. Custom variables​

  • uuid: call uuid.
  • recordings_url: call recording download link.
  • playing_recordings_url: Link to listen to call recording.
  • hotline (INVITE message): hotline number for incoming calls.
  • hotline_outbound: hotline number for outgoing calls.
  • press (INVITE message): incoming call key.
  • flowid: used to merge call logs with same call
  • callrate: call rating feature

II. Configure System Log​

  • System Log:
    • Missed Calllog
    • Forward Calllog
    • Overtime Calllog

1. Configure System Log with Lua Script​

  • Login Pbx Client.

  • Advanced --> Script Editor

  • Files --> Add File

    • Path: /usr/local/freeswitch/scripts/
    • File: vinagcalls.lua
    Example: [vinagcalls.lua](https://gitlab.com/gcalls-opensource/publics/gcallsmiddle/-/blob/master/rawsService/vinagcalls.lua)
  • Configure lua script for sip tenant

    • Dialplan --> Variables
    • Create new action
      • Tag: action
      • Type: export
      • Data: api_hangup_hook=lua vinagcalls.lua

2. Configure System Log with Api​

3. Configure System Log with Webhook​

4. Configure System Log by listening to Databases​

III. Configure new PBX server in portal​

  • Login Portal
  • Record -> Add Server ( Input New Pbx Server Name )
  • Select New Server --> Show --> Add Domain
    • Domain Name: New Pbx Sip Domain Name
    • Id Tenant: Gcalls Tenant Id

IV. Configure new PBX server in record service​

V. Configure new PBX server in log service​

  • Configure log system api in Log system api For process log system data from new pbx server
  • Configure function updateCallRate in Update callrate function For process log callrate data from new pbx server
  • Configure function saveCalllog2 in Save log function For process save calllog data

VI. Configure new PBX server in tool cdrs​

  • Configure new pbx server info in pbxs.js, pbxs.json Configure api url, record url,.. for PBX server
  • Configure new pbx server for cdrs client in Cdr.vue To add new pbx server and add api handler for this server in client
  • Configure new pbx server for cdrs server in cdrs.js To add new pbx server and add api handler for this server in server
  • Configure new pbx server for cdrs restore cron in schedule.js To configure recovery call log cron with new pbx server

VII. Kết Luận​

Trên đây là tổng hợp hướng dẫn triển khai cấu hình PBX và các lưu ý với hệ thống Gcalls. Nếu có câu hỏi nào vui lòng điền vào form bên dưới.