From d884eeea42887e800c838af43e38edbcb5c05923 Mon Sep 17 00:00:00 2001 From: Edoardo Spadoni Date: Mon, 11 Mar 2024 12:25:22 +0100 Subject: [PATCH] endpoints. added nethlink endpoint --- .../plugins/com_user_rest/plugins_rest/user.js | 3 ++- .../nethcti-server/plugins/user/endpointExtension.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/root/usr/lib/node/nethcti-server/plugins/com_user_rest/plugins_rest/user.js b/root/usr/lib/node/nethcti-server/plugins/com_user_rest/plugins_rest/user.js index 42444515..be516a2c 100644 --- a/root/usr/lib/node/nethcti-server/plugins/com_user_rest/plugins_rest/user.js +++ b/root/usr/lib/node/nethcti-server/plugins/com_user_rest/plugins_rest/user.js @@ -662,7 +662,8 @@ function setCompUtil(comp) { var extenAgent = compAstProxy.getExtensionAgent(result.endpoints[compUser.ENDPOINT_TYPES.extension][i].id); var actions = {}; if (result.endpoints[compUser.ENDPOINT_TYPES.extension][i].type === 'webrtc' || - result.endpoints[compUser.ENDPOINT_TYPES.extension][i].type === 'mobile') { + result.endpoints[compUser.ENDPOINT_TYPES.extension][i].type === 'mobile' || + result.endpoints[compUser.ENDPOINT_TYPES.extension][i].type === 'nethlink') { actions.answer = true; actions.dtmf = true; diff --git a/root/usr/lib/node/nethcti-server/plugins/user/endpointExtension.js b/root/usr/lib/node/nethcti-server/plugins/user/endpointExtension.js index 0be9ba62..97f6e105 100644 --- a/root/usr/lib/node/nethcti-server/plugins/user/endpointExtension.js +++ b/root/usr/lib/node/nethcti-server/plugins/user/endpointExtension.js @@ -6,7 +6,7 @@ * @class EndpointExtension * @param {string} identifier The extension identifier * @param {object} data - * @param {string} data.type The type of the extension ("physical" | "webrtc" | "mobile") + * @param {string} data.type The type of the extension ("physical" | "webrtc" | "mobile" | "nethlink") * @param {string} [data.web_user] The username of the physical phone to be used to invoke HTTP apis * @param {string} [data.web_password] The password of the physical phone to be used to invoke HTTP apis * @param {string} [data.username] The username of the sip extension. It is present with webrtc type @@ -17,7 +17,7 @@ exports.EndpointExtension = function(identifier, data) { // check the parameter if (typeof identifier !== 'string' || typeof data !== 'object' || - (data.type !== 'physical' && data.type !== 'webrtc' && data.type !== 'mobile')) { + (data.type !== 'physical' && data.type !== 'webrtc' && data.type !== 'mobile' && data.type !== 'nethlink')) { throw new Error('wrong parameters: ' + JSON.stringify(arguments)); } @@ -182,7 +182,7 @@ exports.EndpointExtension = function(identifier, data) { type: type }; - if (type === 'webrtc' || type === 'mobile') { + if (type === 'webrtc' || type === 'mobile' || type === 'nethlink') { obj.secret = sipPassword; obj.username = sipUser; } @@ -218,7 +218,8 @@ exports.EndpointExtension = function(identifier, data) { const TYPES = { physical: 'physical', webrtc: 'webrtc', - mobile: 'mobile' + mobile: 'mobile', + nethlink: 'nethlink', }; exports.TYPES = TYPES