Commit f457b297 authored by Muhammadali's avatar Muhammadali

update

parent fa55361c
{ {
"name": "boxdialer", "name": "boxdialer",
"version": "1.5.3", "version": "1.5.4",
"description": "", "description": "",
"main": "src/boxDialer.js", "main": "src/boxDialer.js",
"scripts": { "scripts": {
......
...@@ -13,6 +13,7 @@ export class BoxDialer { ...@@ -13,6 +13,7 @@ export class BoxDialer {
oSipStack; oSipStack;
oSipSessionRegister; oSipSessionRegister;
oSipSessionCall; oSipSessionCall;
oSipSessionCallSecond;
oSipSessionTransferCall; oSipSessionTransferCall;
videoRemote; videoRemote;
videoLocal; videoLocal;
...@@ -344,21 +345,45 @@ export class BoxDialer { ...@@ -344,21 +345,45 @@ export class BoxDialer {
break; break;
case 'stack_i_new_call': case 'stack_i_new_call':
this.callDirection = 'in'; if (!!!this.oSipSessionCall.o_session.o_stream_remote.id) {
this.oSipSessionCall = event.newSession; this.onSipStateChange.secondLine(false);
this.oSipSessionCall.setConfiguration(this.oConfigCall); }
this.onSoundType({ type: 'ring', bool: true }); if (this.oSipSessionCall.o_session.o_stream_remote.id) {
this.setGuiPhoneState({ this.onSipStateChange.secondLine(true);
// stateCode: 'i_new_call', this.callDirection = 'in';
funcName: 'modalState', this.oSipSessionCallSecond = event.newSession;
funcParam: { this.oSipSessionCallSecond.setConfiguration(this.oConfigCall);
bool: true, this.onSoundType({ type: 'ring', bool: true });
callType: '', this.setGuiPhoneState({
callAnswerType: null, funcName: 'modalState',
callFromName: event?.o_event?.o_session?.o_uri_from?.s_user_name, funcParam: {
}, bool: true,
}); callType: '',
console.log(this.oSipSessionCall, 'oSipSessionCall'); callAnswerType: null,
callFromName: event?.o_event?.o_session?.o_uri_from?.s_user_name,
},
});
} else {
this.onSipStateChange.secondLine(false);
this.callDirection = 'in';
this.oSipSessionCall = event.newSession;
this.oSipSessionCall.setConfiguration(this.oConfigCall);
this.onSoundType({ type: 'ring', bool: true });
this.setGuiPhoneState({
funcName: 'modalState',
funcParam: {
bool: true,
callType: '',
callAnswerType: null,
callFromName: event?.o_event?.o_session?.o_uri_from?.s_user_name,
},
});
// console.log(
// this.oSipSessionCall.o_session.o_stream_remote.id,
// 'oSipSessionCall',
// );
}
break; break;
case 'stack_stopped': case 'stack_stopped':
......
...@@ -9,11 +9,6 @@ import BxMiniWidjetUi from '../components/BxMiniWidjetUi'; ...@@ -9,11 +9,6 @@ import BxMiniWidjetUi from '../components/BxMiniWidjetUi';
const Root = ({ data, onSetDnd }) => { const Root = ({ data, onSetDnd }) => {
let localValue = localStorage.getItem('activeValue') || false; let localValue = localStorage.getItem('activeValue') || false;
// useEffect(() => {
// if (localValue && localValue > 0)
// localStorage.setItem('activeValue', +localValue + 1);
// else localStorage.setItem('activeValue', 1);
// }, []);
const [dataSecond, setDataSecond] = useState([]); const [dataSecond, setDataSecond] = useState([]);
if (!data) { if (!data) {
data = { data = {
...@@ -38,14 +33,16 @@ const Root = ({ data, onSetDnd }) => { ...@@ -38,14 +33,16 @@ const Root = ({ data, onSetDnd }) => {
const [phoneModal, setPhoneModal] = useState(false); const [phoneModal, setPhoneModal] = useState(false);
const [dynamicValue, setDynamicValue] = useState('pending'); const [dynamicValue, setDynamicValue] = useState('pending');
const [modalState, setModalState] = useState(false); const [modalState, setModalState] = useState(false);
const [secondLine, setSecondLine] = useState(false);
const boxDialer = window.BoxDialer; const boxDialer = window.BoxDialer;
console.log(secondLine, 'secondLine');
useEffect(() => { useEffect(() => {
if (data && data?.number) { if (data && data?.number) {
boxDialer.setSipStateChangeCallback(setDynamicValue, 'dynamicValue'); boxDialer.setSipStateChangeCallback(setDynamicValue, 'dynamicValue');
boxDialer.setSipStateChangeCallback(setModalState, 'modalState'); boxDialer.setSipStateChangeCallback(setModalState, 'modalState');
boxDialer.setSipStateChangeCallback(setPhoneModal, 'phoneModal'); boxDialer.setSipStateChangeCallback(setPhoneModal, 'phoneModal');
boxDialer.setSipStateChangeCallback(setSecondLine, 'secondLine');
boxDialer.sipRegister(data); boxDialer.sipRegister(data);
} }
setDataSecond(data); setDataSecond(data);
......
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