General practice
Event Parameters Used for Analysis
CallerIDNum - the calling number (the one who is calling) - by default, incoming (flow event - dial-in) calls are registered by this.
CalledNumber:
In the case of an incoming call (flow event - dial-in) - the extension number that received the incoming call for this event.
In the case of an outgoing call (flow event - dial-out) - the external number being called (the one being called) - by default, outgoing (flow event - dial-out) calls are registered by this.
CallerExtension - the extension number initiating an outgoing call (flow event - dial-out). It has a format like “453*111@PBXdomain”, and we only take what's before the at (@) sign.
CalledDID - the source of the call (the number called on the PBX from outside, the number through which the call entered the PBX) - if present, it must be passed and fixed in the integration.
Bridged - indicates whether the call was globally accepted by a user of the phone extension within the entire PBX. If accepted by an employee, then bridged = yes, if not, then bridged = no (no answer to the incoming call through a regular phone extension). This parameter is only passed in hangup events from special IVR and Queue extensions (ext type = phone or queue).
[Transfered] => yes - relevant only for outgoing calls (flow event - dial-out) and corresponding call events answer and hangup.
[RemoteNumber] - may only be present in flow event dial-in and indicates the external number associated with this call. Suggested for understanding which external number was connected during a call transfer from extension to extension using transfer commands #1 and *2 and to use it in such situations instead of CallerIDNum when registering the call.
CallBackID - callback ID (ID of outgoing call initiation through API). Added if the call is generated on behalf of some extension, but the connection is made between an external number and some other number/extension, different from the initiating extension. For example, when a website call order script connects the entered number to the client PBX's IVR.
[Duration] - the duration of the call for each separate [SubCallID]
[RecID] - the ID of the call recording
A successful call has CallStatus=ANSWER Unsuccessful calls have statuses: Status=CANCEL - canceled by the caller, CallStatus=BUSY - the called number is busy. There may be other cases. Such calls should in no case end up in the CRM as successful.
These are not all the parameters contained in events. The full list of parameters and a detailed description of the event parameters are indicated in the documentation.
Integration Logic - General Aspects
Upon receiving a call - transfer the call to the responsible employee
Initially, the call enters an IVR type extension (type = ivr), where a "Call interactive" rule (documentation) is added, this rule is most often used in integrations for the SetVar action, to set a variable whose value will contain the extension number to which the call should be transferred.
This functionality is often called "transferring the call to the responsible employee".
Call interactive for integrations is discussed in more detail here.
Registering Call Data
All events of regular phone extensions (type = phone) for [dial-in] and [dial-out] events are analyzed and in the case of an [answer] event are registered upon the event hangup and [SubCallID], as separate calls, instead of [CallID]. Thus, it is possible to divide the call within the PBX into separate legs (call legs) - before and after the transfer and register them as separate calls. Missed incoming calls are recorded based on the presence in hangups from IVRs and Queues of the parameter Bridged=no. It should be remembered that Bridged=yes is always a successful incoming call. Data for it must be recorded when analyzing [dial-in] events within their own [SubCallID].
Call Initiation (ClickToCall / CallBack)
Call initiation (/callback/) (documentation, full list of parameters and description)
Call initiation - the system first calls src, then, upon successful response, calls dst.
In the case of src being an extension, it is recommended to pass not only the parameters "src_num" and "dst_num", but also "caller_id_name" and "caller_id_number", indicating in them a value equal to "dst_num", thus, when the call comes to the user's SIP phone, not his own extension (the value from "src_num" passed by the system by default if "caller_id_name" and "caller_id_number" are not set) will be displayed, but the number he will be calling, which will at least allow him by pressing RD(redial) to call back the same number without the integration's involvement.
Transferring to the integration a link to the call recording
It is recommended to use this API route:
GET .../record/{record_uuid}/storage_url/
(documentation on call recording).