Dial-in analysis and logic of events
Displaying the caller's card upon the dial-in event
This subsection specifies the order of event analysis, failure to follow which may lead to incorrect integration behavior.
This is applicable only for dial-in within its [SubCallID]. The CalledNumber is the extension number that received the incoming call. Immediately upon receiving a dial-in, a notification should be shown to the CRM user, indicating the entity specified by the CRM based on the CallerIDNum.
Further call logging in the CRM is done indicating the user corresponding to the extension in CalledNumber, but only if the call was accepted by the extension (within the given [SubCallID] there was an answer event).
Upon receiving an answer event following a dial-in, we understand exactly which extension accepted the call. If the extensions were dialed in parallel, the PBX will provide hangup events for the remaining [SubCallID] of this call within the global [CallID], by which notifications about this incoming call should be hidden from other CRM users, as it will no longer be relevant to them, or display a new notification indicating that the call was accepted by another extension (if hiding the previous one is not feasible).
Receiving an answer event indicates that the connection has been established, and we await a hangup event with the same [SubCallID] to pass the details of this incoming call into the CRM:
[Duration] - call duration
[RecID] - call recording ID
CalledDID - call source (the number through which the call entered the PBX) - must be passed to the CRM if available
Simultaneously, a notification about the end of the dialogue with CallerIDNum can be displayed to the CRM user (associated with CalledNumber). A successful call has CallStatus=ANSWER. Unsuccessful calls include:
Status=CANCEL - canceled by the caller,
CallStatus=BUSY - the called number is busy.
Other outcomes are possible. Such calls should under no circumstances be logged as successful in the CRM.
Example logic
If the CallerIDNum of the dial-in event EQUALS an extension of this PBX, such calls are ignored (as local calls), unless otherwise specified by an additional parameter below. 1.1) If the CallerIDNum of the dial-in event EQUALS an extension of this PBX, BUT there is a [RemoteNumber] parameter, then such a call is processed by the integration, and the value from [RemoteNumber] is used as the caller's number (instead of CallerIDNum) when logging the call in the CRM.
If the CallerIDNum of the dial-in event is NOT equal to an extension of this PBX, then such calls are ALWAYS (100%) processed by the integration.
In summary:
All 100% of calls, for which an answer was received after the dial-in event and which are not local PBX calls, despite the presence of "[Bridged] => no" in the hangup from IVRs/Queues within the global [CallID], are recorded in the CRM with registration by [SubCallID].