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 🙏

© 2025 – Pkg Stats / Ryan Hefner

da-dialler

v2.7.0

Published

`da-dialler` is a lightweight and easy-to-integrate softphone package for React and Next.js applications. It provides a seamless way to add VoIP dialing capabilities with SIP configurations, click-to-dial functionality, and customizable notifications.

Downloads

466

Readme

da-dialler

da-dialler is a lightweight and easy-to-integrate softphone package for React and Next.js applications. It provides a seamless way to add VoIP dialing capabilities with SIP configurations, click-to-dial functionality, and customizable notifications.

Features

  • 📞 Softphone Integration – Easily connect to a SIP server to handle VoIP calls.
  • 🎯 Click-to-Dial Support – Enable users to initiate calls with a single click.
  • 🔔 Custom Notifications – Get notified of connection status and call events.
  • 🔧 Configurable SIP Settings – Customize the SIP agent name, domain, and auto-connect options.
  • 🚀 Optimized for Next.js and React – Works with SSR and client-side environments.
  • 🌐 DaProvider for Global Context – Ensures proper SIP connection handling across the app.

Installation

Install the package via npm:

npm install da-dialler@latest

Usage in React

1. Import and Setup the Dialler Component

Create a file for your dialler component (e.g., Dialler.tsx) and configure it as follows:

"use client";
import DaDialler, {
  DaProvider,
  InitPhoneConfig,
  NotificationPlacement,
  useClickDial,
  usePhone,
} from "da-dialler";
import { useEffect } from "react";

const notify = (
  type: string,
  placement: NotificationPlacement,
  message: string,
  description: string
) => {
  // Handle Notification toasts
  console.log(type, placement, message, description);
};

const initSipConfig: InitPhoneConfig = {
  notificationCallback: notify,
  customAgentName: "Name",
  sipPassword: "Password",
  sipExtension: "0000",
  sipDomainURL: "demo.example.com",
  domainPort: "7443",
  autoConnect: false,
};

function Dialler(config: InitPhoneConfig) {
  const phone = usePhone();

  useEffect(() => {
    if (phone.phone && !phone.phone.isConnected) phone.handleConnect();
    if (phone.phone) console.log("Phone State", { ...phone });
  }, [phone]);
  return <DaDialler.Dialler {...config} />;
}

export default Dialler;

Usage in Next.js

2. Wrap the App with DaProvider

To ensure global context management, wrap your application with DaProvider inside _app.tsx (for Next.js with pages router) or in your root layout (for Next.js with the app router).

For Next.js (Pages Router) - _app.tsx

import { DaProvider } from "da-dialler";

function MyApp({ Component, pageProps }) {
  return (
    <DaProvider>
      <Component {...pageProps} />
    </DaProvider>
  );
}

export default MyApp;

For Next.js (App Router) - layout.tsx

import { DaProvider } from "da-dialler";

export default function RootLayout({ children }) {
  return (
    <DaProvider>
      {children}
    </DaProvider>
  );
}

3. Integrate in a Page (e.g., pages/index.tsx or app/page.tsx)

import Dialler from "../components/Dialler";
import { DaProvider, useClickDial } from "da-dialler";

function DialButton({ number }: { number: string }) {
  const clickToDial = useClickDial();
  return (
    <div className="absolute top-[10px] right-[10px] flex">
      <p className="font-sm text-secondary">{number}</p>
      <button
        className="grid place-items-center 
                 border border-gray-300 rounded-sm p-2 
                 bg-gray-100 hover:bg-gray-200 active:bg-gray-300 
                 text-gray-600 hover:text-gray-800 
                 transition-colors"
        onClick={() => clickToDial(number)}
      >
        📞
      </button>
    </div>
  );
}

export default function Home() {
  return (
    <DaProvider>
      <div className="relative grid grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-sans)]">
        <main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
          <Dialler {...initSipConfig} />
        </main>
        <DialButton number="254790176105" />
      </div>
    </DaProvider>
  );
}

Configuration Options

| Option | Type | Description | |----------------------|---------|-----------------------------------------------| | notificationCallback | Function | Handles custom notifications when SIP events occur. | | customAgentName | string | Sets a custom SIP agent name. | | sipPassword | string | Password for SIP authentication. | | sipExtension | string | Extension number for the SIP account. | | sipDomainURL | string | SIP server domain URL. | | domainPort | string | SIP server port. | | autoConnect | boolean | Automatically connect to SIP when the component mounts. |


License

This package is open-source and available under the MIT License.


Support

For any issues, feature requests, or contributions, please open an issue on the repository.


🚀 Start integrating da-dialler today and power up your React & Next.js applications with VoIP!