Moves 'callSipButtonClicked' method to Toolbar.js in order to fix 'sharedKey' undefined error.
This commit is contained in:
parent
8db602c8bd
commit
8d5e50c0ca
26
app.js
26
app.js
|
@ -973,32 +973,6 @@ $(document).bind('fatalError.jingle',
|
|||
}
|
||||
);
|
||||
|
||||
function callSipButtonClicked()
|
||||
{
|
||||
var defaultNumber
|
||||
= config.defaultSipNumber ? config.defaultSipNumber : '';
|
||||
|
||||
UI.messageHandler.openTwoButtonDialog(null,
|
||||
'<h2>Enter SIP number</h2>' +
|
||||
'<input id="sipNumber" type="text"' +
|
||||
' value="' + defaultNumber + '" autofocus>',
|
||||
false,
|
||||
"Dial",
|
||||
function (e, v, m, f) {
|
||||
if (v) {
|
||||
var numberInput = document.getElementById('sipNumber');
|
||||
if (numberInput.value) {
|
||||
connection.rayo.dial(
|
||||
numberInput.value, 'fromnumber', roomName);
|
||||
}
|
||||
}
|
||||
},
|
||||
function (event) {
|
||||
document.getElementById('sipNumber').focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function hangup() {
|
||||
disposeConference();
|
||||
sessionTerminated = true;
|
||||
|
|
|
@ -2922,7 +2922,7 @@ var ToolbarToggler = {
|
|||
|
||||
module.exports = ToolbarToggler;
|
||||
},{}],17:[function(require,module,exports){
|
||||
/* global $, buttonClick, config, lockRoom, Moderator,
|
||||
/* global $, buttonClick, config, lockRoom, Moderator, roomName,
|
||||
setSharedKey, sharedKey, Util */
|
||||
var messageHandler = require("../util/MessageHandler");
|
||||
var BottomToolbar = require("./BottomToolbar");
|
||||
|
@ -3065,6 +3065,33 @@ function inviteParticipants() {
|
|||
window.open("mailto:?subject=" + subject + "&body=" + body, '_blank');
|
||||
}
|
||||
|
||||
function callSipButtonClicked()
|
||||
{
|
||||
var defaultNumber
|
||||
= config.defaultSipNumber ? config.defaultSipNumber : '';
|
||||
|
||||
messageHandler.openTwoButtonDialog(null,
|
||||
'<h2>Enter SIP number</h2>' +
|
||||
'<input id="sipNumber" type="text"' +
|
||||
' value="' + defaultNumber + '" autofocus>',
|
||||
false,
|
||||
"Dial",
|
||||
function (e, v, m, f) {
|
||||
if (v) {
|
||||
var numberInput = document.getElementById('sipNumber');
|
||||
if (numberInput.value) {
|
||||
connection.rayo.dial(
|
||||
numberInput.value, 'fromnumber',
|
||||
roomName, sharedKey);
|
||||
}
|
||||
}
|
||||
},
|
||||
function (event) {
|
||||
document.getElementById('sipNumber').focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var Toolbar = (function (my) {
|
||||
|
||||
my.init = function () {
|
||||
|
|
|
@ -18,7 +18,7 @@ Strophe.addConnectionPlugin('rayo',
|
|||
{
|
||||
console.info("Rayo IQ", iq);
|
||||
},
|
||||
dial: function (to, from, roomName)
|
||||
dial: function (to, from, roomName, roomPass)
|
||||
{
|
||||
var self = this;
|
||||
var req = $iq(
|
||||
|
@ -39,12 +39,12 @@ Strophe.addConnectionPlugin('rayo',
|
|||
value: roomName
|
||||
}).up();
|
||||
|
||||
if (sharedKey !== null && sharedKey.length) {
|
||||
if (roomPass !== null && roomPass.length) {
|
||||
|
||||
req.c('header',
|
||||
{
|
||||
name: 'JvbRoomPassword',
|
||||
value: sharedKey
|
||||
value: roomPass
|
||||
}).up();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* global $, buttonClick, config, lockRoom, Moderator,
|
||||
/* global $, buttonClick, config, lockRoom, Moderator, roomName,
|
||||
setSharedKey, sharedKey, Util */
|
||||
var messageHandler = require("../util/MessageHandler");
|
||||
var BottomToolbar = require("./BottomToolbar");
|
||||
|
@ -141,6 +141,33 @@ function inviteParticipants() {
|
|||
window.open("mailto:?subject=" + subject + "&body=" + body, '_blank');
|
||||
}
|
||||
|
||||
function callSipButtonClicked()
|
||||
{
|
||||
var defaultNumber
|
||||
= config.defaultSipNumber ? config.defaultSipNumber : '';
|
||||
|
||||
messageHandler.openTwoButtonDialog(null,
|
||||
'<h2>Enter SIP number</h2>' +
|
||||
'<input id="sipNumber" type="text"' +
|
||||
' value="' + defaultNumber + '" autofocus>',
|
||||
false,
|
||||
"Dial",
|
||||
function (e, v, m, f) {
|
||||
if (v) {
|
||||
var numberInput = document.getElementById('sipNumber');
|
||||
if (numberInput.value) {
|
||||
connection.rayo.dial(
|
||||
numberInput.value, 'fromnumber',
|
||||
roomName, sharedKey);
|
||||
}
|
||||
}
|
||||
},
|
||||
function (event) {
|
||||
document.getElementById('sipNumber').focus();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
var Toolbar = (function (my) {
|
||||
|
||||
my.init = function () {
|
||||
|
|
Loading…
Reference in New Issue