提交 733a4c8c authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #432 in FS/freeswitch from…

Merge pull request #432 in FS/freeswitch from ~JMESQUITA/freeswitch:bugfix/FS-8036-add-chatchannel-subscription-to-.verto.conf to master

* commit '749313a2':
  FS-8036 [verto.js] #resolve Add chatCallback to $.verto.conf
...@@ -1193,7 +1193,15 @@ ...@@ -1193,7 +1193,15 @@
conf.params.onBroadcast(verto, conf, e.data); conf.params.onBroadcast(verto, conf, e.data);
} }
} }
}) });
verto.subscribe(conf.params.laData.chatChannel, {
handler: function(v, e) {
if (typeof(conf.params.chatCallback) === "function") {
conf.params.chatCallback(v,e);
}
}
});
}; };
$.verto.conf.prototype.modCommand = function(cmd, id, value) { $.verto.conf.prototype.modCommand = function(cmd, id, value) {
...@@ -1219,6 +1227,10 @@ ...@@ -1219,6 +1227,10 @@
if (conf.params.laData.modChannel) { if (conf.params.laData.modChannel) {
conf.verto.unsubscribe(conf.params.laData.modChannel); conf.verto.unsubscribe(conf.params.laData.modChannel);
} }
if (conf.params.laData.chatChannel) {
conf.verto.unsubscribe(conf.params.laData.chatChannel);
}
}; };
function createMainModeratorMethods() { function createMainModeratorMethods() {
...@@ -1312,6 +1324,19 @@ ...@@ -1312,6 +1324,19 @@
} }
this.modCommand("transfer", parseInt(memberID), "exten"); this.modCommand("transfer", parseInt(memberID), "exten");
}; };
$.verto.conf.prototype.sendChat = function(message, type) {
var conf = this;
conf.verto.rpcClient.call("verto.broadcast", {
"eventChannel": conf.params.laData.chatChannel,
"data": {
"action": "send",
"message": message,
"type": type
}
});
};
} }
$.verto.modfuncs = {}; $.verto.modfuncs = {};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论