Naturally Pacifist Marsupials

    @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

    Keywords

    none

    Install

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

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    545 kB

    Total Files

    69

    Last publish

    Collaborators

    • ralliv
    • joelgarcia
    • santimg
    • arnaumarch
    • mancas
    • pacorampas
    • sergio-deka
    • xtreamr-ci
    • nandawtek
    • pblanco-dekalabs
    • mirframai
    • frsela
    • smgaragorri
    • guillaumeparis2000
    • mardito