Commit f457b297 authored by Muhammadali's avatar Muhammadali

update

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