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
//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
sip_headers:[
{
name:'User-Agent',
value:'Alovoice-client/v1.0-2023.08.08',
});
if(this.callSession.direction==='incoming'){
this.showNotification(()=>{
this.answerButtonClick();
});
this.onSoundType({type:'ring',bool:true});
this.setGuiPhoneState({
funcName:'modalState',
funcParam:{
bool:true,
callType:'incoming',
},
{name:'Organization',value:'Technounit'},
],
};
console.log('_ostackConfig: ',ostackConfig);
this.oSipStack=newSIPml.Stack(ostackConfig);
});
// incoming call here
this.callSession.on('accepted',()=>{
// the call has answered
if(this.oSipStack.start()!==0){
console.log('<b>Failed to start the SIP stack</b>');
}elsereturn;
}catch(e){
console.log('<b>2:'+e+'</b>');
}
};
console.log('incoming accepted');
this.onSoundType({type:'ring',bool:false});
this.setGuiPhoneState({
funcName:'modalState',
funcParam:{
bool:true,
callType:'connected',
},
});
// const numberRegexp = /\"(\d+)\"/;
// const fromNumber = numberRegexp.exec(
// data.request.headers.From[0].raw,
// )[1];
// const toNumber = numberRegexp
// .exec(data.request.headers.Contact[0].raw)[1]
// .slice(1);
});
this.callSession.on('confirmed',()=>{
// this handler will be called for incoming calls too
console.log('incoming confirmed');
});
this.callSession.on('ended',()=>{
// the call has ended
console.log('incoming ended');
this.setGuiPhoneState({
funcName:'modalState',
funcParam:{
bool:false,
callType:'',
},
});
});
this.callSession.on('failed',()=>{
// unable to establish the call
console.log('incoming failed');
this.onSoundType({type:'ring',bool:false});
this.setGuiPhoneState({
funcName:'modalState',
funcParam:{
bool:false,
callType:'',
},
});
});
// this.callSession.on('addstream', (e) => {
// // set remote audio stream (to listen to remote audio)