UNPKG

cloudonix-js

Version:

A JavaScript library for building and serving Cloudonix Voice Application XML (CXML) documents with support for AI voice agents, media streaming, and advanced telephony features

28 lines (24 loc) 743 B
/** * @file Reject verb implementation * @copyright 2025 Nir Simionovich, nirs@cloudonix.io * @license MIT * @module cloudonix-js/verbs/reject * @description Implements the Reject verb for rejecting incoming calls */ 'use strict'; module.exports = { /** * Create a Reject element * @param {Object} options - Optional parameters for the Reject element * @param {string} options.reason - Rejection reason: 'rejected', 'busy', 'congestion', or 'failed' * @returns {Object} - The Reject element */ create: (options = {}) => { const rejectElement = {}; // Add reason attribute if provided if (options.reason) { rejectElement['@_reason'] = options.reason; } return rejectElement; } };