npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bandyer/web-communication-center

v3.6.0

Published

web communication center for Bandyer services

Downloads

146

Readme

Bandyer Web Communication Center

The Communication Center allows the creation of a new channel that will facilitate the adoption of our technology within existing systems. The Communication Center creates a configured channel to forward all calls notifications and alerts. The latter regard all calls activities made by users - using the integrated technology - such as calls invitations, alerts of busy users and so on.

API docs: https://docs.bandyer.com/Bandyer-Web-Communication-Center

How Bandyer Communication Center works?

The Bandyer Communication Center makes possible to create a Call between two or more participants. The client who initiate the call is called initiator. The call initiator creates the call specifying the participants.

import CommunicationCenter from '@bandyer/web-communication-center';
var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');
BandyerCommCenter.connect()

The initialize method returns a CommunicationCenter object. Note that calling the method does not connect the SDK to Bandyer Servers. You must call the method connect.

Start a call

var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');
await BandyerCommCenter.connect()
BandyerCommCenter.call(['user_fake_1', 'user_fake_2'], {})

Once the SDK is connected to the Bandyer server, you can initiate a call using the .call method. You must specify an array of participants and valid options for the call.

Handle incoming call

Once the SDK is connected, it fires events regarding the calls. One of the most important event is the incoming_call event. The incoming_call event handles the incoming call request from the server. For example:

var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');
await BandyerCommCenter.connect()
BandyerCommCenter.on('incoming_call', function(call){
	// call contains a call Object with all the relative methods such as answer,reject and hangUp.
	// For example: call.answer() || call.decline(declineReason) || call.hangUp(stopReason)
})

Answer a call

To answer a call, use the answer method in the Call object. The Call object is available either as a data in the incoming call event or from the global object using the .getCall(roomAlias) method. For example:

var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');

// 1st method
await BandyerCommCenter.connect()
BandyerCommCenter.on('incoming_call', function(call){
	call.answer();
}) 

// 2nd method
await BandyerCommCenter.connect()
BandyerCommCenter.getCall('rmn_fake_1234').answer();

Once you answered the call, the Call object will be decorated with the token to connect to the Room of @bandyer/web-core-av.

Decline a call

To decline a call, use the decline method in the Call object. The Call object is available either as a data in the incoming call event or from the global object using the .getCall(roomAlias) method. For example:

var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');

// 1st method
await BandyerCommCenter.connect()
BandyerCommCenter.on('incoming_call', function(call) {
	call.decline();
}) 

// 2nd method
await BandyerCommCenter.connect()
BandyerCommCenter.getCall('rmn_fake_1234').decline();

Events

The communication center object fires the following events:

| Event | Description | | -------------- | :--------------------: | | incoming_call | Fired when you are receiving a call | | call_dial_answered | Fired when a user answers to the ongoing call | | call_dial_declined | Fired when a user declines to the ongoing call | | call_dial_stopped | Fired when a user stops to the ongoing call | | user_connected | Fired when a user connects to the Communication Center | | user_disconnected | Fired when a user disconnects from Communication Center |

incoming_call

The incoming_call event is fired when the communication center receives an incoming call for the user connected. The incoming_call event contains the Call object decorated with all the data required to connect to the room.

var BandyerCommCenter = CommunicationCenter.initialize('user_fake_1', 'wApp_fake123456789', 'sandbox');

await BandyerCommCenter.connect()
BandyerCommCenter.on('incoming_call', function(call) {
	// Call object 
}) 

call_dial_answered

The call_dial_answered event is fired when the communication center receives an answer response related to the ongoing call. For every user who answer the call, you will receive the call_dial_answered.

call_dial_declined

The call_dial_declined event is fired when the communication center receives a decline response related to the ongoing call. For every user who decline the call, you will receive the call_dial_declined.

call_dial_stopped

The call_dial_stopped event is fired when the caller hangs up the call during the dial action.

user_connected

The user_connected event is fired when a user of your company connects to Communication Center.

user_disconnected

The user_disconnected event is fired when a user of your company disconnects from Communication Center.