Document
CRM wants to connect to the API and needs the URLs to receive data in URL or JSON format
Below are some example URLs for reference
Contents
- Incoming Call 
- End Call 
- Missed Call 
- Agent No Answer 
- Outgoing Call 
- Update Real-Time Agent Status 
- Click2Call Event 
- Check Extension Status 
- Spy Call Event 
- Event to Get Extension List in Queue 
- Change Extension Status in Queue 
Incoming Call
When there is an incoming call to the PBX, it will ring to the employee’s phone (e.g., extension 101):
https://{CRM_URL}/api/callcenter/call_in?phone=0938363739&queue=999&extension=101&callid=5e012a75-121b-4c10-bdb4-c4b235b6a677&event=ANSWER&did=19002028With parameter:
- {CRM_URL}: Provided by CRM
- phone: The incoming phone number
- queue: The queue of the internal number (if applicable)
- extension: The internal number of the agent
- callid: The call ID
- event: The call status (ANSWER, RINGING)
- did: The PBX phone number
This is the event that informs the CRM that the call has ended:
https://{CRM_URL}/api/callcenter/hangup?callid=5e012a75-121b-4c10-bdb4-c4b235b6a677With parameter:
- {CRM_URL}: Provided by CRM
- callid: The call ID
Call Information
When the call ends, the PBX can return detailed call information:
https://{CRM_URL}/api/callcenter/calldata?callid=5e012a75-121b-4c10-bdb4-c4b235b6a677&calldate=2024-03-01 13:15:40&duration=50&billsec=37&status=ANSWER&did=19002028&extension=101&phone=0938363739&direction=Inbound&recordingfile=https://portal.voicecloud.vn/play_audio/data/5e012a75-121b-4c10-bdb4-c4b235b6a677With parameter:
- {CRM_URL}: Provided by CRM
- callid: The call ID
- calldate: The start time of the call (format: y-m-d hms)
- duration: The total call duration
- billsec: The duration of the talk time
- status: The call status (ANSWER, BUSY, etc.)
- did: The PBX phone number
- extension: The agent’s internal number
- phone: The customer’s phone number
- direction: The call direction (Inbound or Outbound)
- recordingfile: The path to the call recording file
Missed Call
https://{CRM_URL}/api/callcenter/calldata?callid=5e012a75-121b-4c10-bdb4-c4b235b6a677&holdtime=60&status=ABANDON&queue=999&phone=0938363739With parameter:
- {CRM_URL}: Provided by CRM
- callid: The call ID
- holdtime: The customer's hold time (in seconds)
- status: The call status (ABANDON)
- queue: The name of the queue
- phone: The customer's phone number
Agent No Answer
https://{CRM_URL}/api/callcenter/calldata?callid=5e012a75-121b-4c10-bdb4-c4b235b6a677&status=NOANSWER&queue=999&extension=101&phone=0938363739With parameter:
- {CRM_URL}: Provided by CRM
- callid: The call ID
- status: The call status (NOANSWER)
- queue: The name of the queue
- extension: The agent’s internal number
- phone: The customer’s phone number
Outgoing Call
Synchronize data to inform the CRM of an outgoing call from the PBX:
https://{CRM_URL}/api/callcenter/init?extension=101&phone=0938363739&callid=5e012a75-121b-4c10-bdb4-c4b235b6a677&event=ANSWERWith parameter:
- {CRM_URL}: Provided by CRM
- extension: Agent's internal number
- phone: Outgoing phone number
- callid: Call ID
- event: Call status (ANSWER, RINGING)
Update Real-Time Status of Agent
https://{CRM_URL}/api/Agent/ChangeStatus?extension=101&status=talkWith parameter:
{CRM_URL}: Provided by CRM
extension: Agent's internal number
status: Agent's status (*)
(*) Extension Status Values
Values
Describe
off
Agent (phone) not register
on
Agent (phone) available
pause
Agent (phone) pause
ring
Agent (phone) ringring
talk
Agent (phone) talking
Click2call Event
CRM runs this URL with the GET method, using URL-encoded data:
https://{PBX_URL}/api/CallControl/dial/from_number/{extension}/to_number/{phone}/key/{key}/domain/{domain}With parameter:
- {PBX_URL}: Provided by the PBX system.
- api/CallControl/dial: API method name for making calls in the system.
- extension: Internal extension number to call (e.g., 101).
- phone: Customer phone number to call (e.g., 0938363739).
- key: Company key provided by the PBX system.
- domain: Company domain name provided by the PBX system.
 Check the status of the extension
CRM runs this path using POST method with JSON data type:
https://{PBX_URL}/api/Agent/status/format/json—-
Data :
{
  "key" : "98589afb123863cf4d5cd4ec2c41072",
  "list" :
   [
    {"ext" : "100"},
    {"ext" : "200"}
   ]
}With parameter:
- {PBX_URL}: Provided by the PBX system.
- api/Agent/status/format/json: The API method name of the system.
- key: The company's key provided by the PBX system.
- ext: The extension to be checked.
SPY Call Event
CRM runs this path using POST method with JSON data type:
https://{PBX_URL}/api/Agent/spy/format/json—-
Data :
{
 "key" : "98589afb123863cf4d5cd4ec2c41072",
 "src" : "100",
 "dst" : "101",
 "mode" : "whisper"
}With parameter:
- {PBX_URL}: Provided by the PBX system.
- api/Agent/spy/format/json: The API method name of the system.
- key: The company's key provided by the PBX system.
- src: The extension of the person initiating the spy call.
- dst: The extension of the person being listened to.
- mode:- whisper: listen only
- threeway: talk to both
- caller: talk to the caller
- callee: talk to the callee
 
Event to Retrieve Extension List in Queue
CRM runs this path using POST method with JSON data type:
https://{PBX_URL}/api/Agent/all_members/format/json—-
Data :
{
 "key" : "98589afb123863cf4d5cd4ec2c41072"
}With parameter:
- {PBX_URL}: Provided by the PBX system.
- api/Agent/all_members/format/json: The API method name of the system.
- key: The company's key provided by the PBX system.
Change Extension Status in Queue
CRM runs this path using POST method with JSON data type:
https://{PBX_URL}/api/Agent/update_status—
Data :
{
 "key" : "98589afb123863cf4d5cd4ec2c41072",
 "exten" : "100",
 "status" : "0"
}With parameter:
- {PBX_URL}: Provided by the PBX system.
- api/Agent/update_status: The API method name of the system.
- key: The company's key provided by the PBX system.
- exten: The extension number to be changed.
- status: The status of the extension. (0: unpaused, 1: paused)
Retrieve Call Data
CRM runs this path using POST method with JSON data type:
https://{PBX_URL}/internal/Reports/cdr/format/json—
Data :
{
 "key" : "98589afb123863cf4d5cd4ec2c41072",
 "callid" : "fb80cc79-e179-1234-92d7-04748b9bb475",
 "startdate" : "2022-09-23",
 "enddate" : "2022-09-23"
}With parameter:
- {PBX_URL}: Provided by the PBX system.
- internal/Reports/cdr/format/json: The API method name of the system.
- key: The company's key provided by the PBX system.
- callid: The call ID.
- startdate – enddate: The time range. (Format: YYYY-MM-DD)
Last updated
Was this helpful?
