Commit 63f2675b authored by Muhammadali's avatar Muhammadali

update-

parent bcafa22e
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "3.3.4", "version": "3.3.7",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "boxdialer", "name": "boxdialer",
"version": "3.3.4", "version": "3.3.7",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@emotion/react": "^11.11.1", "@emotion/react": "^11.11.1",
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"@mui/icons-material": "^5.14.3", "@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.5", "@mui/material": "^5.14.5",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"ecmascript-webrtc-sipml": "git+https://git.4u.uz/kulya/ecmascript-webrtc-sipml.git",
"i": "^0.3.7", "i": "^0.3.7",
"jssip": "^3.10.0", "jssip": "^3.10.0",
"npm": "^10.1.0", "npm": "^10.1.0",
...@@ -4016,11 +4015,6 @@ ...@@ -4016,11 +4015,6 @@
"tslib": "^2.0.3" "tslib": "^2.0.3"
} }
}, },
"node_modules/ecmascript-webrtc-sipml": {
"version": "1.0.13",
"resolved": "git+https://git.4u.uz/kulya/ecmascript-webrtc-sipml.git#73f2d59232c3a817d63f00aab65b042bc05baea2",
"license": "ISC"
},
"node_modules/ee-first": { "node_modules/ee-first": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
......
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "3.3.7", "version": "3.3.8",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
"@mui/icons-material": "^5.14.3", "@mui/icons-material": "^5.14.3",
"@mui/material": "^5.14.5", "@mui/material": "^5.14.5",
"date-fns": "^2.30.0", "date-fns": "^2.30.0",
"ecmascript-webrtc-sipml": "git+https://git.4u.uz/kulya/ecmascript-webrtc-sipml.git",
"i": "^0.3.7", "i": "^0.3.7",
"jssip": "^3.10.0", "jssip": "^3.10.0",
"npm": "^10.1.0", "npm": "^10.1.0",
......
/** @format */ /** @format */
// import SIPml from 'ecmascript-webrtc-sipml';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
import outcomingringTone from '../sounds/ringtone.wav'; import outcomingringTone from '../sounds/ringtone.wav';
import waitRingTone from '../sounds/ringbacktone.wav'; import waitRingTone from '../sounds/ringbacktone.wav';
...@@ -107,6 +106,7 @@ export class BoxDialer { ...@@ -107,6 +106,7 @@ export class BoxDialer {
}, },
confirmed: (e) => { confirmed: (e) => {
this.setGuiPhoneState({ this.setGuiPhoneState({
stateCode: 'connected',
funcName: 'modalState', funcName: 'modalState',
funcParam: { funcParam: {
bool: true, bool: true,
...@@ -114,16 +114,6 @@ export class BoxDialer { ...@@ -114,16 +114,6 @@ export class BoxDialer {
callFromName: 'Test', callFromName: 'Test',
}, },
}); });
// ===============
// this.setGuiPhoneState({
// funcName: 'modalState',
// funcParam: {
// bool: true,
// callType: 'answered',
// callAnswerType: 'oncoming',
// },
// });
}, },
}; };
} }
...@@ -146,12 +136,7 @@ export class BoxDialer { ...@@ -146,12 +136,7 @@ export class BoxDialer {
body: 'Answer Call', body: 'Answer Call',
icon: tugpng, icon: tugpng,
}); });
// navigate to the https://www.javascripttutorial.net/ on click
greeting.addEventListener('click', cbk); greeting.addEventListener('click', cbk);
// greeting.addEventListener('click', function(){
// window.open('https://www.javascripttutorial.net/web-apis/javascript-notification/');
// });
} }
onSoundType({ type, bool }) { onSoundType({ type, bool }) {
...@@ -259,6 +244,7 @@ export class BoxDialer { ...@@ -259,6 +244,7 @@ export class BoxDialer {
console.log('--=== newRTCSession', this.callSession); console.log('--=== newRTCSession', this.callSession);
this.setGuiPhoneState({ this.setGuiPhoneState({
funcName: 'modalState', funcName: 'modalState',
stateCode: 'incoming',
funcParam: { funcParam: {
bool: true, bool: true,
callType: 'connected', callType: 'connected',
...@@ -279,8 +265,6 @@ export class BoxDialer { ...@@ -279,8 +265,6 @@ export class BoxDialer {
// incoming call here // incoming call here
this.callSession.on('accepted', () => { this.callSession.on('accepted', () => {
// the call has answered // the call has answered
console.log('incoming accepted');
this.onSoundType({ type: 'ring', bool: false }); this.onSoundType({ type: 'ring', bool: false });
this.setGuiPhoneState({ this.setGuiPhoneState({
funcName: 'modalState', funcName: 'modalState',
...@@ -324,14 +308,6 @@ export class BoxDialer { ...@@ -324,14 +308,6 @@ export class BoxDialer {
}, },
}); });
}); });
// this.callSession.on('addstream', (e) => {
// // set remote audio stream (to listen to remote audio)
// // remoteAudio is <audio> element on page
// console.log('incoming addstream');
// this.remoteAudio.src = window.URL.createObjectURL(e.stream);
// this.remoteAudio.play();
// });
this.callSession.on('peerconnection', (e) => { this.callSession.on('peerconnection', (e) => {
console.log('peerconnection: ', e); console.log('peerconnection: ', e);
}); });
...@@ -401,12 +377,6 @@ export class BoxDialer { ...@@ -401,12 +377,6 @@ export class BoxDialer {
console.log('peerconnection: setremotedescriptionfailed: ', e); console.log('peerconnection: setremotedescriptionfailed: ', e);
}, },
); );
// Answer call
// session.answer(callOptions);
// Reject call (or hang up it)
// session.terminate();
} }
}); });
...@@ -420,7 +390,33 @@ export class BoxDialer { ...@@ -420,7 +390,33 @@ export class BoxDialer {
getBxUiState(sipState) { getBxUiState(sipState) {
console.log('this_callDirection: ', this.callDirection); console.log('this_callDirection: ', this.callDirection);
let arcodes = { // let arcodes = {
// incoming: 1,
// transferIncoming: 2,
// outgoing: 3,
// connectingIncoming: 4,
// connectingOutgoing: 5,
// connected: 6,
// transferring: 7,
// transferFailed: 8,
// transferConnected: 9,
// idle: 10,
// error: 11,
// moneyError: 12,
// sipPhoneError: 13,
// redial: 14,
// externalCard: 15,
// };
if (sipState && !!sipState.length) sipState = this.sipState;
let uiStates = {
// stack_i_new_call: this.callDirection === 'in' ? '' : '3',
// call_connected: '6',
// call_m_stream_audio_remote_added: '6',
// call_i_ao_request: 'connectingOutgoing',
// stack_m_permission_accepted: this.callDirection === 'in' ? '1 ' : '5',
// stack_m_permission_accepted: '1'
// call_i_ao_request: this.callDirection === 'in' ? '1 ' : '5',
incoming: 1, incoming: 1,
transferIncoming: 2, transferIncoming: 2,
outgoing: 3, outgoing: 3,
...@@ -437,16 +433,6 @@ export class BoxDialer { ...@@ -437,16 +433,6 @@ export class BoxDialer {
redial: 14, redial: 14,
externalCard: 15, externalCard: 15,
}; };
if (sipState && !!sipState.length) sipState = this.sipState;
let uiStates = {
stack_i_new_call: this.callDirection === 'in' ? '' : '3',
call_connected: '6',
call_m_stream_audio_remote_added: '6',
// call_i_ao_request: 'connectingOutgoing',
stack_m_permission_accepted: this.callDirection === 'in' ? '1 ' : '5',
// call_i_ao_request: this.callDirection === 'in' ? '1 ' : '5',
};
return sipState && uiStates[sipState] ? uiStates[sipState] : ''; return sipState && uiStates[sipState] ? uiStates[sipState] : '';
} }
...@@ -476,9 +462,8 @@ export class BoxDialer { ...@@ -476,9 +462,8 @@ export class BoxDialer {
window?.alovoicePhone?.close(); window?.alovoicePhone?.close();
} }
} }
setGuiPhoneState({ stateCode, funcName, funcParam }) { setGuiPhoneState({ stateCode, funcName, funcParam }) {
// { stateCode, funcName, funcParam }
console.log('setGuiPhoneState: ');
if (window?.alovoice_wsphone && !!stateCode?.length) { if (window?.alovoice_wsphone && !!stateCode?.length) {
this.callBxMethods({ this.callBxMethods({
bxMethodName: 'CallCardSetUiState', bxMethodName: 'CallCardSetUiState',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment