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 associate multiple telephony events with a single call. If the call identifier is not provided, the system will match calls based on the combination of fields VoipWebhookRequest.srcPhone, {@ link VoipWebhookRequest.dstPhone} and VoipWebhookRequest.direction.

direction

Call direction.

disposition

disposition: VoipCallDisposition

Call outcome.

dstPhone

dstPhone: string

Number being called

event

srcPhone

srcPhone: string

Number that is calling