Coder Social home page Coder Social logo

macide213 / telnyx-rtc-sipjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from team-telnyx/telnyx-rtc-sipjs

0.0 0.0 0.0 759 KB

Telnyx JavaScript library for building WebRTC apps with SIP.js

Home Page: https://webrtc.telnyx.com/

JavaScript 100.00%

telnyx-rtc-sipjs's Introduction

Telnyx WebRTC SIP JavaScript library

npm (scoped)

The Telnyx SIP-based WebRTC JS library powers up your web application with the ability to make and receive phone calls directly in the browser.

Check out the library in action in this web dialer demo.

Looking for more WebRTC features, JSON-RPC support or need to quickly get spun up with a React app? Telnyx also has a robust WebRTC SDK available as a separate npm module.

Installation

Install this package with npm:

$ npm install --save @telnyx/rtc-sipjs

or using yarn:

$ yarn add @telnyx/rtc-sipjs

Usage

Import TelnyxDevice in the module where you need it.

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

Example config and initiation

let config = {
  host: 'sip.telnyx.com',
  port: '7443',
  wsServers: 'wss://sip.telnyx.com:7443',
  displayName: 'Phone User',
  username: 'testuser',
  password: 'testuserPassword',
  stunServers: 'stun:stun.telnyx.com:3478',
  turnServers: {
    urls: ['turn:turn.telnyx.com:3478?transport=tcp'],
    username: 'turnuser',
    password: 'turnpassword',
  },
  registrarServer: 'sip:sip.telnyx.com:7443',
};

let device = new TelnyxDevice(config);

Example phone call

let activeCall = device.initiateCall('1235556789');

activeCall.on('connecting', () => {
  console.log("it's connecting!");
});
activeCall.on('accepted', () => {
  console.log("We're on a phone call!");
});

See the TelnyxDevice and TelnyxCall for more details.

Development

Building the package

When working on the package directly, please use yarn instead of npm.

$ yarn build
# Or to watch for changes to files:
$ yarn start

Running tests

$ yarn test

Generating Docs

We use jsdoc-to-markdown to generate GitHub friendly docs.

$ yarn docs

telnyx-rtc-sipjs's People

Contributors

arunkumar-telnyx avatar deividveloso avatar leff avatar macide213 avatar suayoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.