From 7af2d9965c3d918650b511aae745ad92028db9db Mon Sep 17 00:00:00 2001 From: TCGBOGA Date: Fri, 1 Nov 2024 18:50:18 +0300 Subject: [PATCH] feat: dial out start iq message is updated with sipdialinaddress and deviceType messages. BM-4447 --- JitsiConference.js | 4 ++-- modules/videosipgw/JitsiVideoSIPGWSession.js | 16 +++++++++++++--- modules/videosipgw/VideoSIPGW.js | 4 ++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/JitsiConference.js b/JitsiConference.js index d7bb93d0..90630620 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -3834,13 +3834,13 @@ JitsiConference.prototype.setSenderVideoConstraint = function(maxFrameHeight) { * @returns {JitsiVideoSIPGWSession|Error} Returns null if conference is not * initialised and there is no room. */ -JitsiConference.prototype.createVideoSIPGWSession = function(sipAddress, displayName) { +JitsiConference.prototype.createVideoSIPGWSession = function(sipAddress, displayName, sipdialinaddress, devicetype) { if (!this.room) { return new Error(VideoSIPGWConstants.ERROR_NO_CONNECTION); } return this.videoSIPGWHandler - .createVideoSIPGWSession(sipAddress, displayName); + .createVideoSIPGWSession(sipAddress, displayName, sipdialinaddress, devicetype); }; /** diff --git a/modules/videosipgw/JitsiVideoSIPGWSession.js b/modules/videosipgw/JitsiVideoSIPGWSession.js index 9580b558..39f2aa84 100644 --- a/modules/videosipgw/JitsiVideoSIPGWSession.js +++ b/modules/videosipgw/JitsiVideoSIPGWSession.js @@ -28,12 +28,14 @@ export default class JitsiVideoSIPGWSession extends Listenable { * that participant. * @param {ChatRoom} chatRoom - The chat room this session is bound to. */ - constructor(sipAddress, displayName, chatRoom) { + constructor(sipAddress, displayName, chatRoom, sipdialinaddress, devicetype) { super(); this.sipAddress = sipAddress; this.displayName = displayName; this.chatRoom = chatRoom; + this.sipdialinaddress = sipdialinaddress; + this.devicetype = devicetype; /* * The initial state is undefined. Initial state cannot be STATE_OFF, @@ -99,7 +101,9 @@ export default class JitsiVideoSIPGWSession extends Listenable { failureReason, oldState, newState: this.state, - displayName: this.displayName + displayName: this.displayName, + sipdialinaddress: this.sipdialinaddress, + devicetype: this.devicetype } ); } @@ -133,9 +137,15 @@ export default class JitsiVideoSIPGWSession extends Listenable { const attributes = { 'xmlns': 'http://jitsi.org/protocol/jibri', 'action': action, - sipaddress: this.sipAddress + sipaddress: this.sipAddress, + devicetype: this.devicetype, + displayname: this.displayName }; + if (this.sipdialinaddress !== '') { + attributes.sipdialinaddress = this.sipdialinaddress; + } + attributes.displayname = this.displayName; const iq = $iq({ diff --git a/modules/videosipgw/VideoSIPGW.js b/modules/videosipgw/VideoSIPGW.js index d6178e4d..945ae58a 100644 --- a/modules/videosipgw/VideoSIPGW.js +++ b/modules/videosipgw/VideoSIPGW.js @@ -84,7 +84,7 @@ export default class VideoSIPGW { * @param {string} displayName - The display name to use. * @returns {JitsiVideoSIPGWSession|Error} */ - createVideoSIPGWSession(sipAddress, displayName) { + createVideoSIPGWSession(sipAddress, displayName, sipdialinaddress, devicetype) { if (this.sessions[sipAddress]) { logger.warn('There was already a Video SIP GW session for address', sipAddress); @@ -93,7 +93,7 @@ export default class VideoSIPGW { } const session = new JitsiVideoSIPGWSession( - sipAddress, displayName, this.chatRoom); + sipAddress, displayName, this.chatRoom, sipdialinaddress, devicetype); session.addStateListener(this.sessionStateChangeListener);