Commit 45ee8cdd authored by Muhammadali's avatar Muhammadali

verison: 4.8.87, fixed bud of video tag

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