403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/im/call/engine.min.js
(function(){BX.namespace("BX.Call");BX.Call.State={Idle:"Idle",Proceeding:"Proceeding",Connected:"Connected",Finished:"Finished"};BX.Call.UserState={Idle:"Idle",Busy:"Busy",Calling:"Calling",Unavailable:"Unavailable",Declined:"Declined",Ready:"Ready",Connecting:"Connecting",Connected:"Connected",Failed:"Failed"};BX.Call.EndpointDirection={SendOnly:"send",RecvOnly:"recv",SendRecv:"sendrecv"};BX.Call.Type={Instant:1,Permanent:2};BX.Call.Provider={Plain:"Plain",Voximplant:"Voximplant"};BX.Call.StreamTag={Main:"main",Screen:"screen"};BX.Call.Direction={Incoming:"Incoming",Outgoing:"Outgoing"};BX.Call.Quality={VeryHigh:"very_high",High:"high",Medium:"medium",Low:"low",VeryLow:"very_low"};BX.Call.UserMnemonic={all:"all",none:"none"};BX.Call.Event={onUserInvited:"onUserInvited",onUserStateChanged:"onUserStateChanged",onUserMicrophoneState:"onUserMicrophoneState",onUserCameraState:"onUserCameraState",onUserVideoPaused:"onUserVideoPaused",onUserScreenState:"onUserScreenState",onUserRecordState:"onUserRecordState",onUserVoiceStarted:"onUserVoiceStarted",onUserVoiceStopped:"onUserVoiceStopped",onUserFloorRequest:"onUserFloorRequest",onUserEmotion:"onUserEmotion",onCustomMessage:"onCustomMessage",onLocalMediaReceived:"onLocalMediaReceived",onLocalMediaStopped:"onLocalMediaStopped",onMicrophoneLevel:"onMicrophoneLevel",onDeviceListUpdated:"onDeviceListUpdated",onRTCStatsReceived:"onRTCStatsReceived",onCallFailure:"onCallFailure",onRemoteMediaReceived:"onRemoteMediaReceived",onRemoteMediaStopped:"onRemoteMediaStopped",onNetworkProblem:"onNetworkProblem",onReconnecting:"onReconnecting",onReconnected:"onReconnected",onJoin:"onJoin",onLeave:"onLeave",onJoinRoomOffer:"onJoinRoomOffer",onJoinRoom:"onJoinRoom",onLeaveRoom:"onLeaveRoom",onListRooms:"onListRooms",onUpdateRoom:"onUpdateRoom",onTransferRoomSpeakerRequest:"onTransferRoomSpeakerRequest",onTransferRoomSpeaker:"onTransferRoomSpeaker",onDestroy:"onDestroy"};var e={createCall:"im.call.create",createChildCall:"im.call.createChildCall",getPublicChannels:"pull.channel.public.list",getCall:"im.call.get"};var t=false;BX.Call.Engine=function(){this.debugFlag=false;if(!t){throw new Error("Do not use this constructor directly, use BX.Call.Engine.getInstance instead")}this.calls={};this.userId=Number(BX.message("USER_ID"));this.siteId="";this.unknownCalls={};this.restClient=null;this.pullClient=null;this.init()};BX.Call.Engine.getInstance=function(){return BX.CallEngine};BX.Call.Engine.prototype.init=function(){BX.addCustomEvent("onPullEvent-im",this.__onPullEvent.bind(this));BX.addCustomEvent("onPullClientEvent-im",this.__onPullClientEvent.bind(this))};BX.Call.Engine.prototype.getSiteId=function(){return this.siteId||BX.message("SITE_ID")||""};BX.Call.Engine.prototype.setSiteId=function(e){this.siteId=e};BX.Call.Engine.prototype.getCurrentUserId=function(){return this.userId};BX.Call.Engine.prototype.setCurrentUserId=function(e){this.userId=Number(e)};BX.Call.Engine.prototype.setRestClient=function(e){this.restClient=e};BX.Call.Engine.prototype.setPullClient=function(e){this.pullClient=e};BX.Call.Engine.prototype.getRestClient=function(){return this.restClient||BX.rest};BX.Call.Engine.prototype.getPullClient=function(){return this.pullClient||BX.PULL};BX.Call.Engine.prototype.getLogService=function(){return BX.message("call_log_service")};BX.Call.Engine.prototype.createCall=function(t){var l=this;return new Promise((function(i,a){var o=t.type||BX.Call.Type.Instant;var r=t.provider||l.getDefaultProvider();if(t.joinExisting){for(var s in l.calls){if(l.calls.hasOwnProperty(s)){var c=l.calls[s];if(c.provider==t.provider&&c.associatedEntity.type==t.entityType&&c.associatedEntity.id==t.entityId){l.log(s,"Found existing call, attaching to it");return i({call:c,isNew:false})}}}}var d={type:o,provider:r,entityType:t.entityType,entityId:t.entityId,joinExisting:!!t.joinExisting,userIds:BX.type.isArray(t.userIds)?t.userIds:[]};l.getRestClient().callMethod(e.createCall,d).then((function(e){if(e.error()){var o=e.error().getError();return a({code:o.error,message:o.error_description})}var r=e.data();if(r.userData){BX.Call.Util.setUserData(r.userData)}if(r.publicChannels){BX.CallEngine.getPullClient().setPublicIds(Object.values(r.publicChannels))}var s=r.call;if(l.calls[s["ID"]]){if(l.calls[s["ID"]]instanceof n){l.calls[s["ID"]].destroy()}else{console.error("Call "+s["ID"]+" already exists");return i({call:l.calls[s["ID"]],isNew:false})}}var c=l.__getCallFabric(s["PROVIDER"]);var d=c.createCall({id:parseInt(s["ID"],10),instanceId:l.getUuidv4(),direction:BX.Call.Direction.Outgoing,users:r.users,videoEnabled:t.videoEnabled==true,enableMicAutoParameters:t.enableMicAutoParameters!==false,associatedEntity:s.ASSOCIATED_ENTITY,type:s.TYPE,startDate:s.START_DATE,events:{onDestroy:l.__onCallDestroy.bind(l)},debug:t.debug===true,logToken:r.logToken});l.calls[s["ID"]]=d;if(r.isNew){l.log(d.id,"Creating new call")}else{l.log(d.id,"Server returned existing call, attaching to it")}BX.onCustomEvent(window,"CallEvents::callCreated",[{call:d}]);i({call:d,isNew:r.isNew})})).catch((function(e){if(BX.type.isFunction(e.error)){e=e.error().getError()}a({code:e.error,message:e.error_description})}))}))};BX.Call.Engine.prototype.createChildCall=function(t,n,l){var i=this;return new Promise((function(a,o){if(!i.calls[t]){return o("Parent call is not found")}var r=i.calls[t];var s={parentId:t,newProvider:n,newUsers:l};i.getRestClient().callMethod(e.createChildCall,s,(function(e){var t=e.data();var n=t.call;var l=i.__getCallFabric(n["PROVIDER"]);var o=l.createCall({id:parseInt(n["ID"],10),instanceId:i.getUuidv4(),parentId:n["PARENT_ID"],direction:BX.Call.Direction.Outgoing,users:t.users,videoEnabled:r.isVideoEnabled(),enableMicAutoParameters:r.enableMicAutoParameters!==false,associatedEntity:n.ASSOCIATED_ENTITY,type:n.TYPE,startDate:n.START_DATE,events:{onDestroy:i.__onCallDestroy.bind(i)},logToken:t.logToken});i.calls[n["ID"]]=o;BX.onCustomEvent(window,"CallEvents::callCreated",[{call:o}]);a({call:o,isNew:t.isNew})}))}))};BX.Call.Engine.prototype._instantiateCall=function(e,t,n){if(this.calls[e["ID"]]){console.error("Call "+e["ID"]+" already exists");return this.calls[e["ID"]]}var l=this.__getCallFabric(e["PROVIDER"]);var i=l.createCall({id:parseInt(e["ID"],10),instanceId:this.getUuidv4(),initiatorId:parseInt(e["INITIATOR_ID"],10),parentId:e["PARENT_ID"],direction:e["INITIATOR_ID"]==this.userId?BX.Call.Direction.Outgoing:BX.Call.Direction.Incoming,users:t,associatedEntity:e.ASSOCIATED_ENTITY,type:e.TYPE,startDate:e["START_DATE"],logToken:n,events:{onDestroy:this.__onCallDestroy.bind(this)}});this.calls[e["ID"]]=i;BX.onCustomEvent(window,"CallEvents::callCreated",[{call:i}]);return i};BX.Call.Engine.prototype.getCallWithId=function(t){var n=this;return new Promise((function(l,i){if(n.calls[t]){return l({call:n.calls[t],isNew:false})}n.getRestClient().callMethod(e.getCall,{callId:t}).then((function(e){var t=e.data();l({call:n._instantiateCall(t.call,t.users,t.logToken),isNew:false})})).catch((function(e){console.error(e);if(BX.type.isFunction(e.error)){e=e.error().getError()}i({code:e.error,message:e.error_description})}))}))};BX.Call.Engine.prototype.getUuidv4=function(){return BX.Call.Util.getUuidv4()};BX.Call.Engine.prototype.__onPullEvent=function(e,t,n){var l={"Call::incoming":this.__onPullIncomingCall.bind(this)};if(e.startsWith("Call::")){if(t.publicIds){BX.CallEngine.getPullClient().setPublicIds(Object.values(t.publicIds))}if(t.userData){BX.Call.Util.setUserData(t.userData)}}if(l[e]){l[e].call(this,t,n)}else if(e.substr(0,6)==="Call::"&&(t["call"]||t["callId"])){var i=t["call"]?t["call"]["ID"]:t["callId"];if(this.calls[i]){this.calls[i].__onPullEvent(e,t,n)}else if(e==="Call::ping"){this.__onUnknownCallPing(t,n).then(function(l){if(l&&this.calls[i]){this.calls[i].__onPullEvent(e,t,n)}}.bind(this))}}};BX.Call.Engine.prototype.__onPullClientEvent=function(e,t,n){if(e.substr(0,6)==="Call::"&&t["callId"]){var l=t["callId"];if(this.calls[l]){this.calls[l].__onPullEvent(e,t,n)}else if(e==="Call::ping"){this.__onUnknownCallPing(t,n).then(function(i){if(i&&this.calls[l]){this.calls[l].__onPullEvent(e,t,n)}}.bind(this))}}};BX.Call.Engine.prototype.__onPullIncomingCall=function(e,t){if(t.server_time_ago>30){console.error("Call was started too long time ago");return}var n=e.call;var l=parseInt(n.ID,10);var i;if(e.publicIds){BX.CallEngine.getPullClient().setPublicIds(Object.values(e.publicIds))}if(e.userData){BX.Call.Util.setUserData(e.userData)}if(this.calls[l]){i=this.calls[l]}else{var a=this.__getCallFabric(n.PROVIDER);i=a.createCall({id:l,instanceId:this.getUuidv4(),parentId:n.PARENT_ID||null,callFromMobile:e.isLegacyMobile===true,direction:BX.Call.Direction.Incoming,users:e.users,initiatorId:e.senderId,associatedEntity:n.ASSOCIATED_ENTITY,type:n.TYPE,startDate:n.START_DATE,logToken:e.logToken,events:{onDestroy:this.__onCallDestroy.bind(this)}});this.calls[l]=i;BX.onCustomEvent(window,"CallEvents::callCreated",[{call:i}])}i.addInvitedUsers(e.invitedUsers);if(i){BX.onCustomEvent(window,"CallEvents::incomingCall",[{call:i,video:e.video===true,isLegacyMobile:e.isLegacyMobile===true}])}this.log(i.id,"Incoming call "+i.id)};BX.Call.Engine.prototype.__onUnknownCallPing=function(e,t){return new Promise(function(n,l){var i=Number(e.callId);if(t.server_time_ago>10){this.log(i,"Error: Ping was sent too long time ago");return n(false)}if(!this.__isCallAppInitialized()){return n(false)}if(this.unknownCalls[i]){return n(false)}this.unknownCalls[i]=true;if(e.userData){BX.Call.Util.setUserData(e.userData)}this.getCallWithId(i).then(function(e){this.unknownCalls[i]=false;n(true)}.bind(this)).catch(function(e){this.unknownCalls[i]=false;this.log(i,"Error: Could not instantiate call",e);n(false)}.bind(this))}.bind(this))};BX.Call.Engine.prototype.__onCallDestroy=function(e){var t=e.call.id;this.calls[t]=new n({callId:t,onDelete:function(){if(this.calls[t]){delete this.calls[t]}}.bind(this)});BX.onCustomEvent(window,"CallEvents::callDestroyed",[{callId:e.call.id}])};BX.Call.Engine.prototype.__isCallAppInitialized=function(){if("BXIM"in window){return BXIM.init}else if(BX.Messenger&&BX.Messenger.Application&&BX.Messenger.Application.conference){return BX.Messenger.Application.conference.inited}return false};BX.Call.Engine.prototype.getDefaultProvider=function(){return BX.Call.Provider.Plain};BX.Call.Engine.prototype.getConferencePageTag=function(e){return"conference-open-"+e};BX.Call.Engine.prototype.__getCallFabric=function(e){if(e==BX.Call.Provider.Plain){return BX.Call.PlainCallFabric}else if(e==BX.Call.Provider.Voximplant){return BX.Call.VoximplantCallFabric}throw new Error("Unknown call provider type "+e)};BX.Call.Engine.prototype.debug=function(e){this.debugFlag=typeof e==="undefined"?true:!!e;return this.debugFlag};BX.Call.Engine.prototype.log=function(){var e=BX.Call.Util.getLogMessage.call(BX.Call.Util,arguments);if(BX.desktop&&BX.desktop.ready()){BX.desktop.log(BX.message("USER_ID")+".video.log",e)}if(this.debugFlag){if(console){var t=["Call log ["+BX.Call.Util.getTimeForLog()+"]: "];console.log.apply(this,t.concat(Array.prototype.slice.call(arguments)))}}};BX.Call.Engine.prototype.getAllowedVideoQuality=function(e){if(e<5){return BX.Call.Quality.VeryHigh}else if(e<10){return BX.Call.Quality.High}else if(e<16){return BX.Call.Quality.Medium}else if(e<32){return BX.Call.Quality.Low}else{return BX.Call.Quality.VeryLow}};BX.Call.PlainCallFabric={createCall:function(e){return new BX.Call.PlainCall(e)}};BX.Call.VoximplantCallFabric={createCall:function(e){return new BX.Call.VoximplantCall(e)}};var n=function(e){this.callId=e.callId;this.lifetime=e.lifetime||120;this.callbacks={onDelete:BX.type.isFunction(e.onDelete)?e.onDelete:BX.DoNothing};this.deleteTimeout=setTimeout(function(){this.callbacks.onDelete({callId:this.callId})}.bind(this),this.lifetime*1e3)};n.prototype.__onPullEvent=function(e,t,n){};n.prototype.isAnyoneParticipating=function(){return false};n.prototype.addEventListener=function(){return false};n.prototype.removeEventListener=function(){return false};n.prototype.destroy=function(){clearTimeout(this.deleteTimeout);this.callbacks.onDelete=BX.DoNothing};t=true;BX.CallEngine=new BX.Call.Engine;t=false})();
//# sourceMappingURL=engine.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit