This interface is used as the result of the VoipParseWebhookRequest function and determines the system's actions based on a request sent to the webhook
of the telephony module.
If this field is filled in, the system will save the call recording entry to the activity stream of the related app item.
The data from this field is used by the system to display the call recording playback widget
in the item’s activity stream.The call recording link and its duration will also be saved
in the call page in the **Telephony ** workspace.
asyncfunctionVoipParseWebhookRequest(request: FetchRequest): Promise<VoipWebhookParseResult> {
if (typeof request.body !== 'string') {
return {};
}
const data = JSON.parse(request.body);
return {
callRecord: {
srcPhone: data.srcPhone,
dstPhone: data.dstPhone,
direction: VoipCallDirection.In,
duration: data.duration,
// The data from this field will be available in the VoipGetCallLink function. call: {
link: data.callLink,
},
disposition: VoipCallDisposition.Answered,
}
};
}
asyncfunctionVoipGetCallLink(callData: any): Promise<string> {
return callData.link; // Retrieve the data saved in VoipParseWebhookRequest.
}
If this field is filled in, the user who either received an incoming call or initiated an outgoing call
will see the call page. In the Telephony workspace an item
of the Phone Call with information about the call will be created or updated.
Result of parsing message from webhook
This interface is used as the result of the
VoipParseWebhookRequestfunction and determines the system's actions based on a request sent to the webhook of the telephony module.Hierarchy
Properties
Optional callRecord
Information about the call recording.
If this field is filled in, the system will save the call recording entry to the activity stream of the related app item. The data from this field is used by the system to display the call recording playback widget in the item’s activity stream.The call recording link and its duration will also be saved in the call page in the **Telephony ** workspace.
async function VoipParseWebhookRequest(request: FetchRequest): Promise<VoipWebhookParseResult> { if (typeof request.body !== 'string') { return {}; } const data = JSON.parse(request.body); return { callRecord: { srcPhone: data.srcPhone, dstPhone: data.dstPhone, direction: VoipCallDirection.In, duration: data.duration, // The data from this field will be available in the VoipGetCallLink function. call: { link: data.callLink, }, disposition: VoipCallDisposition.Answered, } }; } async function VoipGetCallLink(callData: any): Promise<string> { return callData.link; // Retrieve the data saved in VoipParseWebhookRequest. }Optional event
Telephony event.
If this field is filled in, the user who either received an incoming call or initiated an outgoing call will see the call page. In the Telephony workspace an item of the Phone Call with information about the call will be created or updated.
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, } }; }Optional response
If the field is filled out, the client who is sending a request to the webhook receives an HTTP response.
async function VoipParseWebhookRequest(request: FetchRequest): Promise<VoipWebhookParseResult> { return { response: new HttpResponse() .status(400) .content('Hello, world!'), }; }