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

@voicenter-team/vsip-next

v1.1.22

Published

--- title: Getting started description: This library is a wrapper over the opensips-js implementation. navigation: title: Getting Started ---

Downloads

19

Readme


title: Getting started description: This library is a wrapper over the opensips-js implementation. navigation: title: Getting Started

Getting started

Description

This library is a wrapper over the opensips-js implementation. It provides a Vue 3 composable for reactive work with opensips-js functionality. Call useVsipProvide on the top level of Vue components and then use useVsipInject in the child components to use reactive opensips-js functionality.

Basic Usage

ProviderWrapper.vue

<template>
  <div ref="wrapper">
    <VSipPhone v-if="state.isInitialized" />
    <div v-else>Not initialized</div>
  </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useVsipProvide } from '@voicenter-team/vsip-next'
import VSipPhone from '@/VSipPhone.vue'

const { actions, state } = useVsipProvide()
actions.init('wss07.voicenter.co', '', '')
</script>

VSipPhone.vue

<template>
    ...
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useVsipInject } from '@/index'

const { state, actions } = useVsipInject()
const {
  selectedInputDevice,
  selectedOutputDevice,
  muteWhenJoin,
  isDND,
  addCallToCurrentRoom,
  microphoneInputLevel,
  speakerVolume,
  isMuted,
  callAddingInProgress,
  activeCalls,
  callsInActiveRoom,
  currentActiveRoomId,
  activeRooms
} = state

const {
  initCall,
  sendDTMF,
  muteCaller,
  unmuteCaller,
  terminateCall,
  transferCall,
  mergeCall,
  holdCall,
  unholdCall,
  answerCall,
  moveCall,
  mute,
  unmute
} = actions

/* Other code */
</script>

Composable

State

| Name | Description | Type | Default | |-------------------------|:-------------------------------------|:---------------------------------------------------------------------------------------------------|:--------| | isInitialized | Defines if opensips-js is initialized | boolean | false | | activeCalls | Active calls | { [key: string]: ICall } | {} | | callsInActiveRoom | Calls in active room | Array<Call> | [] | | activeMessages | Active MSRP messages | { [key: string]: IMessage } | {} | | addCallToCurrentRoom | Defines if new call should be added to current room | boolean | false | | callAddingInProgress | Represents call id of progressing call if such call exists | string / undefined | undefined | | activeRooms | Active rooms | { [key: number]: IRoom } | {} | | msrpHistory | MSRP messages history | { [key: string]: Array<MSRPMessage> } | {} | | availableMediaDevices | List of available media devices | Array<MediaDeviceInfo> | [] | | inputMediaDeviceList | List of available input media devices | Array<MediaDeviceInfo> | [] | | outputMediaDeviceList | List of available output media devices | Array<MediaDeviceInfo> | [] | | selectedOutputDevice | ID of selected output device | string | 'default' | | selectedInputDevice | ID of selected input device | string | 'default' | | muteWhenJoin | Defines if agent will be muted when joining call | boolean | false | | isDND | Defines usage agent's 'Do Not Disturb' option | boolean | false | | originalStream | Agent's Audio Stream object | MediaStream / null | null | | currentActiveRoomId | Defines agent's active room | number / undefined | undefined | | callStatus | Calls' statuses | { [key: string]: ICallStatus } | {} | | callTime | Calls' times | { [key: string]: ITimeData } | {} | | callMetrics | Calls' metrics | { [key: string]: unknown } | {} | | autoAnswer | Defines if auto-answer is enabled | boolean | false | | microphoneInputLevel | Microphone sensitivity (range is from 0 to 2) | number | 2 | | speakerVolume | Speaker volume (range is from 0 to 1) | number | 1 |

Methods

| Name | Interface | Description | |-------------------|:---------------------------|:-------| | init | (domain: string, username: string, password: string): void | Initialize opensips-js | | initCall | (target: string, addToCurrentRoom: boolean) => void | Make a call | | answerCall | (callId: string) => void | Answer call | | terminateCall | (callId: string) => void | Hangup call | | muteCaller | (callId: string) => void | Mute caller | | unmuteCaller | (callId: string) => void | Unmute caller | | mute | () => void | Mute ourself | | unmute | () => void | Unmute ourself | | transferCall | (callId: string, target: string) => void | Transfer call | | mergeCall | (roomId: number) => void | Merge calls in room (works only when 2 call in room) | | mergeCallByIds | (firstCallId: string, secondCallId: string) => void | Merge calls by their ids | | holdCall | (callId: string, automatic?: boolean) => void | Hold a call | | unholdCall | (callId: string) => void | Unhold a call | | moveCall | (callId: string, roomId: number) => Promise<void> | Move call to another room | | setMicrophone | (deviceId: string) => Promise<void> | Set microphone which to use | | setSpeaker | (deviceId: string) => Promise<void> | Set speaker which to use | | sendDTMF | (callId: string, value: string) => void | Send DTMF | | setActiveRoom | (roomId: number / undefined) => Promise<void> | Set current active room | | setMicrophoneSensitivity | (value: number) => void | Set microphone sensitivity. Value should be in range from 0 to 1 | | setSpeakerVolume | (value: number) => void | Set speaker volume. Value should be in range from 0 to 1 | | setAutoAnswer | (value: boolean) => void | Set auto-answer | | setDND | (state: boolean) => void | Set 'Do not Disturb' option | | msrpAnswer | (callId: string) => void | Answer MSRP invite | | messageTerminate | (callId: string) => void | Terminate MSRP session | | sendMSRP | (msrpSessionId: string, body: string) => void | Send MSRP message | | initMSRP | (target: string, body: string, options: object) => void | Send MSRP invite |