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

callerpackage-sprinklr

v1.0.0

Published

Calling through popup using JsSIP

Downloads

1

Readme

todo

openNewPopup

CallerPackage

Caller Package is used to handle cross window calling service , using JsSIP. This library moved the intra-window calling logic to a popup window. This makes the state of popup window independent of state of parent window , overall mitigating the issues caused by this previously like refresh causing call end, etc.

Requirements

  • JsSIP : https://www.npmjs.com/package/jssip

        $ npm install --save jssip
  • path : https://www.npmjs.com/package/path

        $ npm install --save path

Installation

Configuration

Add Config details in popup.html manually or through running.

Getting Started

const callerPackage = new CallerPackage();

In popup.html , add config using input , or hardcode the config.

Attributes

This is needed to be configured in popup side.

config

{
	sip: , 
    password: , 
    server_address: , 
    port: 
}

Example:

{
	sip: sample1234, 
    password: samplePassword, 
    server_address: 12.34.56.78, 
    port: 7654/ws
}

Methods

connect()

This method is used to connect to popup. If popup is already active it will connect to that, otherwise it will start a new popup window.

Arguments
  • callback function
Example:
callerPackage.connect(() => {
    updateSocketConnectedInUI();
});

call()

This method is called to invoke call procedure.

Arguments
  • number
Example:
callerPackage.call('9838949386****');

endOut()

This method is called to end outgoing call.

callerPackage.endOut();

endIn()

This method is called to end incoming call.

callerPackage.endOut();

hold()

This method is called to hold ongoing call.

callerPackage.hold();

unhold()

This method is called to unhold ongoing call.

callerPackage.unhold();

mute()

This method is called to mute ongoing call.

callerPackage.mute();

unmute()

This method is called to unmute ongoing call.

callerPackage.unmute();

Events

Syntax for all events is as follow.

callerPackage.on(event,callback);

Example

callerPackage.on('INFORM_SOCKET_CONNECTED',()=>{
    console.log('Socket is connected');
});

INFORM_SOCKET_CONNECTED

Fired when socket is connected in popup window.

INFORM_SOCKET_DISCONNECTED

Fired when socket is disconnected in popup window.

ACK_OUTGOING_CALL_START

Fired when outgoing call is connected.

ACK_OUTGOING_CALL_END

Fired when outgoing call is ended.

ACK_OUTGOING_CALL_FAIL

Fired when outgoing call is failed.

ACK_CALL_HOLD

Fired when call is put on hold.

ACK_CALL_UNHOLD

Fired when call is put on unhold.

ACK_CALL_MUTE

Fired when call is put on mute.

ACK_CALL_UNMUTE

Fired when call is put on unmute.

ACK_SESSION_DETAILS

Fired when session details is recieved.

Example

callerPackage.on('ACK_SESSION_DETAILS',()=>{
        console.log('Session details fetched from popup');
        let sessionDetails = callerPackage.getCallObject();
        console.log(sessionDetails);
});