Skip to content

Commit

Permalink
New plugin audioconf for audio conferences using XMPP (Jitsi) or SIP …
Browse files Browse the repository at this point in the history
…(Asterisk/FreeSWITCH)
  • Loading branch information
deleolajide committed Aug 8, 2019
1 parent 1c86c6d commit 9d36d9c
Show file tree
Hide file tree
Showing 24 changed files with 55,390 additions and 1 deletion.
Binary file added audioconf/audio/ringback-uk.mp3
Binary file not shown.
Binary file added audioconf/audio/ringback-us.mp3
Binary file not shown.
73 changes: 73 additions & 0 deletions audioconf/audioconf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(["converse"], factory);
} else {
factory(converse);
}
}(this, function (converse) {
var _converse = null;

converse.plugins.add("audioconf", {
'dependencies': [],

'initialize': function () {
_converse = this._converse;

_converse.api.settings.update({
visible_toolbar_buttons: {call: true},
});

window.click2Dial = {
custom_button_color: "orange",
custom_frame_color: "black",
dial_pad: "true",
did: "3001",
display_button: "false",
div_css_class_name: "btn-style-round-a",
draggable: "true",
incompatible_browser_configuration: "hide_widget",
placement: "bottom-right",
rating: "false",
ringback: "true",
server_url: "./audioconf",
show_branding: "false",
show_frame: "true",
text: "Ask",
use_default_button_css: "true",
protocol: "sip", // 'sip' or 'xmpp'
sip: {domain: "192.168.1.251", server: "wss://desktop-545pc5b:7443/sip/proxy?url=ws://192.168.1.251:5066", register: false, caller_uri: "sip:[email protected]", authorization_user: "1002", password: "1234"},
xmpp: {domain: "meet.jit.si", server: "https://meet.jit.si/http-bind"}
}

const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.src = click2Dial.server_url + '/scripts/click2dial.js';
script.async = false;
head.appendChild(script);

console.log("audioconf plugin is ready");
},

'overrides': {
ChatBoxView: {

toggleCall: function toggleCall(ev) {
ev.stopPropagation();
var room = Strophe.getNodeFromJid(this.model.attributes.jid).toLowerCase();
console.debug("toggleCall", room);

if (!voxbone.WebRTC.rtcSession.isEnded || voxbone.WebRTC.rtcSession.isEnded())
{
infoVoxbone.did = "audioconf_" + room;
click2Dial.makeCall(true);

this.showHelpMessages(["Calling " + infoVoxbone.did]);
}
else {
this.showHelpMessages(["Active call in progress. Clear call and try again"]);
}
}
}
}
});
}));
Binary file added audioconf/audioconf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added audioconf/fonts/FontAwesome.otf
Binary file not shown.
Binary file added audioconf/fonts/fontawesome-webfont.eot
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions audioconf/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added audioconf/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added audioconf/fonts/fontawesome-webfont.woff
Binary file not shown.
Binary file added audioconf/fonts/fontawesome-webfont.woff2
Binary file not shown.
Binary file added audioconf/images/icon-sprite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added audioconf/images/widget-brand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions audioconf/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Audio Conference plugin for converse.js

<img src="https://github.com/conversejs/community-plugins/blob/master/audioconf/audioconf.png" />

## Overview
This plugin adds an audio conference feature a chat or groupchat. Both SIP and XMPP protocols are supported and a server-side conference bridge is required. For SIP, a PBX like Asterisk or FreeSWITCh can be used and for XMPP, a Colibri media server like Jitsi Videobridge is needed.


## Install
See https://m.conversejs.org/docs/html/plugin_development.html on how to install this plugin

## Configure
To configure, edit the audioconf.js plugin file and modify the click2Dial object

```
window.click2Dial = {
custom_button_color: "orange",
custom_frame_color: "black",
dial_pad: "true",
did: "3001",
display_button: "false",
div_css_class_name: "btn-style-round-a",
draggable: "true",
incompatible_browser_configuration: "hide_widget",
placement: "bottom-right",
rating: "false",
ringback: "true",
server_url: "./audioconf",
show_branding: "false",
show_frame: "true",
text: "Ask",
use_default_button_css: "true",
protocol: "xmpp", // 'sip' or 'xmpp'
sip: {domain: "192.168.1.251", server: "wss://desktop-545pc5b:7443/sip/proxy?url=ws://192.168.1.251:5066", register: false, caller_uri: "sip:[email protected]", authorization_user: "1002", password: "1234"},
xmpp: {domain: "meet.jit.si", server: "https://meet.jit.si/http-bind"}
}
```

Default setting will use the public meet.ji.si service to provide an XMPP (colibri) type audio conference. To have a SIP based audio conference with Asterisk or FreeSWITCH, change the protocol value to "sip" and edit the sip object accordingly.

## How to use
Click on the telephone icon on the conversation toolbar to display the modal form
Loading

0 comments on commit 9d36d9c

Please sign in to comment.