-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
admin
authored and
admin
committed
May 4, 2020
1 parent
34b9130
commit 56d6075
Showing
2 changed files
with
53 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,16 +13,46 @@ npm install --save react-softphone | |
## Usage | ||
|
||
```jsx | ||
import React, { Component } from 'react' | ||
|
||
import React from 'react' | ||
import { SoftPhone } from 'react-softphone' | ||
import { WebSocketInterface } from 'jssip'; | ||
|
||
const config = { | ||
domain: '[email protected]', // [email protected] | ||
uri: 'sip:[email protected]', // sip:[email protected] | ||
password: 'secret', // PASSWORD , | ||
ws_servers: 'wss://[email protected]:8089/ws', //ws server | ||
sockets: new WebSocketInterface('wss://[email protected]:8089/ws'), | ||
display_name: '***',//jssip Display Name | ||
debug: false // Turn debug messages on | ||
|
||
}; | ||
const setConnectOnStartToLocalStorage =(newValue)=>{ | ||
|
||
|
||
//Save newValue of connect on start to local storage | ||
|
||
const Example = () => { | ||
const example = SoftPhone() | ||
return true | ||
} | ||
|
||
function App() { | ||
return ( | ||
<div>{example}</div> | ||
) | ||
<div className="App"> | ||
<header className="App-header"> | ||
<SoftPhone | ||
callVolume={33} //Set Default callVolume | ||
ringVolume={44} //Set Default ringVolume | ||
connectOnStart={false} //Auto connect to sip | ||
config={config} //Voip config | ||
setConnectOnStartToLocalStorage={setConnectOnStartToLocalStorage} // Callback function | ||
/> | ||
</header> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; | ||
|
||
``` | ||
|
||
## License | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters