Commit 45ee8cdd authored by Muhammadali's avatar Muhammadali

verison: 4.8.87, fixed bud of video tag

parent df4c2b99
.DS_STORE .DS_STORE
node_modules node_modules
dist dist
prod
scripts/flow/*/.flowconfig scripts/flow/*/.flowconfig
.flowconfig .flowconfig
*~ *~
......
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.8.84", "version": "4.8.85",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "boxdialer", "name": "boxdialer",
"version": "4.8.84", "version": "4.8.85",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@emotion/react": "^11.11.1", "@emotion/react": "^11.11.1",
......
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "4.8.85", "version": "4.8.87",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
/** @format */ /** @format */
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';
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 packageJson from '../../package.json'; import packageJson from '../../package.json';
...@@ -66,13 +66,13 @@ export class BoxDialer { ...@@ -66,13 +66,13 @@ export class BoxDialer {
this.played = true; this.played = true;
}); });
this.isRestarting = false; this.isRestarting = false;
this.videoRemote = document.createElement('video'); // this.videoRemote = document.createElement('video');
this.videoLocal = document.createElement('video'); // this.videoLocal = document.createElement('video');
this.remoteAudio = document.createElement('audio'); this.remoteAudio = document.createElement('audio');
this.remoteAudio.autoplay = true; this.remoteAudio.autoplay = true;
document.body.appendChild(this.videoRemote); // document.body.appendChild(this.videoRemote);
document.body.appendChild(this.videoLocal); // document.body.appendChild(this.videoLocal);
document.body.appendChild(this.remoteAudio); document.body.appendChild(this.remoteAudio);
this.ringtone = new Audio(outcomingringTone); this.ringtone = new Audio(outcomingringTone);
...@@ -87,7 +87,7 @@ export class BoxDialer { ...@@ -87,7 +87,7 @@ export class BoxDialer {
}; };
this.options = { this.options = {
eventHandlers: this.uaEvents(), mediaConstraints: {audio: true, video: false}, eventHandlers: this.uaEvents(), mediaConstraints: { audio: true, video: false },
}; };
} }
...@@ -182,7 +182,7 @@ export class BoxDialer { ...@@ -182,7 +182,7 @@ export class BoxDialer {
}); });
window.navigator.mediaDevices window.navigator.mediaDevices
.getUserMedia({audio: true}) .getUserMedia({ audio: true })
.then(function (stream) { .then(function (stream) {
console.log('User_Danied_Media_Access', 'You let me use your mic!',); console.log('User_Danied_Media_Access', 'You let me use your mic!',);
}) })
...@@ -274,7 +274,7 @@ export class BoxDialer { ...@@ -274,7 +274,7 @@ export class BoxDialer {
greeting.addEventListener('click', cbk); greeting.addEventListener('click', cbk);
} }
onSoundType({type, bool}) { onSoundType({ type, bool }) {
this.ringtone.remove(); this.ringtone.remove();
this.waitRingTone.remove(); this.waitRingTone.remove();
this.pickSound.remove(); this.pickSound.remove();
...@@ -321,7 +321,7 @@ export class BoxDialer { ...@@ -321,7 +321,7 @@ export class BoxDialer {
} }
} }
sipRegister = ({number, secret, wsurl, isIce}) => { sipRegister = ({ number, secret, wsurl, isIce }) => {
try { try {
if (window?.alovoice_setversion && packageJson?.version) { if (window?.alovoice_setversion && packageJson?.version) {
window.alovoice_setversion(packageJson?.version); window.alovoice_setversion(packageJson?.version);
...@@ -438,7 +438,7 @@ export class BoxDialer { ...@@ -438,7 +438,7 @@ export class BoxDialer {
this.showNotification(() => { this.showNotification(() => {
this.answerButtonClick(); this.answerButtonClick();
}); });
this.onSoundType({type: 'ring', bool: true}); this.onSoundType({ type: 'ring', bool: true });
this.setGuiPhoneState({ this.setGuiPhoneState({
funcName: 'modalState', stateCode: 'connectingIncoming', funcParam: { funcName: 'modalState', stateCode: 'connectingIncoming', funcParam: {
bool: true, callType: 'incoming', bool: true, callType: 'incoming',
...@@ -457,7 +457,7 @@ export class BoxDialer { ...@@ -457,7 +457,7 @@ export class BoxDialer {
this.callSession.on('accepted', () => { this.callSession.on('accepted', () => {
console.log('%c newRTCSession accepted: ', 'font-size: 22px; color: yellow;', e,); console.log('%c newRTCSession accepted: ', 'font-size: 22px; color: yellow;', e,);
// the call has answered // the call has answered
this.onSoundType({type: 'ring', bool: false}); this.onSoundType({ type: 'ring', bool: false });
this.setGuiPhoneState({ this.setGuiPhoneState({
funcName: 'modalState', stateCode: 'connected', funcParam: { funcName: 'modalState', stateCode: 'connected', funcParam: {
bool: true, callType: 'connected', bool: true, callType: 'connected',
...@@ -519,7 +519,7 @@ export class BoxDialer { ...@@ -519,7 +519,7 @@ export class BoxDialer {
bool: false, type: null, bool: false, type: null,
}); });
this.stopInnerTimer(); this.stopInnerTimer();
this.onSoundType({type: 'ring', bool: false}); this.onSoundType({ type: 'ring', bool: false });
this.closeBxCall(); this.closeBxCall();
this.hangupButtonClick(); this.hangupButtonClick();
this.setGuiPhoneState({ this.setGuiPhoneState({
...@@ -616,7 +616,7 @@ export class BoxDialer { ...@@ -616,7 +616,7 @@ export class BoxDialer {
return sipState && uiStates[sipState] ? uiStates[sipState] : ''; return sipState && uiStates[sipState] ? uiStates[sipState] : '';
} }
callBxMethods({bxMethodName, bxFuncParams, callback}) { callBxMethods({ bxMethodName, bxFuncParams, callback }) {
if (window.BX24 && window.BX24.placement) { if (window.BX24 && window.BX24.placement) {
window?.BX24.placement.call(bxMethodName, bxFuncParams, callback); window?.BX24.placement.call(bxMethodName, bxFuncParams, callback);
} else if (window.alovoicePhone && window.alovoicePhone.callMethods) { } else if (window.alovoicePhone && window.alovoicePhone.callMethods) {
...@@ -636,13 +636,13 @@ export class BoxDialer { ...@@ -636,13 +636,13 @@ export class BoxDialer {
} }
} }
setGuiPhoneState({stateCode, funcName, funcParam}) { setGuiPhoneState({ stateCode, funcName, funcParam }) {
console.log('boxdialer_setGuiPhoneState_states: ', {stateCode, funcName, funcParam}) console.log('boxdialer_setGuiPhoneState_states: ', { stateCode, funcName, funcParam })
if (window?.alovoice_wsphone && !!stateCode?.length) { if (window?.alovoice_wsphone && !!stateCode?.length) {
console.log('this_getBxUiState_stateCode', stateCode, this.getBxUiState(stateCode),); console.log('this_getBxUiState_stateCode', stateCode, this.getBxUiState(stateCode),);
this.callBxMethods({ this.callBxMethods({
bxMethodName: 'CallCardSetUiState', bxMethodName: 'CallCardSetUiState',
bxFuncParams: {uiState: this.getBxUiState(stateCode)}, bxFuncParams: { uiState: this.getBxUiState(stateCode) },
callback: (e) => { callback: (e) => {
console.log(e, `CallCardSetUiState method done ${e}`); console.log(e, `CallCardSetUiState method done ${e}`);
}, },
...@@ -659,23 +659,23 @@ export class BoxDialer { ...@@ -659,23 +659,23 @@ export class BoxDialer {
console.log(`%c BXLOG:`, datas, 'background-color: red;'); console.log(`%c BXLOG:`, datas, 'background-color: red;');
} }
onSessionEvent({type, event}) { onSessionEvent({ type, event }) {
} }
selectUser() { selectUser() {
BX.Runtime.loadExtension('ui.entity-selector').then((exports) => { BX.Runtime.loadExtension('ui.entity-selector').then((exports) => {
const {Dialog, TagSelector} = exports; const { Dialog, TagSelector } = exports;
const dialog = new BX.UI.EntitySelector.Dialog({ const dialog = new BX.UI.EntitySelector.Dialog({
// targetNode: button, // targetNode: button,
enableSearch: true, multiple: false, context: 'MY_MODULE_CONTEXT', entities: [{ enableSearch: true, multiple: false, context: 'MY_MODULE_CONTEXT', entities: [{
id: 'user', // пользователи id: 'user', // пользователи
options: {selectFields: ['ufPhoneInner']}, options: { selectFields: ['ufPhoneInner'] },
}, { }, {
id: 'department', // структура компании: выбор только пользователей id: 'department', // структура компании: выбор только пользователей
},], events: { },], events: {
'_Item:onSelect': (event) => { '_Item:onSelect': (event) => {
const {item} = event.getData(); const { item } = event.getData();
const dialog = event.getTarget(); const dialog = event.getTarget();
const selectedItems = dialog.getSelectedItems(); const selectedItems = dialog.getSelectedItems();
...@@ -693,7 +693,7 @@ export class BoxDialer { ...@@ -693,7 +693,7 @@ export class BoxDialer {
}); });
} }
// call_connected; // call_connected;
setSipStateChangeCallback(callback, funcName) { setSipStateChangeCallback(callback, funcName) {
this.onSipStateChange[funcName] = callback.bind(this); this.onSipStateChange[funcName] = callback.bind(this);
} }
...@@ -731,7 +731,7 @@ export class BoxDialer { ...@@ -731,7 +731,7 @@ export class BoxDialer {
} }
skipButtonClick() { skipButtonClick() {
this.onSoundType({type: 'ring', bool: false}); this.onSoundType({ type: 'ring', bool: false });
this.hangupButtonClick(); this.hangupButtonClick();
} }
...@@ -745,23 +745,23 @@ export class BoxDialer { ...@@ -745,23 +745,23 @@ export class BoxDialer {
muteButtonClick() { muteButtonClick() {
let {audio} = this.callSession.isMuted(); let { audio } = this.callSession.isMuted();
if (audio) { if (audio) {
this.callSession.unmute(); this.callSession.unmute();
console.log('muteButtonClick_unmute'); console.log('muteButtonClick_unmute');
this.onSipStateChange['setCallEvents']({callMute: false}); this.onSipStateChange['setCallEvents']({ callMute: false });
} else { } else {
this.callSession.mute(); this.callSession.mute();
console.log('muteButtonClick_mute'); console.log('muteButtonClick_mute');
this.onSipStateChange['setCallEvents']({callMute: true}); this.onSipStateChange['setCallEvents']({ callMute: true });
} }
} }
answerButtonClick() { answerButtonClick() {
this.onSoundType({type: 'ring', bool: false}); this.onSoundType({ type: 'ring', bool: false });
this.callSession?.answer(this.options); this.callSession?.answer(this.options);
this.callSession.connection.addEventListener('addstream', (event) => { this.callSession.connection.addEventListener('addstream', (event) => {
this.remoteAudio.srcObject = event.stream; this.remoteAudio.srcObject = event.stream;
...@@ -771,15 +771,15 @@ export class BoxDialer { ...@@ -771,15 +771,15 @@ export class BoxDialer {
holdButtonClick() { holdButtonClick() {
let {local} = this.callSession.isOnHold(); let { local } = this.callSession.isOnHold();
console.log('local: ', local); console.log('local: ', local);
if (local) { if (local) {
this.callSession.unhold(); this.callSession.unhold();
this.onSipStateChange['setCallEvents']({callHold: false}); this.onSipStateChange['setCallEvents']({ callHold: false });
} else { } else {
this.callSession.hold(); this.callSession.hold();
this.onSipStateChange['setCallEvents']({callHold: true}); this.onSipStateChange['setCallEvents']({ callHold: true });
} }
} }
...@@ -788,7 +788,7 @@ export class BoxDialer { ...@@ -788,7 +788,7 @@ export class BoxDialer {
} }
hangupButtonClick() { hangupButtonClick() {
this.onSoundType({type: 'ring', bool: false}); this.onSoundType({ type: 'ring', bool: false });
this.onSipStateChange.innerCallerModal({ this.onSipStateChange.innerCallerModal({
bool: false, type: null, from: '', bool: false, type: null, from: '',
}); });
......
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