react-sip-phone-web
TypeScript icon, indicating that this package has built-in type declarations

1.0.87 • Public • Published

react-sip-phone-web

SIP phone component for use in react projects

NPM JavaScript Style Guide

Install

npm install --save react-sip-phone-web

Usage

import React, { Component } from 'react'

import { ReactSipPhone } from 'react-sip-phone-web'
import 'react-sip-phone-web/dist/index.css'

class Example extends Component {
  render() {
    return (
      <ReactSipPhone
        name={name}
        sipCredentials={{
          sipuri: sipuri,
          password: password
        }}
        sipConfig={{
          websocket: websocket,
          defaultCountryCode: '1'
        }}
        width={400}
      />
    )
  }
}

To make calls from outside of the component, import the phone's store and access the SIP Account once it is registered

import { ReactSipPhone, phoneStore } from 'iuehadnjfhasdiuf-hishdiug'
class MyApp extends Component {

  makeCall(number) {
    const sipAccount = phoneStore.getState().sipAccounts.sipAccount
    if (sipAccount && number) {
      sipAccount.makeCall(number)
    }
  }

  render() {
    return <ReactSipPhone ... />
  }
}

License

MIT

/react-sip-phone-web/

    Package Sidebar

    Install

    npm i react-sip-phone-web

    Weekly Downloads

    29

    Version

    1.0.87

    License

    MIT

    Unpacked Size

    798 kB

    Total Files

    65

    Last publish

    Collaborators

    • vrushali-neosoft