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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ion-phoner-js

v0.1.2

Published

Enhance Your Business Communication Productivity and Efficiency with Our Softphone and PBX Service

Readme

ION PHONER JS

Enhance Your Business Communication Productivity and Efficiency with Our Softphone and PBX Service

Experience the Ease of Unrestricted Communication

In today's digital age, effective and efficient communication is the cornerstone of running a successful business. Our softphone and PBX service is here to help you achieve that.

npm version npm bundle size jsDelivr hits (npm) NPM License Static Badge

Benefits of Using Softphone and PBX Service

  1. Boost productivity

    Softphones empower you to make phone calls from anywhere, anytime, using any device connected to the internet. This allows you to stay connected with your team and your customers, even when you're on the go.

  2. Enhance efficiency

    PBX can automate many phone tasks, such as call forwarding, auto-attendants, and conferencing. This can save you time and money.

  3. Reduce costs

    Softphones and PBX can help you save money on phone bills by reducing long-distance call charges and phone hardware rental fees.

  4. Increase scalability

    Softphones and PBX can easily scale to meet the growing needs of your business.

Key Features of Our Softphone and PBX Service

  1. HD voice quality

    Enjoy crystal-clear and interference-free voice quality.

  2. Comprehensive calling features

    Make voice and video calls, send instant messages, and host conferences.

  3. CRM integration

    Integrate your softphone with your CRM to easily access customer information.

  4. Monitoring and reporting

    Monitor your call activity and get detailed reports on phone usage.

1. Installation

npm install ion-phoner-js

Example usage:


import IonPhoner from "ion-phoner-js";

const opt = {
    credential: { host : 'https://example.com', 
                  token : 'example-token', 
                  userkey :'example-user'
                 },
    config: {
        dom: {
            localVideo: document.querySelector('#localVideo') as HTMLElement,
            remoteVideo: document.querySelector('#remoteVideo') as HTMLElement,
        }
    }
};

const phoner = new IonPhoner(opt);

Make sure you have HTML elements with the IDs localVideo and remoteVideo in your index.html file or DOM.

<video id="localVideo" autoplay></video>
<video id="remoteVideo" autoplay></video>

2. Connection

After initialization, call the connect() method to establish a connection to the server. The connection status will be updated via the isConnected variable.

let isConnected = false;

phoner.connect().then((e: any) => {
console.log('connect status', e);
isConnected = e?.status ?? false;
});

3. Event Handling

You can listen to various events emitted by the phoner object to monitor the connection and registration status.

phoner.on('connection-status', (e: any) => {
console.log('connection-status', e);
});

phoner.on('registration-status', (e: any) => {
console.log('registration-status', e);
});

4. Main Functions

The following functions are available in the phoner object for managing calls and status. Ensure isConnected is true before calling these functions.

4.1. register()

Registers a user to the phoner service.

function register() {
if (isConnected) phoner.register();
}

4.2. unregister()

Unregisters a user from the phoner service.

function unregister() {
if (isConnected) phoner.unregister();
}

4.3. hangup()

Ends an ongoing call.

function hangup() {
if (isConnected) phoner.hangup();
}

4.4. hold()

Puts a call on hold.

function hold() {
if (isConnected) phoner.hold();
}

4.5. unhold()

Cancels a call on hold.

function unhold() {
if (isConnected) phoner.unhold();
}

4.6. answer()

Answers an incoming call.

function answer() {
if (isConnected) phoner.answer();
}

4.7. mute()

Mutes the microphone.

function mute() {
if (isConnected) phoner.mute();
}

4.8. unmute()

Unmutes the microphone.

function unmute() {
if (isConnected) phoner.unmute();
}

4.9. dtmf(num: string)

Sends a DTMF (Dual-Tone Multi-Frequency) tone.

function dtmf(num: string) {
if (isConnected) phoner.dtmf(num);
}

4.10. dial()

Initiates a call to the specified phone number.

function dial() { 
const phone = (document.querySelector('#phone') as HTMLInputElement | null)?.value ?? ''; 

const call = phoner.call(phone); 

console.log('call', call);
}

Make sure you have an HTML element with the ID phone which is the input for the phone number.

<input type="text" id="phone" placeholder="Enter phone number">
<button onclick="dial()">Call</button>