Commit b23b26b7 authored by Muhammadali's avatar Muhammadali

update

parent 8bdd19c9
...@@ -6,6 +6,7 @@ import numbers from './numbers'; ...@@ -6,6 +6,7 @@ import numbers from './numbers';
import CallIcon from '@mui/icons-material/Call'; import CallIcon from '@mui/icons-material/Call';
import { toast } from 'react-hot-toast'; import { toast } from 'react-hot-toast';
import DropDown from '../DropDown'; import DropDown from '../DropDown';
import { CommentsDisabledOutlined } from '@mui/icons-material';
const ModalPhoneNumpad = ({ const ModalPhoneNumpad = ({
phoneModal, phoneModal,
...@@ -20,7 +21,39 @@ const ModalPhoneNumpad = ({ ...@@ -20,7 +21,39 @@ const ModalPhoneNumpad = ({
const boxDialer = window.BoxDialer; const boxDialer = window.BoxDialer;
const [inputValue, setInputValue] = useState(''); const [inputValue, setInputValue] = useState('');
const [call_history, setCall_history] = useState([]);
useEffect(() => {
// setCall_history(JSON.parse(localStorage.getItem('call_history')) || []);
}, []);
// useEffect(() => {
// let call_history_storage = JSON.parse(localStorage.getItem('call_history'));
// if (call_history_storage.length !== call_history.length) {
// setCall_history(call_history_storage);
// localStorage.setItem('call_history', JSON.stringify(call_history));
// }
// }, [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 [],
);
// localStorage.setItem('call_history', [
// stringNumber,
// ,
// ]);
// setCall_history([number, ...call_history]);
// }
};
useEffect(() => { useEffect(() => {
if (!modalState.bool) setInputValue(''); if (!modalState.bool) setInputValue('');
}, [modalState.bool]); }, [modalState.bool]);
...@@ -78,6 +111,7 @@ const ModalPhoneNumpad = ({ ...@@ -78,6 +111,7 @@ const ModalPhoneNumpad = ({
toggleCP: (e) => { toggleCP: (e) => {
if (phoneModal && (modalState.bool ? false : true) && e.key === 'Enter') { if (phoneModal && (modalState.bool ? false : true) && e.key === 'Enter') {
boxDialer.initialized(inputValue); boxDialer.initialized(inputValue);
addNumberStorage({ number: inputValue });
} else if ( } else if (
phoneModal && phoneModal &&
(modalState.bool ? false : true) && (modalState.bool ? false : true) &&
...@@ -90,9 +124,17 @@ const ModalPhoneNumpad = ({ ...@@ -90,9 +124,17 @@ const ModalPhoneNumpad = ({
!isNaN(+e.key) !isNaN(+e.key)
) { ) {
inputController({ type: 'add', value: e.key, from: 'button' }); inputController({ type: 'add', value: e.key, from: 'button' });
} else if (
phoneModal &&
(modalState.bool ? false : true) &&
e.key === 'Backspace'
) {
} }
}, },
}; };
// ArrowDown;
// ArrowUp
const handleKeyUp = useCallback( const handleKeyUp = useCallback(
(event) => { (event) => {
gameState.toggleCP(event); gameState.toggleCP(event);
...@@ -109,7 +151,11 @@ const ModalPhoneNumpad = ({ ...@@ -109,7 +151,11 @@ const ModalPhoneNumpad = ({
}, [handleKeyUp]); }, [handleKeyUp]);
const callButton = () => { const callButton = () => {
addNumberStorage({ number: inputValue });
if (dynamicValue === 'connected') { if (dynamicValue === 'connected') {
// let call_history = localStorage.getItem('call_history');
// console.log(call_history, 'call_history');
boxDialer.initialized(inputValue); boxDialer.initialized(inputValue);
} else { } else {
toast.error('Please wait', { toast.error('Please wait', {
......
...@@ -167,14 +167,14 @@ export class BoxDialer { ...@@ -167,14 +167,14 @@ export class BoxDialer {
display_name: number, //'3003', display_name: number, //'3003',
websocket_proxy_url: `wss://${wsurl}/ws`, //'wss://cld.alovoice.uz:61040/ws', websocket_proxy_url: `wss://${wsurl}/ws`, //'wss://cld.alovoice.uz:61040/ws',
// outbound_proxy_url: '', //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.sip_outboundproxy_url') : null), // outbound_proxy_url: '', //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.sip_outboundproxy_url') : null),
ice_servers: isIce ? [{ url: 'stun:stun.l.google.com:19302' }] : [], //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.ice_servers') : null), ice_servers: isIce ? [{ url: 'stun:stun.l.google.com:19302' }] : '[]', //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.ice_servers') : null),
enable_rtcweb_breaker: true, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_rtcweb_breaker') == "true" : false), enable_rtcweb_breaker: false, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_rtcweb_breaker') == "true" : false),
events_listener: { events_listener: {
events: '*', events: '*',
listener: (event) => this.onSessionEvent({ type: 'stack', event }), listener: (event) => this.onSessionEvent({ type: 'stack', event }),
}, },
enable_early_ims: true, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.disable_early_ims') != "true" : true), // Must be true unless you're using a real IMS network enable_early_ims: true, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.disable_early_ims') != "true" : true), // Must be true unless you're using a real IMS network
enable_media_stream_cache: true, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_media_caching') == "true" : false), enable_media_stream_cache: false, //(window.localStorage ? window.localStorage.getItem('org.doubango.expert.enable_media_caching') == "true" : false),
//bandwidth: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.bandwidth')) : null), // could be redefined a session-level //bandwidth: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.bandwidth')) : null), // could be redefined a session-level
//video_size: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.video_size')) : null), // could be redefined a session-level //video_size: (window.localStorage ? tsk_string_to_object(window.localStorage.getItem('org.doubango.expert.video_size')) : null), // could be redefined a session-level
sip_headers: [ sip_headers: [
...@@ -220,7 +220,6 @@ export class BoxDialer { ...@@ -220,7 +220,6 @@ export class BoxDialer {
} }
setGuiPhoneState({ stateCode, funcName, funcParam }) { setGuiPhoneState({ stateCode, funcName, funcParam }) {
console.log('setGuiPhoneState______:', { stateCode, funcName, funcParam });
if (window?.alovoice_wsphone) { if (window?.alovoice_wsphone) {
let uiState = false; let uiState = false;
...@@ -447,6 +446,7 @@ export class BoxDialer { ...@@ -447,6 +446,7 @@ export class BoxDialer {
} }
skipButtonClick() { skipButtonClick() {
console.log('skipButtonClick');
this.onSoundType({ type: 'ring', bool: false }); this.onSoundType({ type: 'ring', bool: false });
this.hangupButtonClick(); this.hangupButtonClick();
} }
...@@ -521,6 +521,7 @@ export class BoxDialer { ...@@ -521,6 +521,7 @@ export class BoxDialer {
} }
closeButtonClick() { closeButtonClick() {
console.log('closeButtonClick');
this.hangupButtonClick(); this.hangupButtonClick();
} }
hangupButtonClick() { hangupButtonClick() {
...@@ -543,6 +544,7 @@ export class BoxDialer { ...@@ -543,6 +544,7 @@ export class BoxDialer {
} }
transferButtonClick(number) { transferButtonClick(number) {
console.log('transferButtonClick');
if (this.oSipSessionCall) { if (this.oSipSessionCall) {
if (this.oSipSessionCall.transfer(number) != 0) { if (this.oSipSessionCall.transfer(number) != 0) {
toast.error('Call transfer failed'); toast.error('Call transfer failed');
......
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