Skip to content

dec112/ng112-js-sip-adapter-jssip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng112-js-sip-adapter-jssip

An adapter for ng112-js for using JsSIP as a SIP stack.

License: GNU AGPL-3.0
Proprietary licenses are available on request.
Maintainer: Gabriel Unterholzer (gabriel.unterholzer@dec112.at)

Installation

npm install ng112-js-sip-adapter-jssip

Usage

This library already comes with a factory that is ready to use with ng112-js.

import { Agent } from 'ng112-js/dist/node';
import { JsSipAdapter } from 'ng112-js-sip-adapter-jssip';

new Agent({
  sipAdapterFactory: JsSipAdapter.factory,
  // [...]
});

In addition, node environments will also need to install jssip-node-websocket, which is a peer dependency of ng112-js-sip-adapter-jssip

npm install jssip-node-websocket

Build issues

Some environments may cause problems not being able to resolve JsSIP types correctly, as JsSIP does not come with types included, but they are provided by an additional package @types/jssip.

Build output might look like this:

Error: node_modules/ng112-js/dist/types/models/message.d.ts:81:20 - error TS2503: Cannot find namespace 'JsSIP'.
81     jssipMessage?: JsSIP.UserAgentNewMessageEvent;

In these cases add the following to the compilerOptions section in your tsconfig.json.
It will tell TypeScript the location where to look for jssip types:

{
  // [...]
  "compilerOptions": {
    // [...]
    "paths": {
      "jssip" : ["node_modules/@types/jssip"]
    }
  }
}

More information on this: https://www.typescriptlang.org/tsconfig#paths

Local Build

npm install
npm run build

This project was bootstrapped with TSDX

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published