Your IP : 18.226.181.19
(function(e){if(e.BX.MobileVoximplant||typeof e.BXCordovaPlugin==="undefined")return;BX.MobileVoximplant={isConnected:false,isInitialized:false,isReady:false,plugin:new BXCordovaPlugin("BitrixVoximplant",false,false),listeners:{},internalListeners:{onIncomingCall:function(e){var n=BX.MobileVoximplant.call(e.displayName,e.videoCall,e.headers,e.callId);BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.IncomingCall,{call:n})},onConnectionEstablished:function(){BX.MobileVoximplant.isConnected=true;BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.ConnectionEstablished)},onConnectionClosed:function(){BX.MobileVoximplant.isConnected=false;BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.ConnectionClosed)},onConnectionFailed:function(e){BX.MobileVoximplant.isConnected=false;BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.ConnectionFailed,e)},onSDKReady:function(){BX.MobileVoximplant.isReady=true;BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.SDKReady)},onAuthResult:function(e){if(e.code==401){console.error("BX.MobileVoximplant.login(). It seams like login or one time password was not specified. "+"Use BX.MobileVoximplant.loginWithOneTimeKey to set session data")}BX.MobileVoximplant.executeCallback(BX.MobileVoximplant.events.AuthResult,e)}},executeCallback:function(e,n){if(typeof BX.MobileVoximplant.listeners[e]=="function"){BX.MobileVoximplant.listeners[e](n)}else{console.log(e,n)}},getInstance:function(){return this},init:function(){this.plugin.exec("init",{listeners:this.getListeners()})},addEventListener:function(e,n){this.listeners[e]=n},connected:function(){return this.isConnected},connect:function(){BX.MobileVoximplant.addEventListener();this.callIfReady(function(){BX.MobileVoximplant.plugin.exec("connect")})},disconnect:function(){this.callIfReady(function(){BX.MobileVoximplant.plugin.exec("disconnect")})},loginWithOneTimeKey:function(e,n){this.plugin.exec("loginWithOneTimeKey",{login:e,hash:n})},login:function(){this.callIfReady(function(){BX.MobileVoximplant.plugin.exec("login")})},call:function(e,n,t,i){return new BX.MobileVoximplantCall(e,n,t,this.plugin,i)},setOperatorACDStatus:function(e){this.plugin.exec("some")},callIfReady:function(e){if(this.isReady){e()}else{console.error("MobileVoximplant engine is not initialized. You should call BX.MobileVoximplant.init() before.")}},getListeners:function(){if(this.isInitialized)return this.internalListeners;for(var e in this.events){var n=this.events[e];if(typeof this.internalListeners[n]!="function"){var t={handler:function(e){BX.MobileVoximplant.executeCallback(this.eventName,e)},eventName:n};this.internalListeners[n]=BX.proxy(t.handler,t)}}this.isInitialized=true;return this.internalListeners},events:{IncomingCall:"onIncomingCall",ConnectionEstablished:"onConnectionEstablished",ConnectionFailed:"onConnectionFailed",ConnectionClosed:"onConnectionClosed",AuthResult:"onAuthResult",MicAccessResult:"onMicAccessResult",NetStatsReceived:"onNetStatsReceived",SDKReady:"onSDKReady"}};BX.MobileVoximplantCall=function(e,n,t,i,o){this.callState=BX.MobileVoximplantCall.states.DISCONNECTED;this.plugin=i;this.listeners={};this.params={callId:o?o:null,phoneNumber:e,useVideo:typeof n=="undefined"?false:n,callParams:JSON.stringify(t),onCreateCallback:BX.proxy(this.onCreate,this),listeners:{onCallConnected:BX.proxy(this.onConnected,this),onCallDisconnected:BX.proxy(this.onDisconnected,this),onCallFailed:BX.proxy(this.onFailed,this),onProgressToneStart:BX.proxy(this.onProgressToneStart,this),onProgressToneStop:BX.proxy(this.onProgressToneStop,this)}}};BX.MobileVoximplantCall.prototype.addEventListener=function(e,n){this.listeners[e]=n};BX.MobileVoximplantCall.prototype.onCreate=function(e){this.params.callId=e.callId};BX.MobileVoximplantCall.prototype.start=function(){if(this.params.callId!=null)return;this.plugin.exec("createCallAndStart",this.params)};BX.MobileVoximplantCall.prototype.removeEventListener=function(e){delete this.listeners[e]};BX.MobileVoximplantCall.prototype.answer=function(){if(this.params.callId==null)return;this.plugin.exec("answer",this.params)};BX.MobileVoximplantCall.prototype.hangup=function(){this.plugin.exec("hangup",this.params)};BX.MobileVoximplantCall.prototype.decline=function(){this.plugin.exec("decline",this.params)};BX.MobileVoximplantCall.prototype.id=function(){return this.params.callId};BX.MobileVoximplantCall.prototype.state=function(){return this.callState};BX.MobileVoximplantCall.prototype.muteMicrophone=function(){this.plugin.exec("setMute",{mute:true})};BX.MobileVoximplantCall.prototype.unmuteMicrophone=function(){this.plugin.exec("setMute",{mute:false})};BX.MobileVoximplantCall.prototype.setUseLoudSpeaker=function(e){this.plugin.exec("setUseLoudSpeaker",{enabled:typeof e=="boolean"?e:false})};BX.MobileVoximplantCall.prototype.sendMessage=function(e,n){var t={callId:this.id(),text:e,headers:typeof n!="object"?{}:n};this.plugin.exec("sendMessage",t)};BX.MobileVoximplantCall.prototype.sendTone=function(e){this.plugin.exec("sendDTMF",{callId:this.id(),digit:e})};BX.MobileVoximplantCall.prototype.onDisconnected=function(){this.callState=BX.MobileVoximplantCall.states.DISCONNECTED;this.executeCallback(BX.MobileVoximplantCall.events.Disconnected)};BX.MobileVoximplantCall.prototype.onConnected=function(){this.callState=BX.MobileVoximplantCall.states.CONNECTED;this.executeCallback(BX.MobileVoximplantCall.events.Connected)};BX.MobileVoximplantCall.prototype.onFailed=function(e){this.callState=BX.MobileVoximplantCall.states.DISCONNECTED;this.executeCallback(BX.MobileVoximplantCall.events.Failed,e)};BX.MobileVoximplantCall.prototype.onProgressToneStart=function(){this.callState=BX.MobileVoximplantCall.states.CONNECTING;this.executeCallback(BX.MobileVoximplantCall.events.ProgressToneStart)};BX.MobileVoximplantCall.prototype.onProgressToneStop=function(){this.executeCallback(BX.MobileVoximplantCall.events.ProgressToneStop)};BX.MobileVoximplantCall.prototype.executeCallback=function(e,n){if(typeof this.listeners[e]=="function"){return this.listeners[e](n)}else{console.log(e,n)}};BX.MobileVoximplantCall.events={Connected:"onCallConnected",Disconnected:"onCallDisconnected",Failed:"onCallFailed",ProgressToneStart:"onProgressToneStart",ProgressToneStop:"onProgressToneStop"};BX.MobileVoximplantCall.states={CONNECTED:"connected",DISCONNECTED:"disconnected",CONNECTING:"connecting"};BX.MobileCallUI={events:{onHangup:"onHangupCallClicked",onSpeakerphoneChanged:"onSpeakerphoneCallClicked",onMuteChanged:"onMuteCallClicked",onPauseChanged:"onPauseCallClicked",onNumpadClicked:"onNumpadClicked",onFormFolded:"onFoldCallClicked",onFormExpanded:"onUnfoldIconClicked",onCloseClicked:"onCloseCallClicked",onSkipClicked:"onSkipCallClicked",onAnswerClicked:"onAnswerCallClicked",onNumpadClosed:"onNumpadClosed",onNumpadButtonClicked:"onNumpadButtonClicked",onPhoneNumberReceived:"onPhoneNumberReceived",onContactListChoose:"onContactListChoose",onContactListMenuChoose:"onContactListMenuChoose"},customEvents:{},listener:null,plugin:new BXCordovaPlugin("BXCallsCordovaPlugin"),init:function(){this.form.init();this.plugin.exec("init",{eventListener:BX.proxy(this.onEvent,this),jsCallbackProvider:"window.BX.MobileCallUI.plugin"})},setListener:function(e){this.listener=e},showContactListMenu:function(e){this.plugin.exec("showContactListMenu",{items:e})},onEvent:function(e){if(typeof this.listener=="function"){this.listener(e.eventName,e.params)}},list:{show:function(e){BX.MobileCallUI.plugin.exec("openContactList",e)},showMenu:function(e){var n=[];for(var t in e){n[t]=e[t];if(typeof n[t]["params"]=="object"){n[t]["params"]=JSON.stringify(n[t]["params"])}}BX.MobileCallUI.plugin.exec("showContactListMenu",{items:n})}},numpad:{show:function(){BX.MobileCallUI.plugin.exec("showNumpad")},close:function(e){BX.MobileCallUI.plugin.exec("closeNumpad",{animated:typeof e=="boolean"?e:true})}},form:{plugin:null,init:function(){this.plugin=BX.MobileCallUI.plugin},show:function(e){this.plugin.exec("show",e)},close:function(){this.plugin.exec("close")},updateHeader:function(e,n){this.plugin.exec("updateHeader",{headerLabels:e,avatarUrl:n})},updateMiddle:function(e,n){this.plugin.exec("updateMiddle",{middleLabels:e,middleButtons:n})},updateFooter:function(e,n){this.plugin.exec("updateFooter",{footerLabels:e,state:n})},rollUp:function(){this.plugin.exec("rollUp",{})},expand:function(){this.plugin.exec("expand",{})},startTimer:function(){this.plugin.exec("startTimer",{})},pauseTimer:function(){this.plugin.exec("pauseTimer",{})},resumeTimer:function(){this.plugin.exec("startTimer",{})},stopTimer:function(){this.plugin.exec("stopTimer",{})},cancelDelayedClosing:function(){this.plugin.exec("cancelDelayedClosing",{})},setCloseDurationDelay:function(e){this.plugin.exec("setCloseDurationDelay",{duration:e})},playSound:function(e){this.plugin.exec("playSound",{soundId:e})},stopSound:function(){this.plugin.exec("stopSound")},stopSound:function(){this.plugin.exec("stopSound")},showMenu:function(e){this.plugin.exec("showMenu",{items:e})},sound:{INCOMING:"incoming",START_CALL:"startcall"},state:{INCOMING:"INCOMING",FINISHED:"FINISHED",STARTED:"STARTED",OUTGOING:"OUTGOING",WAITING:"WAITING",CALLBACK:"CALLBACK"},contentDesc:{text:"",textColor:"",display:"",sort:1}}}})(window);
//# sourceMappingURL=mobile_voximplant.map.js