@tmsoft/webphone

WebPhone - SIP softphone component for Vue 3 and Web Components
11,607
Install
npm install @tmsoft/webphone
Latest Version:5.0.9
Vue:3
License:MIT
Last Updated:Oct 21, 2026
Links: npm
Maintainer: alternaus

@tmsoft/webphone

npm version License: MIT

SIP softphone component for Vue 3 and Web Components.

Installation

npm install @tmsoft/webphone

Usage

Vue 3

<script setup lang="ts">
import { WebPhone } from '@tmsoft/webphone'
</script>

<template>
  <WebPhone host="pbx.example.com" extension="1001" password="your-password" />
</template>

Web Component

<script src="https://unpkg.com/@tmsoft/webphone/dist/webphone.component.js"></script>

<web-phone host="pbx.example.com" extension="1001" password="your-password"></web-phone>

Props

Prop Type Required Default Description
host string No* — SIP server hostname. WebSocket URL: wss://<host>:8089/asterisk/ws
wsUrl string No* — Custom WebSocket URL. Takes precedence over host
extension string Yes — SIP extension
password string Yes — SIP password
mode 'webcall' | 'call' | 'video' No 'call' Operating mode
logo string No — Logo URL for webcall mode
to string No — Auto-dial number for webcall mode
contacts WebPhoneContact[] No [] Contact list
initialKeypadVisible boolean No true Initial keypad visibility
enablePictureInPicture boolean No true Enables Document Picture-in-Picture
maskNumber boolean No false Masks the displayed call number after its first 3 digits (for example, 315*******)
earlyMedia boolean No false Enables audio from provisional SIP responses with SDP for outbound, non-forking calls
onAnswer (video: boolean) => void | Promise<void> No — Custom handler for answer action (incoming call)
onHangup () => void | Promise<void> No — Called when hangup is requested; SIP hangup is always sent by the component
onReject () => void | Promise<void> No — Custom handler for reject action (incoming call)

* Either host or wsUrl must be provided.

Modes

Mode Description
call Standard softphone with keypad and call history
video Softphone with video support
webcall Click-to-call widget. Requires to and logo

Types

interface WebPhoneContact {
  name: string
  number: string
  type?: 'tool' | 'extension' | 'contact' | 'voicemail'
}

Action handlers

If onAnswer or onReject are provided, the component calls those props instead of executing the corresponding internal SIP action. onHangup is called in addition to the internal SIP hangup, which the component always initiates.

Events

Event Description
back Back button pressed
call-context Emits channelId, SIP Call-ID, direction and remote number when a SIP session is created
call-state Emits dialing, ringing, connected, ended or failed with the call context
media-ready Emits separate localStream and remoteStream objects when both audio tracks are ready

sipCallId is the SIP dialog identifier. It is not the Asterisk Uniqueid or Linkedid. Consumers may read the emitted streams but must not stop or mutate their tracks; the WebPhone owns their lifecycle.

Releasing a new version

Publishing is automated: CI reacts to what you push, so a release is a version bump plus a push. Never run npm publish by hand.

# 1. Land the changes on master first — CI publishes what the tag points at.
git checkout master && git pull

# 2. Bump. Creates the release commit AND the tag in one step.
npm version patch     # or minor / major

# 3. Push the commit together with its tag.
git push --follow-tags

Step 2 needs no extra flags because .npmrc already pins the release conventions: git-tag-version=true creates the tag, tag-version-prefix=v names it vX.Y.Z, and message="chore(release): v%s" writes the commit subject. Bump minor or major for anything past a patch, but keep in mind consumers pinned to ^3.0.x still pick a new minor up automatically.

What CI does with the tag

Workflow Triggered by Publishes to
ci.yml push to master / develop, tags v*, PRs — builds and uploads the dist artifact
publish-npm.yml successful CI on master or a v* tag npm as @tmsoft/webphone
publish-github.yml successful CI on a v* tag only GitHub Packages, rescoped to the repo owner

Both publish jobs reuse the dist artifact CI already built and fall back to yarn install && yarn build:lib if the download fails.

Pushing to master without a version bump also fires the npm publish job, and it fails on the already-taken version. Harmless, but it is why a red publish run right after a merge is usually not a real problem.

Consuming the new version

Downstream projects use Yarn 4:

yarn up @tmsoft/webphone            # latest — also rewrites the range in package.json
yarn up @tmsoft/webphone@^3.0.19    # a specific version

Yarn refuses packages younger than its npmMinimalAgeGate (24 h by default), which a release published minutes ago always trips. Consumers that need to pick a version up immediately set npmMinimalAgeGate: 0 in their .yarnrc.yml — as this repo and calloperator-frontend both do.

Verify the published bundle actually carries the change instead of trusting the version number, since the publish jobs reuse a prebuilt artifact:

node -p "require('./node_modules/@tmsoft/webphone/package.json').version"

License

MIT

Related Packages

@voicenter-team/vsip

A vue based jssip wrapper.

2,510 6
@vostone/web-sdk

Vue 3 composables for WebRTC SIP calling and local media

1,267
@vue/web-component-wrapper

wrap a vue component as a web component.

26,969,355
@telia/vue-web-component-wrapper-ie11

wrap a vue component as a web component, for IE 11 too.

4,272 19
prot-table

A customizable table component in vue. Intended to be used as a web-component.

2,236 5

Version History

Version Released Vue License
5.0.9 ^3.5.25 MIT
5.0.8 ^3.5.25 MIT
5.0.4 ^3.5.25 MIT
5.0.3 ^3.5.25 MIT
5.0.1 ^3.5.25 MIT