VoipWebhookRequest

Telephony event

Represents a telephony event. The system uses this data to display call notifications to relevant users.

async function  VoipParseWebhookRequest(request: FetchRequest):  Promise<VoipWebhookParseResult> {
    if (typeof request.body !== 'string')  { 
        return {}; 
    } 
    const data = JSON.parse(request.body);  
    return { 
        event: { 
            event:  VoipWebhookEvent.NotifyStart, 
            direction: VoipCallDirection.In,  
            dstPhone: data.dstPhone, 
            srcPhone: data.srcPhone,  
            disposition: VoipCallDisposition.Unknown, 
        } 
    }; 
}  

Hierarchy

  • VoipWebhookRequest

Properties

Optional callId

callId: undefined | string

External system call identifier.

Used by the system to match multiple telephony events to a single call. If the call identifier is not specified, the system will match calls using a combination of fields: VoipWebhookRequest.srcPhone, VoipWebhookRequest.srcPhoneExt, VoipWebhookRequest.dstPhone, {@ link VoipWebhookRequest.dstPhoneExt}, and VoipWebhookRequest.direction.

direction

Call direction.

disposition

disposition: VoipCallDisposition

Call outcome.

dstPhone

dstPhone: string

Number being called

Filled depending on the call direction:

  • incoming or internal call— internal number of the operator receiving the call.
  • outgoing call— external number of the client being called by the operator.

Optional dstPhoneExt

dstPhoneExt: undefined | string

Employee extension number when initiating an outgoing call to an external number VoipWebhookRequest.dstPhone.

Used by the system only for outgoing calls. For other directions, leave the field blank.

event

srcPhone

srcPhone: string

Number that is calling

Filled in depending on the call direction:

  • incoming call—the external number of the client calling the operator.
  • outgoing or internal call—the internal number of the operator who initiated the call.

Optional srcPhoneExt

srcPhoneExt: undefined | string

Employee extension when receiving an incoming call from an external number {@ link VoipWebhookRequest.srcPhone}.

As a rule, when receiving an incoming call from the public switched telephone network, information about the employee's extension number within the organization is not available. It is recommended to fill in this field only if the upstream PBX provides this information. The system uses this field only for incoming calls. For other directions, leave the field blank.