react-softphone
react-softphone copied to clipboard
SoftPhone component invalid hook call error
see in image below
Your root project has different react version
Try yarn add [email protected] or npm i [email protected]
Meanwile i will fix
Your root project has different react version
Try yarn add [email protected] or npm i [email protected]
Meanwile i will fix
I am also facing the same issue.
I tried with npm i [email protected]
still it's not working.
I faced this problem too.
-
npx create-react-app my-app --template typescript
- Edited
App.tsx
according to Usage and Issue https://github.com/prinze77/react-softphone/issues/10 -
npm start
- Got an error:
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
And npm i [email protected]
helped me.
@prinze77, thank you.
Unfortunetly, I can't connect to my Asterisk. I am trying to solve this problem.
Check the browser console log or the web socket messages in by pressing f12 in browser at network tab
Did you enabled the wss for 9000 extension in asterisk
Did you enabled the wss for 9000 extension in asterisk
Yes
Console:
WebSocket connection to 'wss://<some IP>:8089/' failed:
Asterisk:
tcptls.c:845 handle_tcptls_connection: FILE * open failed from peer '<my IP>:<some port>'!
I am trying to solve this problem.
Solve this problem. Asterisk couldn't access to private key and didn't listen wss.
Now I online, but can't call.
Application error on screen.
Thank you for your feedback I know that there are dependencies issues and im fixing them right now
Concerning the error that you have at photo above
Try to add to the top of main page index.js or app.js import "babel-polyfill";
And at package.json
"dependencies": { "babel-polyfill": "^6.26.0", "jssip": "^3.8.2", "react": "^16.13.1", "react-dom": "^16.13.1", "react-scripts": "1.0.14", "react-softphone": "^1.6.0" },
Try to add to the top of main page index.js or app.js import "babel-polyfill";
What should I import from this library?
Just like that
import "babel-polyfill";
More info here https://babeljs.io/docs/en/babel-polyfill/
import "babel-polyfill";
Did it.
When I tried imput number *43
for echo-test I got empty screen and errors in console (on photos).
I even didn't have time to press the button.
Check this boilerplate please
https://github.com/prinze77/my-app
Will it work on your machine? What node version you use?
It's works. You used base template create-react-app, without TypeScript?
Service-code *43
for echo-test doesn't work.
When it's rolled up, I can't see or hear the incoming call.
You used base template create-react-app, without TypeScript?
Yes
When it's rolled up, I can't see or hear the incoming call.
Fixed, need to checkout
Service-code *43 for echo-test doesn't work.
Thats an input validation issue. The input can only validate numbers. I will make a fix by adding to validation * and #. https://github.com/prinze77/react-softphone/blob/bc90f008ebb113cb62d0337068647171e785d4ad/src/index.js#L518-L523 Thank you for finding this bug