]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9157 [verto] Added possibility to use dedicated audio/video tags for each dialog
authorItalo Rossi <italorossib@gmail.com>
Thu, 12 May 2016 21:34:23 +0000 (18:34 -0300)
committerItalo Rossi <italorossib@gmail.com>
Thu, 12 May 2016 21:34:23 +0000 (18:34 -0300)
html5/verto/js/src/jquery.verto.js

index e4643c1f57841dead37fe84a55317f95af2a383b..68cc6d6d8085a045f194a7cbbe91839e272b774c 100644 (file)
             }
         });
 
+        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', {});
     $.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,
            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
             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();