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

@telnyx/rtc-sipjs-user-agent

v0.0.4

Published

Telnyx JavaScript WebRTC helpers backed by the SIP.js UserAgent API

Downloads

41

Readme

@telnyx/rtc-sipjs-user-agent

@telnyx/rtc-sipjs-user-agent exposes the classic TelnyxDevice/TelnyxCall helpers built directly on top of the SIP.js UserAgent surface. Use this package if you need low-level access to SIP.js sessions but still want the familiar Telnyx event wrapper.

Heads up: the legacy @telnyx/rtc-sipjs bundle is being split into this package and @telnyx/rtc-sipjs-simple-user. Teams that depended on @telnyx/rtc-sipjs for UserAgent workflows should move to @telnyx/rtc-sipjs-user-agent.

Installation

yarn add @telnyx/rtc-sipjs-user-agent
# or
npm install @telnyx/rtc-sipjs-user-agent

Usage

import { TelnyxDevice } from '@telnyx/rtc-sipjs-user-agent';

const device = new TelnyxDevice({
  host: 'sip.telnyx.com',
  port: 7443,
  wsServers: 'wss://sip.telnyx.com:7443',
  username: 'alice',
  password: 'supersecure',
});

await device.startWS();
await device.register();

const call = device.initiateCall('15551234567');
call.on('telnyx.sipjs.accepted', () => console.log('call connected!'));

See src/lib/telnyx-device.ts for all configuration options.

Events

Both TelnyxDevice and TelnyxCall extend EventEmitter and emit events with the telnyx.sipjs. prefix. You can listen to these events using the .on() method.

Event names are defined as enums for type safety:

  • DeviceEvent - Events for TelnyxDevice
  • CallEvent - Events for TelnyxCall

TelnyxDevice Events

| Event Name | Enum | Payload | Description | |------------|------|---------|-------------| | telnyx.sipjs.wsConnecting | DeviceEvent.WsConnecting | { attempts: number } | Fired when attempting to connect to the WebSocket server | | telnyx.sipjs.wsConnected | DeviceEvent.WsConnected | None | Fired when successfully connected to the WebSocket server | | telnyx.sipjs.wsDisconnected | DeviceEvent.WsDisconnected | None | Fired when disconnected from the WebSocket server | | telnyx.sipjs.registered | DeviceEvent.Registered | None | Fired when successfully registered with the SIP server | | telnyx.sipjs.unregistered | DeviceEvent.Unregistered | { cause: null, response: null } | Fired when unregistered from the SIP server | | telnyx.sipjs.registrationFailed | DeviceEvent.RegistrationFailed | { cause: Error \| string } | Fired when registration fails | | telnyx.sipjs.incomingInvite | DeviceEvent.IncomingInvite | { activeCall: TelnyxCall } | Fired when receiving an incoming call | | telnyx.sipjs.message | DeviceEvent.Message | { body: unknown } | Fired when receiving a SIP message |

Example:

import { TelnyxDevice, DeviceEvent } from '@telnyx/rtc-sipjs-user-agent';

// Using string event names
device.on('telnyx.sipjs.registered', () => {
  console.log('Successfully registered!');
});

// Or using enum constants (recommended for type safety)
device.on(DeviceEvent.Registered, () => {
  console.log('Successfully registered!');
});

device.on(DeviceEvent.IncomingInvite, ({ activeCall }) => {
  console.log('Incoming call received');
  activeCall.accept(); // or activeCall.reject()
});

device.on(DeviceEvent.RegistrationFailed, ({ cause }) => {
  console.error('Registration failed:', cause);
});

TelnyxCall Events

| Event Name | Enum | Payload | Description | |------------|------|---------|-------------| | telnyx.sipjs.connecting | CallEvent.Connecting | None | Fired when a call is being established | | telnyx.sipjs.accepted | CallEvent.Accepted | None | Fired when a call is answered/accepted | | telnyx.sipjs.terminated | CallEvent.Terminated | None | Fired when a call ends | | telnyx.sipjs.failed | CallEvent.Failed | Error \| string | Fired when a call operation fails | | telnyx.sipjs.rejected | CallEvent.Rejected | None | Fired when an incoming call is rejected | | telnyx.sipjs.muted | CallEvent.Muted | None | Fired when the call is muted | | telnyx.sipjs.unmuted | CallEvent.Unmuted | None | Fired when the call is unmuted | | telnyx.sipjs.dtmf | CallEvent.Dtmf | { tone: string, duration?: number } or undefined, digits: string | Fired when DTMF tones are sent or received | | telnyx.sipjs.info | CallEvent.Info | Info | Fired when a SIP INFO message is received | | telnyx.sipjs.notification | CallEvent.Notification | unknown | Fired for other SIP notifications |

Example:

import { CallEvent } from '@telnyx/rtc-sipjs-user-agent';

const call = device.initiateCall('1235556789');

// Using string event names
call.on('telnyx.sipjs.connecting', () => {
  console.log('Call is connecting...');
});

// Or using enum constants (recommended for type safety)
call.on(CallEvent.Connecting, () => {
  console.log('Call is connecting...');
});

call.on(CallEvent.Accepted, () => {
  console.log('Call answered!');
});

call.on(CallEvent.Terminated, () => {
  console.log('Call ended');
});

call.on(CallEvent.Failed, (error) => {
  console.error('Call failed:', error);
});

call.on(CallEvent.Muted, () => {
  console.log('Call muted');
});

call.on(CallEvent.Dtmf, (data, digits) => {
  console.log('DTMF received:', data || digits);
});

Scripts

  • yarn build – builds the UMD bundles and TypeScript declarations
  • yarn test – placeholder that keeps the workspace pipeline green
  • yarn typecheck – runs TypeScript against the sources