Commit 1315ebf2 authored by Muhammadali's avatar Muhammadali

update-

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