prinze77 / react-softphone Goto Github PK
View Code? Open in Web Editor NEWWebrtc asterisk sip SoftPhone react functional component
Webrtc asterisk sip SoftPhone react functional component
Packages :
{
"name": "tips",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-native": "0.64.3",
"react-native-web": "0.17.1",
"jssip": "^3.8.2",
"jssip-node-websocket": "^3.0.0",
"react-native-jssip": "^3.7.6",
"react-softphone": "^1.7.0"
},
"devDependencies": {
"@babel/core": "^7.12.9"
},
"private": true
}
const config = {
domain: '', // [email protected]
uri: 'sip:@..', // sip:[email protected]
password: '', // PASSWORD ,
ws_servers: 'wss://', //ws server
sockets: new WebSocketInterface(''),
display_name: '______________',//jssip Display Name
debug: true // Turn debug messages on
};
const setConnectOnStartToLocalStorage = (newValue) => {
// Handle save the auto connect value to local storage
return true
}
const setNotifications = (newValue) => {
try {
requestCameraPermission();
// Handle save the Show notifications of an incoming call to local storage
return true
} catch (e) {
return false;
}
}
const setCallVolume = (newValue) => {
// Handle save the call Volume value to local storage
return true
}
const setRingVolume = (newValue) => {
// Handle save the Ring Volume value to local storage
return true
}
const requestCameraPermission = async () => {
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.CAMERA,
{
title: "Cool Photo App Camera Permission",
message:
"Cool Photo App needs access to your camera " +
"so you can take awesome pictures.",
buttonNeutral: "Ask Me Later",
buttonNegative: "Cancel",
buttonPositive: "OK"
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log("You can use the camera");
} else {
console.log("Camera permission denied");
}
} catch (err) {
console.warn(err);
}
};
ReferenceError: Can't find variable: Notification
This error is located at:
in SoftPhone (created by App)
in RCTView (created by View)
in Unknown (created by App)
in App (created by ExpoRoot)
in ExpoRoot
in RCTView (created by View)
in Unknown (created by AppContainer)
in RCTView (created by View)
in Unknown (created by AppContainer)
in AppContainer
at node_modules\react-native\Libraries\LogBox\LogBox.js:149:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:60:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:34:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:172:19 in handleException
at node_modules\react-native\Libraries\Core\ReactFiberErrorDialog.js:43:2 in showErrorDialog
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15792:34 in logCapturedError
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:15884:20 in update.callback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7199:2 in callCallback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:7220:20 in commitUpdateQueue
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:16632:25 in commitLifeCycles
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:19216:22 in commitLayoutEffects
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:93:4 in invokeGuardedCallbackProd
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:318:2 in invokeGuardedCallback
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18952:29 in commitRootImpl
at node_modules\react-native\node_modules\scheduler\cjs\scheduler.development.js:468:23 in unstable_runWithPriority
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18791:17 in commitRoot
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:18192:12 in performSyncWorkOnRoot
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5911:33 in runWithPriority$argument_1
at node_modules\react-native\node_modules\scheduler\cjs\scheduler.development.js:468:23 in unstable_runWithPriority
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5906:23 in flushSyncCallbackQueueImpl
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:5893:28 in flushSyncCallbackQueue
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:17745:30 in scheduleUpdateOnFiber
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:21484:23 in updateContainer
at node_modules\react-native\Libraries\Renderer\implementations\ReactNativeRenderer-dev.js:22144:17 in render
at node_modules\react-native\Libraries\ReactNative\renderApplication.js:58:4 in renderApplication
at node_modules\react-native\Libraries\ReactNative\AppRegistry.js:117:25 in runnables.appKey.run
at node_modules\react-native\Libraries\ReactNative\AppRegistry.js:202:4 in runApplication
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:414:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:113:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:365:10 in __guard
at node_modules\regenerator-runtime\runtime.js:294:29 in invoke
at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch
at node_modules\regenerator-runtime\runtime.js:155:27 in invoke
at node_modules\regenerator-runtime\runtime.js:165:18 in PromiseImpl.resolve.then$argument_0
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:123:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:177:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:437:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:388:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:132:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:365:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:131:4 in flushedQueue
I Think Notification is not imported From react-native..
can you help please ?
I have tried to run but not working
How can I configure ICE Server using React?
iceServers: [
{
urls: "turns:webrtc.domain.com:5349?transport=tcp",
//urls: "turn:webrtc.domain.com",
username: "eoliveira",
credential: "190790edu"
}
]
How to access certain functions such as calling, mute, hold from this library and use it in our own custom dial pad component?
So my requirement is to show incoming caller number.
Also, to parse the SIP identity header and display name and other info of the caller. How can I do it?
Hi, all.
npx create-react-app my-app --template typescript
App.tsx
according to Usagenpm start
TS7016: Could not find a declaration file for module 'react-softphone'
npx create-react-app my-app --template typescript
App.tsx
according to Usage and Issue #10npm start
Error: Invalid hook call. Hooks can only be called inside of the body of a function component.
This is my config-object:
const config = {
domain: '<some IP>', // [email protected]
uri: 'sip:9000@<some IP>', // sip:[email protected]
password: '<some password>', // PASSWORD ,
ws_servers: 'wss://9000@<some IP>:8089', //ws server
sockets: new WebSocketInterface('wss://<some IP>:8089'),
display_name: '9000',//jssip Display Name
debug: false // Turn debug messages on
};
9000
- my internal Asterisk number.
<some IP>
- Asterisk server IP
<some password>
- password for 9000 number on Asterisk
Good morning. I'm having some issues trying to connect to a SIP server, mainly with the Web Socket part. Could someone help me finding where to get the correct parameters to connect to my server?
Thanks in advance.
Is this component supported by safari? I have audio problems and can't hear the call. Everything works well in Chrome macos. I have already given permission to the site. Maybe there is something else that I missed?
I used example from here https://codesandbox.io/s/sip-with-react-forked-tss3ps.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.