@xtreamr/react-xt-sip-phone
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

react-sip-phone

SIP phone component for use in react projects

NPM JavaScript Style Guide

Install

npm install --save react-sip-phone

Usage

import React, { Component } from 'react'

import { ReactSipPhone } from 'react-sip-phone'
import 'react-sip-phone/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 'react-sip-phone'
class MyApp extends Component {

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

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

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @xtreamr/react-xt-sip-phone

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

545 kB

Total Files

69

Last publish

Collaborators

  • dcantelar
  • mancas
  • pacorampas
  • xtreamr-ci
  • mirframai
  • frsela
  • guillaumeparis2000
  • mardito