Merge pull request #851 in FS/freeswitch from FS-9157 to master

* commit '040b83a7af498c0a3ab1781a9836a7b43f033d62':
  FS-9157 [verto] Added possibility to use dedicated audio/video tags for each dialog
This commit is contained in:
Anthony Minessale II 2016-05-12 17:12:05 -05:00
commit dd017a4ad2
1 changed files with 17 additions and 2 deletions

View File

@ -132,8 +132,13 @@
}
});
var tag = verto.options.tag;
if (typeof(tag) === "function") {
tag = tag();
}
if (verto.options.ringFile && verto.options.tag) {
verto.ringer = $("#" + verto.options.tag);
verto.ringer = $("#" + tag);
}
verto.rpcClient.call('login', {});
@ -1885,6 +1890,11 @@
$.verto.dialog = function(direction, verto, params) {
var dialog = this;
var tag = verto.options.tag;
if (typeof(tag) === "function") {
tag = tag();
}
dialog.params = $.extend({
useVideo: verto.options.useVideo,
useStereo: verto.options.useStereo,
@ -1892,7 +1902,7 @@
useCamera: verto.options.deviceParams.useCamera,
useMic: verto.options.deviceParams.useMic,
useSpeak: verto.options.deviceParams.useSpeak,
tag: verto.options.tag,
tag: tag,
localTag: verto.options.localTag,
login: verto.options.login,
videoParams: verto.options.videoParams
@ -2185,6 +2195,11 @@
dialog.setState($.verto.enum.state.destroy);
break;
case $.verto.enum.state.destroy:
if (typeof(dialog.verto.options.tag) === "function") {
$('#' + dialog.params.tag).remove();
}
delete dialog.verto.dialogs[dialog.callID];
if (dialog.params.screenShare) {
dialog.rtc.stopPeer();