Commit 1315ebf2 authored by Muhammadali's avatar Muhammadali

update-

parent 1bb9019e
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "3.3.7", "version": "4.3.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "boxdialer", "name": "boxdialer",
"version": "3.3.7", "version": "4.3.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@emotion/react": "^11.11.1", "@emotion/react": "^11.11.1",
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"@eo-locale/react": "^1.7.3", "@eo-locale/react": "^1.7.3",
"@headlessui/react": "^1.7.17", "@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18", "@heroicons/react": "^2.0.18",
"@kimmel/dtmf": "^1.0.4",
"@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",
...@@ -2107,6 +2108,14 @@ ...@@ -2107,6 +2108,14 @@
"@jridgewell/sourcemap-codec": "^1.4.14" "@jridgewell/sourcemap-codec": "^1.4.14"
} }
}, },
"node_modules/@kimmel/dtmf": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@kimmel/dtmf/-/dtmf-1.0.4.tgz",
"integrity": "sha512-/PWgqGfPunoJUIg8yebPy04NNM4Jp3r5AFrVO4tYM5EGlhQ2NrU26ZMPbXBlUEkdetf0cvZ64FLdjtqVSnf8wA==",
"engines": {
"node": ">=6"
}
},
"node_modules/@leichtgewicht/ip-codec": { "node_modules/@leichtgewicht/ip-codec": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz",
......
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.3.0", "version": "4.3.1",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
"@eo-locale/react": "^1.7.3", "@eo-locale/react": "^1.7.3",
"@headlessui/react": "^1.7.17", "@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18", "@heroicons/react": "^2.0.18",
"@kimmel/dtmf": "^1.0.4",
"@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",
......
...@@ -6,6 +6,7 @@ import waitRingTone from '../sounds/ringbacktone.wav'; ...@@ -6,6 +6,7 @@ import waitRingTone from '../sounds/ringbacktone.wav';
import pickSound from '../sounds/dtmf.wav'; import pickSound from '../sounds/dtmf.wav';
import { WebSocketInterface, UA } from 'jssip'; import { WebSocketInterface, UA } from 'jssip';
import tugpng from '../img/tug.png'; import tugpng from '../img/tug.png';
import DTMF from '@kimmel/dtmf';
export class BoxDialer { export class BoxDialer {
sTransferNumber; sTransferNumber;
oRingTone; oRingTone;
...@@ -34,12 +35,6 @@ export class BoxDialer { ...@@ -34,12 +35,6 @@ export class BoxDialer {
soundBool; soundBool;
onSipStateChange = {}; onSipStateChange = {};
callEvetsBoxDialer; callEvetsBoxDialer;
contextClass =
window.AudioContext ||
window.webkitAudioContext ||
window.mozAudioContext ||
window.oAudioContext ||
window.msAudioContext;
musicContext; musicContext;
gainNode; gainNode;
gainNode; gainNode;
...@@ -61,6 +56,7 @@ export class BoxDialer { ...@@ -61,6 +56,7 @@ export class BoxDialer {
testInnerTimer; testInnerTimer;
callSession; callSession;
sipDomain; sipDomain;
player;
constructor() { constructor() {
console.log('registerData: ', this.registerData); console.log('registerData: ', this.registerData);
this.played = false; this.played = false;
...@@ -92,69 +88,64 @@ export class BoxDialer { ...@@ -92,69 +88,64 @@ export class BoxDialer {
eventHandlers: this.uaEvents(), eventHandlers: this.uaEvents(),
mediaConstraints: { audio: true, video: false }, mediaConstraints: { audio: true, video: false },
}; };
if (this.contextClass) {
// Web Audio API is available. this.player = new DTMF();
this.musicContext = new this.contextClass();
}
} }
dialTone(freq1, freq2) { dialTone(freq1, freq2) {
this.player.play(1);
// merger = context.createChannelMerger(2); // merger = context.createChannelMerger(2);
setTimeout(() => { // setTimeout(() => {
console.log('-= sTOPING BY TIMEOUT'); // console.log('-= sTOPING BY TIMEOUT');
this.stop(); // this.stop();
}, 1000); // }, 1000);
if (this.oscillator1 || this.oscillator2) return; // if (this.oscillator1 || this.oscillator2) return;
console.log('Begin dialTone:', this.oscillator1, this.oscillator2); // console.log('Begin dialTone:', this.oscillator1, this.oscillator2);
// this.oscillator1 = this.musicContext.createOscillator();
this.oscillator1 = this.musicContext.createOscillator(); // // this.oscillator1.type = null;
// this.oscillator1.type = null; // this.oscillator1.frequency.value = freq1;
this.oscillator1.frequency.value = freq1; // this.gainNode = this.musicContext.createGain
this.gainNode = this.musicContext.createGain // ? this.musicContext.createGain()
? this.musicContext.createGain() // : this.musicContext.createGainNode();
: this.musicContext.createGainNode(); // this.oscillator1.connect(this.gainNode, 0, 0);
this.oscillator1.connect(this.gainNode, 0, 0); // this.gainNode.connect(this.musicContext.destination);
this.gainNode.connect(this.musicContext.destination); // this.gainNode.gain.value = 0.1;
this.gainNode.gain.value = 0.1; // this.oscillator1.start
this.oscillator1.start // ? this.oscillator1.start(0)
? this.oscillator1.start(0) // : this.oscillator1.noteOn(0);
: this.oscillator1.noteOn(0); // // this.gainNode.connect(merger,0,1);
// this.oscillator2 = this.musicContext.createOscillator();
// this.gainNode.connect(merger,0,1); // // this.oscillator2.type = null;
// this.oscillator2.frequency.value = freq2;
this.oscillator2 = this.musicContext.createOscillator(); // this.gainNode = this.musicContext.createGain
// this.oscillator2.type = null; // ? this.musicContext.createGain()
this.oscillator2.frequency.value = freq2; // : this.musicContext.createGainNode();
this.gainNode = this.musicContext.createGain // this.oscillator2.connect(this.gainNode);
? this.musicContext.createGain() // this.gainNode.connect(this.musicContext.destination);
: this.musicContext.createGainNode(); // // this.gainNode.connect(merger,0,0);
this.oscillator2.connect(this.gainNode); // this.gainNode.gain.value = 0.1;
this.gainNode.connect(this.musicContext.destination); // this.oscillator2.start
// this.gainNode.connect(merger,0,0); // ? this.oscillator2.start(0)
// : this.oscillator2.noteOn(0);
this.gainNode.gain.value = 0.1;
this.oscillator2.start
? this.oscillator2.start(0)
: this.oscillator2.noteOn(0);
} }
start() { start() {
if (typeof this.oscillator1 != 'undefined') this.oscillator1.disconnect(); // if (typeof this.oscillator1 != 'undefined') this.oscillator1.disconnect();
if (typeof this.oscillator2 != 'undefined') this.oscillator2.disconnect(); // if (typeof this.oscillator2 != 'undefined') this.oscillator2.disconnect();
oscOn( // oscOn(
parseFloat(document.getElementById('freq').value), // parseFloat(document.getElementById('freq').value),
parseFloat(document.getElementById('freq2').value), // parseFloat(document.getElementById('freq2').value),
); // );
} }
stop() { stop() {
console.log('STOP', this.oscillator1, this.oscillator2); // console.log('STOP', this.oscillator1, this.oscillator2);
console.log('FUNC', this.oscillator1?.disconnect, this.oscillator1?.stop); // console.log('FUNC', this.oscillator1?.disconnect, this.oscillator1?.stop);
this.oscillator1?.disconnect(); // this.oscillator1?.disconnect();
this.oscillator2?.disconnect(); // this.oscillator2?.disconnect();
this.oscillator1?.stop(); // this.oscillator1?.stop();
this.oscillator2?.stop(); // this.oscillator2?.stop();
this.oscillator1 = null; // this.oscillator1 = null;
this.oscillator2 = null; // this.oscillator2 = null;
} }
uaEvents() { uaEvents() {
return { return {
...@@ -420,8 +411,7 @@ export class BoxDialer { ...@@ -420,8 +411,7 @@ export class BoxDialer {
'this_callSession_connection: ', 'this_callSession_connection: ',
this.callSession.connection, this.callSession.connection,
); );
this.callSession.connection.addEventListener('addstream', (e) => {
this.callSession.connection.onaddstream = (e) => {
console.log('--== UA Conn Added STREAM: ', e); console.log('--== UA Conn Added STREAM: ', e);
let strmTrack = e.stream.getAudioTracks(); let strmTrack = e.stream.getAudioTracks();
...@@ -430,7 +420,10 @@ export class BoxDialer { ...@@ -430,7 +420,10 @@ export class BoxDialer {
this.remoteAudio.srcObject = rmMediaStream; this.remoteAudio.srcObject = rmMediaStream;
this.remoteAudio.play(); this.remoteAudio.play();
} }
}; });
// this.callSession.connection.onaddstream = (e) => {
// };
this.setGuiPhoneState({ this.setGuiPhoneState({
funcName: 'modalState', funcName: 'modalState',
...@@ -559,13 +552,6 @@ export class BoxDialer { ...@@ -559,13 +552,6 @@ export class BoxDialer {
}, },
}); });
}); });
this.callSession.on('peerconnection', (e) => {
console.log(
'%c peerconnection: ',
'font-size: 22px; color: yellow;',
e,
);
});
this.callSession.on('connecting', (e) => { this.callSession.on('connecting', (e) => {
console.log( console.log(
'%c connecting: ', '%c connecting: ',
...@@ -647,13 +633,6 @@ export class BoxDialer { ...@@ -647,13 +633,6 @@ export class BoxDialer {
e, e,
); );
}); });
this.callSession.on('peerconnection: createanswerfailed', (e) => {
console.log(
'%c peerconnection: createanswerfailed: ',
'font-size: 22px; color: yellow;',
e,
);
});
this.callSession.on( this.callSession.on(
'peerconnection: setlocaldescriptionfailed', 'peerconnection: setlocaldescriptionfailed',
(e) => { (e) => {
......
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