Commit 21783b00 authored by Muhammadali's avatar Muhammadali

version1.2.5

parent b23b26b7
{
"name": "boxdialer",
"version": "1.2.4",
"version": "1.2.5",
"description": "",
"main": "src/boxDialer.js",
"scripts": {
......
......@@ -36,17 +36,16 @@ const ModalPhoneNumpad = ({
// }, [call_history]);
const addNumberStorage = ({ number }) => {
let stringNumber = number.toString() || '';
let storageNumbers =
// (localStorage.getItem('call_history') &&
// JSON.parse(localStorage.getItem('call_history'))) ||
// [];
console.log(
stringNumber,
null === localStorage.getItem('call_history'),
typeof [],
);
// let stringNumber = number.toString() || '';
// let storageNumbers =
// // (localStorage.getItem('call_history') &&
// // JSON.parse(localStorage.getItem('call_history'))) ||
// // [];
// // console.log(
// // stringNumber,
// // null === localStorage.getItem('call_history'),
// // typeof [],
// // );
// localStorage.setItem('call_history', [
// stringNumber,
// ,
......
......@@ -28,6 +28,7 @@ export class BoxDialer {
ringtone;
ringbacktone;
sipState;
sipBxState;
soundBool;
onSipStateChange = {};
callEvetsBoxDialer;
......@@ -211,6 +212,18 @@ export class BoxDialer {
this.oSipSessionRegister.register();
}
getBxUiState(sipState) {
if (sipState && !!sipState.length) sipState = this.sipState;
let uiStates = {
stack_i_new_call: 'connectingIncoming',
call_connected: 'connectingOutgoing',
call_m_stream_audio_remote_added: 'connected',
call_i_ao_request: 'connectingOutgoing',
};
return sipState && uiStates[sipState] ? uiStates[sipState] : 'idle';
}
callBxMethods({ bxMethodName, bxFuncParams, callback }) {
if (window.BX24 && window.BX24.placement) {
window?.BX24.placement.call(bxMethodName, bxFuncParams, callback);
......@@ -221,34 +234,13 @@ export class BoxDialer {
setGuiPhoneState({ stateCode, funcName, funcParam }) {
if (window?.alovoice_wsphone) {
let uiState = false;
switch (stateCode) {
case 'i_new_call':
uiState = 'incoming';
break;
case 'call_connected':
uiState = 'connectingOutgoing';
break;
case 'call_m_stream_audio_remote_added':
uiState = 'connected';
break;
case 'call_i_ao_request':
uiState = 'connectingOutgoing';
break;
default:
break;
}
if (uiState) {
this.callBxMethods({
bxMethodName: 'CallCardSetUiState',
bxFuncParams: { uiState },
bxFuncParams: { uiState: this.getBxUiState(stateCode) },
callback: (e) => {
console.log(e, `CallCardSetUiState method done ${e}`);
},
});
}
} else if (funcName && this.onSipStateChange[funcName] !== 'undefined') {
this.onSipStateChange[funcName](funcParam);
}
......@@ -261,6 +253,8 @@ export class BoxDialer {
this.sipState = type + '_' + event?.type;
console.log('---onSessionEvent EVENT [' + this.sipState + ']', event);
this.setGuiPhoneState({ stateCode: this.sipState });
switch (this.sipState) {
case 'register_stopping':
case 'register_stoped':
......@@ -299,11 +293,11 @@ export class BoxDialer {
break;
case 'call_m_stream_audio_remote_added':
case 'call_connected':
this.setGuiPhoneState({ stateCode: this.sipState });
// this.setGuiPhoneState({ stateCode: this.sipState });
// QORA EKRANDA ULANYAPTI.. SOZINI VAHTGA OZGARTIRISH KERE ( SEKKUNDAMER )
break;
case 'call_i_ao_request':
this.setGuiPhoneState({ stateCode: this.sipState });
// this.setGuiPhoneState({ stateCode: this.sipState });
break;
case 'hangup_terminating':
......@@ -340,7 +334,7 @@ export class BoxDialer {
this.oSipSessionCall.setConfiguration(this.oConfigCall);
this.onSoundType({ type: 'ring', bool: true });
this.setGuiPhoneState({
stateCode: 'i_new_call',
// stateCode: 'i_new_call',
funcName: 'modalState',
funcParam: {
bool: true,
......
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