Skip to content

Commit

Permalink
feat: dial out start iq message is updated with sipdialinaddress and …
Browse files Browse the repository at this point in the history
…deviceType messages. BM-4447
  • Loading branch information
TCGBOGA committed Nov 12, 2024
1 parent 8e86423 commit 7af2d99
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/**
Expand Down
16 changes: 13 additions & 3 deletions modules/videosipgw/JitsiVideoSIPGWSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
);
}
Expand Down Expand Up @@ -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({
Expand Down
4 changes: 2 additions & 2 deletions modules/videosipgw/VideoSIPGW.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 7af2d99

Please sign in to comment.