iuehadnjfhasdiuf-hishdiug
v1.5.2
Published
SIP phone component for use in react projects
Downloads
9
Readme
iuehadnjfhasdiuf-hishdiug
SIP phone component for use in react projects
Install
npm install --save iuehadnjfhasdiuf-hishdiug
Usage
import React, { Component } from 'react'
import { ReactSipPhone } from 'iuehadnjfhasdiuf-hishdiug'
import 'iuehadnjfhasdiuf-hishdiug/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