sip-connector 13.0.0 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SipConnectorFacade/SipConnectorFacade.d.ts +20 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +227 -206
- package/package.json +3 -3
|
@@ -2,13 +2,32 @@ import { UA } from '@krivega/jssip';
|
|
|
2
2
|
import { default as SipConnector } from '../SipConnector';
|
|
3
3
|
import { EUseLicense, TContentHint, TSimulcastEncoding } from '../types';
|
|
4
4
|
declare class SipConnectorFacade {
|
|
5
|
-
|
|
5
|
+
readonly sipConnector: SipConnector;
|
|
6
6
|
private readonly preferredMimeTypesVideoCodecs?;
|
|
7
7
|
private readonly excludeMimeTypesVideoCodecs?;
|
|
8
|
+
on: SipConnector['on'];
|
|
9
|
+
once: SipConnector['once'];
|
|
10
|
+
onceRace: SipConnector['onceRace'];
|
|
11
|
+
wait: SipConnector['wait'];
|
|
12
|
+
off: SipConnector['off'];
|
|
13
|
+
onSession: SipConnector['onSession'];
|
|
14
|
+
onceSession: SipConnector['onceSession'];
|
|
15
|
+
onceRaceSession: SipConnector['onceRaceSession'];
|
|
16
|
+
waitSession: SipConnector['waitSession'];
|
|
17
|
+
offSession: SipConnector['offSession'];
|
|
18
|
+
sendDTMF: SipConnector['sendDTMF'];
|
|
19
|
+
hangUp: SipConnector['hangUp'];
|
|
20
|
+
declineToIncomingCall: SipConnector['declineToIncomingCall'];
|
|
21
|
+
isConfigured: SipConnector['isConfigured'];
|
|
22
|
+
sendChannels: SipConnector['sendChannels'];
|
|
23
|
+
checkTelephony: SipConnector['checkTelephony'];
|
|
24
|
+
waitChannels: SipConnector['waitChannels'];
|
|
25
|
+
ping: SipConnector['ping'];
|
|
8
26
|
constructor(sipConnector: SipConnector, { preferredMimeTypesVideoCodecs, excludeMimeTypesVideoCodecs, }?: {
|
|
9
27
|
preferredMimeTypesVideoCodecs?: string[];
|
|
10
28
|
excludeMimeTypesVideoCodecs?: string[];
|
|
11
29
|
});
|
|
30
|
+
get isRegistered(): boolean;
|
|
12
31
|
connectToServer: (parameters: {
|
|
13
32
|
userAgent: string;
|
|
14
33
|
sipWebSocketServerURL: string;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ne=Object.defineProperty;var te=(n,e,t)=>e in n?ne(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>te(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("./SipConnector-CE4F15z6.cjs"),re=require("sequent-promises"),se=require("stack-promises"),oe=require("@krivega/cancelable-promise"),ce=require("repeated-calls"),ie=require("ts-debounce"),ae=require("debug"),$=n=>{const{url:e,cause:t}=n;let r=e;return(t===s.BAD_MEDIA_DESCRIPTION||t===s.NOT_FOUND)&&(r=`${n.message.to.uri.user}@${n.message.to.uri.host}`),r};var j=(n=>(n.CONNECT_SERVER_FAILED="CONNECT_SERVER_FAILED",n.WRONG_USER_OR_PASSWORD="WRONG_USER_OR_PASSWORD",n.BAD_MEDIA_ERROR="BAD_MEDIA_ERROR",n.NOT_FOUND_ERROR="NOT_FOUND_ERROR",n.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",n.CONNECT_SERVER_FAILED_BY_LINK="CONNECT_SERVER_FAILED_BY_LINK",n))(j||{});const ue=(n=new Error)=>{var o;const{cause:e,socket:t}=n;let r="CONNECT_SERVER_FAILED";switch(e){case"Forbidden":{r="WRONG_USER_OR_PASSWORD";break}case s.BAD_MEDIA_DESCRIPTION:{r="BAD_MEDIA_ERROR";break}case s.NOT_FOUND:{r="NOT_FOUND_ERROR";break}default:t&&((o=t==null?void 0:t._ws)==null?void 0:o.readyState)===3?r="WS_CONNECTION_FAILED":$(n)&&(r="CONNECT_SERVER_FAILED_BY_LINK")}return r},le=n=>{let e="";try{e=JSON.stringify(n)}catch(t){s.logger("failed to stringify message",t)}return e},de=(n=new Error)=>{const{code:e,cause:t,message:r}=n,o=$(n),c={code:"",cause:"",message:""};return typeof r=="object"&&r!==null?c.message=le(r):r&&(c.message=String(r)),o&&(c.link=o),e&&(c.code=e),t&&(c.cause=t),c},ge=Object.freeze(Object.defineProperty({__proto__:null,EErrorTypes:j,getLinkError:$,getTypeFromError:ue,getValuesFromError:de},Symbol.toStringTag,{value:"Module"})),Se=({sessionId:n,remoteAddress:e,isMutedAudio:t,isMutedVideo:r,isRegistered:o,isPresentationCall:c})=>{const i=[],a=t?"0":"1",u=r?"0":"1";return i.push(`X-Vinteo-Mic-State: ${a}`,`X-Vinteo-MainCam-State: ${u}`),o||i.push("X-Vinteo-Purgatory-Call: yes"),n&&i.push(`X-Vinteo-Session: ${n}`),c&&i.push("X-Vinteo-Presentation-Call: yes"),e&&i.push(`X-Vinteo-Remote: ${e}`),i},Ce="[@*!|]",me="_",fe=n=>{let e=n;return e=e.replaceAll(new RegExp(Ce,"g"),me),e},Re=({appName:n,appVersion:e,browserName:t,browserVersion:r})=>{const c=`${fe(n)} ${e}`;return`ChromeNew - ${t?`${t} ${r}, ${c}`:c}`},he=({isUnifiedSdpSemantic:n,appVersion:e,browserName:t,browserVersion:r,appName:o})=>n?Re({appVersion:e,browserName:t,browserVersion:r,appName:o}):"Chrome",W="purgatory",I=n=>n===W,Ee=n=>e=>[...e].map(r=>async()=>n(r)),pe=async({accumulatedKeys:n,sendKey:e,canRunTask:t})=>{const o=Ee(e)(n);return re.sequentPromises(o,t)},ye=n=>t=>(s.logger("onStartMainCam"),n.onSession("admin-start-main-cam",t)),Te=n=>t=>(s.logger("onStartMic"),n.onSession("admin-start-mic",t)),Me=n=>t=>(s.logger("onStopMainCam"),n.onSession("admin-stop-main-cam",t)),be=n=>t=>(s.logger("onStopMic"),n.onSession("admin-stop-mic",t)),Ae=({sipConnector:n})=>{const e=(m,E)=>({isSyncForced:f=!1})=>{if(f){m();return}E()},t=ye(n),r=Me(n),o=Te(n),c=be(n);let i=()=>{},a=()=>{},u=()=>{},g=()=>{};const C=({onStartMainCamForced:m,onStartMainCamNotForced:E,onStopMainCamForced:f,onStopMainCamNotForced:R,onStartMicForced:p,onStartMicNotForced:y,onStopMicForced:T,onStopMicNotForced:M})=>{const _=e(m,E);i=t(_);const v=e(f,R);a=r(v);const O=e(p,y);u=o(O);const N=e(T,M);g=c(N)},S=()=>{i(),a(),u(),g()};return{start:m=>{C(m)},stop:()=>{S()}}},_e=Object.freeze(Object.defineProperty({__proto__:null,PURGATORY_CONFERENCE_NUMBER:W,createSyncMediaState:Ae,error:ge,getExtraHeaders:Se,getUserAgent:he,hasPurgatory:I,sendDTMFAccumulated:pe},Symbol.toStringTag,{value:"Module"})),ve=n=>[...n.keys()].map(e=>n.get(e)),Oe=(n,e)=>ve(n).find(t=>t.type===e),G=async n=>n.getStats().then(e=>{const t=Oe(e,"codec");return t==null?void 0:t.mimeType}),Ne=n=>n.find(e=>{var t;return((t=e==null?void 0:e.track)==null?void 0:t.kind)==="video"}),K=(n,e)=>n!==void 0&&e!==void 0&&n.toLowerCase().includes(e.toLowerCase()),Pe=1e6,h=n=>n*Pe,Y=h(.06),Be=h(4),De=n=>n<=64?Y:n<=128?h(.12):n<=256?h(.25):n<=384?h(.32):n<=426?h(.38):n<=640?h(.5):n<=848?h(.7):n<=1280?h(1):n<=1920?h(2):Be,Ie="av1",we=n=>K(n,Ie),Fe=.6,z=(n,e)=>we(e)?n*Fe:n,ke=n=>z(Y,n),Q=(n,e)=>{const t=De(n);return z(t,e)},Ue=1,J=({videoTrack:n,targetSize:e,codec:t})=>{const r=n.getSettings(),o=r.width,c=r.height,i=o/e.width,a=c/e.height,u=Math.max(i,a,Ue),g=Q(e.width,t);return{scaleResolutionDownBy:u,maxBitrate:g}},Z=se.createStackPromises(),Ve=async()=>Z().catch(n=>{s.logger("videoSendingBalancer: error",n)}),Le=async n=>(Z.add(n),Ve()),q=async({sender:n,scaleResolutionDownBy:e,maxBitrate:t,onSetParameters:r})=>Le(async()=>s.setEncodingsToSender(n,{scaleResolutionDownBy:e,maxBitrate:t},r)),xe=async({sender:n,codec:e},t)=>{const o=ke(e);return q({sender:n,maxBitrate:o,onSetParameters:t,scaleResolutionDownBy:200})},L=async({sender:n,videoTrack:e,codec:t},r)=>{const i=e.getSettings().width,a=Q(i,t);return q({sender:n,maxBitrate:a,onSetParameters:r,scaleResolutionDownBy:1})},$e=async({sender:n,videoTrack:e,resolution:t,codec:r},o)=>{const[c,i]=t.split("x"),{maxBitrate:a,scaleResolutionDownBy:u}=J({videoTrack:e,codec:r,targetSize:{width:Number(c),height:Number(i)}});return q({sender:n,maxBitrate:a,onSetParameters:o,scaleResolutionDownBy:u})},qe=async({mainCam:n,resolutionMainCam:e,sender:t,videoTrack:r,codec:o},c)=>{switch(n){case s.EEventsMainCAM.PAUSE_MAIN_CAM:return xe({sender:t,codec:o},c);case s.EEventsMainCAM.RESUME_MAIN_CAM:return L({sender:t,videoTrack:r,codec:o},c);case s.EEventsMainCAM.MAX_MAIN_CAM_RESOLUTION:return e!==void 0?$e({sender:t,videoTrack:r,codec:o,resolution:e},c):L({sender:t,videoTrack:r,codec:o},c);default:return L({sender:t,videoTrack:r,codec:o},c)}},H={isChanged:!1,parameters:{encodings:[{}],transactionId:"0",codecs:[],headerExtensions:[],rtcp:{}}},X=async({mainCam:n,resolutionMainCam:e,connection:t,onSetParameters:r,ignoreForCodec:o})=>{const c=t.getSenders(),i=Ne(c);if(!(i!=null&&i.track))return H;const a=await G(i);return K(a,o)?H:qe({mainCam:n,resolutionMainCam:e,sender:i,codec:a,videoTrack:i.track},r)},He=(n,{ignoreForCodec:e,onSetParameters:t}={})=>{const r=async()=>{const{connection:u}=n;if(!u)throw new Error("connection is not exist");return X({connection:u,onSetParameters:t,ignoreForCodec:e})};let o=r;const c=async u=>(o=async()=>{const{mainCam:g,resolutionMainCam:C}=u,{connection:S}=n;if(!S)throw new Error("connection is not exist");return X({mainCam:g,resolutionMainCam:C,connection:S,onSetParameters:t,ignoreForCodec:e})},o());return{subscribe:()=>{n.onSession("main-cam-control",c)},unsubscribe:()=>{n.offSession("main-cam-control",c)},balanceByTrack:r,resetMainCamControl(){o=r},async reBalance(){return o()}}},Xe=n=>n.getVideoTracks()[0],B=({mediaStream:n,simulcastEncodings:e,sendEncodings:t})=>{if(e&&e.length>0){const r=t??[],o=Xe(n);return e.forEach((c,i)=>{const a=r[i]??{};a.active=!0,c.rid!==void 0&&(a.rid=c.rid),c.scalabilityMode!==void 0&&(a.scalabilityMode=c.scalabilityMode);const{maxBitrate:u,scaleResolutionDownBy:g}=J({videoTrack:o,targetSize:{width:c.width,height:c.height}});a.maxBitrate=u,a.scaleResolutionDownBy=g,r[i]=a}),r}return t},je=(n,e)=>[...n,...e].filter((o,c,i)=>c===i.findIndex(a=>a.clockRate===o.clockRate&&a.mimeType===o.mimeType&&a.channels===o.channels&&a.sdpFmtpLine===o.sdpFmtpLine)),We=n=>{const e=RTCRtpSender.getCapabilities(n),t=RTCRtpReceiver.getCapabilities(n),r=e===null?[]:e.codecs,o=t===null?[]:t.codecs;return je(r,o)},Ge=(n,e)=>e===void 0||e.length===0?n:n.sort((t,r)=>{const o=e.indexOf(t.mimeType),c=e.indexOf(r.mimeType),i=o===-1?Number.MAX_VALUE:o,a=c===-1?Number.MAX_VALUE:c;return i-a}),Ke=(n,e)=>e===void 0||e.length===0?n:n.filter(t=>!e.includes(t.mimeType)),D=(n,{preferredMimeTypesVideoCodecs:e,excludeMimeTypesVideoCodecs:t})=>async r=>{var o;if(typeof r.setCodecPreferences=="function"&&((o=r.sender.track)==null?void 0:o.kind)==="video"&&(e!==void 0&&(e==null?void 0:e.length)>0||t!==void 0&&(t==null?void 0:t.length)>0)){const c=We("video"),i=Ke(c,t),a=Ge(i,e);r.setCodecPreferences(a)}Object.keys(n).length>0&&await s.setParametersToSender(r.sender,n)},x=n=>{if(!oe.isCanceledError(n)&&!ce.hasCanceledError(n))throw n;return{isSuccessful:!1}},Ye=({kind:n,readyState:e})=>n==="video"&&e==="live";class ze{constructor(e,{preferredMimeTypesVideoCodecs:t,excludeMimeTypesVideoCodecs:r}={}){l(this,"sipConnector");l(this,"preferredMimeTypesVideoCodecs");l(this,"excludeMimeTypesVideoCodecs");l(this,"connectToServer",async e=>{const{userAgent:t,sipWebSocketServerURL:r,sipServerUrl:o,remoteAddress:c,displayName:i,name:a,password:u,isRegisteredUser:g,isDisconnectOnFail:C}=e;return s.logger("connectToServer",e),this.sipConnector.connect({userAgent:t,sipWebSocketServerURL:r,sipServerUrl:o,remoteAddress:c,displayName:i,password:u,user:a,register:g}).then(S=>(s.logger("connectToServer then"),{ua:S,isSuccessful:!0})).catch(async S=>(s.logger("connectToServer catch: error",S),C===!0?this.sipConnector.disconnect().then(()=>x(S)).catch(()=>x(S)):x(S)))});l(this,"callToServer",async e=>{const{conference:t,mediaStream:r,extraHeaders:o,iceServers:c,contentHint:i,simulcastEncodings:a,degradationPreference:u,sendEncodings:g,offerToReceiveAudio:C,offerToReceiveVideo:S,directionVideo:w,directionAudio:F,setRemoteStreams:m,onBeforeProgressCall:E,onSuccessProgressCall:f,onEnterPurgatory:R,onEnterConference:p,onFailProgressCall:y,onFinishProgressCall:T,onEndedCall:M}=e,_=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:m}),v=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:_}),O=D({degradationPreference:u},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});s.logger("callToServer",e);const N=async()=>(s.logger("startCall"),this.sipConnector.call({mediaStream:r,extraHeaders:o,iceServers:c,contentHint:i,offerToReceiveAudio:C,offerToReceiveVideo:S,directionVideo:w,directionAudio:F,sendEncodings:B({mediaStream:r,simulcastEncodings:a,sendEncodings:g}),number:t,onAddedTransceiver:O,ontrack:v}));let b=!1,A;const P=(s.logger("subscribeEnterConference: onEnterConference",p),R??p?this.sipConnector.onSession("enterRoom",({room:d})=>{s.logger("enterRoom",{_room:d,isSuccessProgressCall:b}),A=d,I(A)?R&&R():p&&p({isSuccessProgressCall:b})}):()=>{}),k=d=>(s.logger("onSuccess"),b=!0,_(),f&&f({isPurgatory:I(A)}),this.sipConnector.onceRaceSession(["ended","failed"],()=>{P(),M&&M()}),d),U=d=>{throw s.logger("onFail"),y&&y(),P(),d},V=()=>{s.logger("onFinish"),T&&T()};return s.logger("onBeforeProgressCall"),E&&E(t),N().then(k).catch(d=>U(d)).finally(V)});l(this,"disconnectFromServer",async()=>this.sipConnector.disconnect().then(()=>(s.logger("disconnectFromServer: then"),{isSuccessful:!0})).catch(e=>(s.logger("disconnectFromServer: catch",e),{isSuccessful:!1})));l(this,"answerIncomingCall",async e=>{const{mediaStream:t,extraHeaders:r,iceServers:o,contentHint:c,simulcastEncodings:i,degradationPreference:a,sendEncodings:u,offerToReceiveAudio:g,offerToReceiveVideo:C,directionVideo:S,directionAudio:w,setRemoteStreams:F,onBeforeProgressCall:m,onSuccessProgressCall:E,onEnterPurgatory:f,onEnterConference:R,onFailProgressCall:p,onFinishProgressCall:y,onEndedCall:T}=e,M=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:F}),_=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:M}),v=D({degradationPreference:a},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});s.logger("answerIncomingCall",e);const O=async()=>this.sipConnector.answerToIncomingCall({mediaStream:t,extraHeaders:r,iceServers:o,contentHint:c,offerToReceiveAudio:g,offerToReceiveVideo:C,directionVideo:S,directionAudio:w,sendEncodings:B({mediaStream:t,simulcastEncodings:i,sendEncodings:u}),onAddedTransceiver:v,ontrack:_}),N=()=>{const{remoteCallerData:d}=this.sipConnector;return d.incomingNumber};let b=!1,A;const P=(s.logger("subscribeEnterConference: onEnterConference",R),f??R?this.sipConnector.onSession("enterRoom",d=>{s.logger("enterRoom",{_room:d,isSuccessProgressCall:b}),A=d,I(A)?f&&f():R&&R({isSuccessProgressCall:b})}):()=>{}),k=d=>(s.logger("onSuccess"),b=!0,M(),E&&E({isPurgatory:I(A)}),this.sipConnector.onceRaceSession(["ended","failed"],()=>{P(),T&&T()}),d),U=d=>{throw s.logger("onFail"),p&&p(),P(),d},V=()=>{s.logger("onFinish"),y&&y()};if(s.logger("onBeforeProgressCall"),m){const d=N();m(d)}return O().then(k).catch(d=>U(d)).finally(V)});l(this,"updatePresentation",async({mediaStream:e,isP2P:t,maxBitrate:r,contentHint:o,simulcastEncodings:c,degradationPreference:i,sendEncodings:a,preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g})=>{const C=D({degradationPreference:i},{preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g});return s.logger("updatePresentation"),this.sipConnector.updatePresentation(e,{isP2P:t,maxBitrate:r,contentHint:o,sendEncodings:B({mediaStream:e,simulcastEncodings:c,sendEncodings:a}),onAddedTransceiver:C})});l(this,"startPresentation",async({mediaStream:e,isP2P:t,maxBitrate:r,contentHint:o,simulcastEncodings:c,degradationPreference:i,sendEncodings:a,preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g},C)=>{const S=D({degradationPreference:i},{preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g});return s.logger("startPresentation"),this.sipConnector.startPresentation(e,{isP2P:t,maxBitrate:r,contentHint:o,sendEncodings:B({mediaStream:e,simulcastEncodings:c,sendEncodings:a}),onAddedTransceiver:S},C)});l(this,"stopShareSipConnector",async({isP2P:e=!1}={})=>(s.logger("stopShareSipConnector"),this.sipConnector.stopPresentation({isP2P:e}).catch(t=>{s.logger(t)})));l(this,"sendRefusalToTurnOnMic",async()=>{if(this.sipConnector.isCallActive)return s.logger("sendRefusalToTurnOnMic"),this.sipConnector.sendRefusalToTurnOnMic().catch(e=>{s.logger("sendRefusalToTurnOnMic: error",e)})});l(this,"sendRefusalToTurnOnCam",async()=>{if(this.sipConnector.isCallActive)return s.logger("sendRefusalToTurnOnCam"),this.sipConnector.sendRefusalToTurnOnCam().catch(e=>{s.logger("sendRefusalToTurnOnCam: error",e)})});l(this,"sendMediaState",async({isEnabledCam:e,isEnabledMic:t})=>{if(this.sipConnector.isCallActive)return s.logger("sendMediaState"),this.sipConnector.sendMediaState({cam:e,mic:t})});l(this,"replaceMediaStream",async(e,{deleteExisting:t,addMissing:r,forceRenegotiation:o,contentHint:c,simulcastEncodings:i,degradationPreference:a,sendEncodings:u}={})=>{const g=D({degradationPreference:a},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});return s.logger("replaceMediaStream"),this.sipConnector.replaceMediaStream(e,{deleteExisting:t,addMissing:r,forceRenegotiation:o,contentHint:c,sendEncodings:B({mediaStream:e,simulcastEncodings:i,sendEncodings:u}),onAddedTransceiver:g})});l(this,"askPermissionToEnableCam",async()=>{if(this.sipConnector.isCallActive)return s.logger("askPermissionToEnableCam"),this.sipConnector.askPermissionToEnableCam()});l(this,"resolveHandleReadyRemoteStreamsDebounced",({onReadyRemoteStreams:e})=>ie.debounce(()=>{const t=this.sipConnector.getRemoteStreams();s.logger("remoteStreams",t),t&&e(t)},200));l(this,"resolveHandleReadyRemoteStreams",({onReadyRemoteStreams:e})=>({track:t})=>{Ye(t)&&e()});l(this,"getRemoteStreams",()=>(s.logger("getRemoteStreams"),this.sipConnector.getRemoteStreams()));l(this,"onUseLicense",e=>(s.logger("onUseLicense"),this.sipConnector.onSession("useLicense",e)));l(this,"onMustStopPresentation",e=>(s.logger("onMustStopPresentation"),this.sipConnector.onSession("mustStopPresentation",e)));l(this,"onMoveToSpectators",e=>(s.logger("onMoveToSpectators"),this.sipConnector.onSession(s.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS,e)));l(this,"onMoveToParticipants",e=>(s.logger("onMoveToParticipants"),this.sipConnector.onSession(s.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS,e)));this.sipConnector=e,this.preferredMimeTypesVideoCodecs=t,this.excludeMimeTypesVideoCodecs=r}}exports.EEventsMainCAM=s.EEventsMainCAM;exports.EEventsMic=s.EEventsMic;exports.EEventsSyncMediaState=s.EEventsSyncMediaState;exports.EMimeTypesVideoCodecs=s.EMimeTypesVideoCodecs;exports.EUseLicense=s.EUseLicense;exports.causes=s.causes;exports.constants=s.constants;exports.default=s.SipConnector;exports.disableDebug=s.disableDebug;exports.enableDebug=s.enableDebug;exports.eventNames=s.eventNames;exports.hasCanceledCallError=s.hasCanceledCallError;exports.setParametersToSender=s.setParametersToSender;exports.debug=ae;exports.SipConnectorFacade=ze;exports.getCodecFromSender=G;exports.resolveVideoSendingBalancer=He;exports.tools=_e;
|
|
1
|
+
"use strict";var ne=Object.defineProperty;var te=(n,e,t)=>e in n?ne(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var l=(n,e,t)=>te(n,typeof e!="symbol"?e+"":e,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("./SipConnector-CE4F15z6.cjs"),se=require("sequent-promises"),oe=require("stack-promises"),re=require("@krivega/cancelable-promise"),ie=require("repeated-calls"),ce=require("ts-debounce"),ae=require("debug"),$=n=>{const{url:e,cause:t}=n;let s=e;return(t===o.BAD_MEDIA_DESCRIPTION||t===o.NOT_FOUND)&&(s=`${n.message.to.uri.user}@${n.message.to.uri.host}`),s};var j=(n=>(n.CONNECT_SERVER_FAILED="CONNECT_SERVER_FAILED",n.WRONG_USER_OR_PASSWORD="WRONG_USER_OR_PASSWORD",n.BAD_MEDIA_ERROR="BAD_MEDIA_ERROR",n.NOT_FOUND_ERROR="NOT_FOUND_ERROR",n.WS_CONNECTION_FAILED="WS_CONNECTION_FAILED",n.CONNECT_SERVER_FAILED_BY_LINK="CONNECT_SERVER_FAILED_BY_LINK",n))(j||{});const le=(n=new Error)=>{var r;const{cause:e,socket:t}=n;let s="CONNECT_SERVER_FAILED";switch(e){case"Forbidden":{s="WRONG_USER_OR_PASSWORD";break}case o.BAD_MEDIA_DESCRIPTION:{s="BAD_MEDIA_ERROR";break}case o.NOT_FOUND:{s="NOT_FOUND_ERROR";break}default:t&&((r=t==null?void 0:t._ws)==null?void 0:r.readyState)===3?s="WS_CONNECTION_FAILED":$(n)&&(s="CONNECT_SERVER_FAILED_BY_LINK")}return s},ue=n=>{let e="";try{e=JSON.stringify(n)}catch(t){o.logger("failed to stringify message",t)}return e},de=(n=new Error)=>{const{code:e,cause:t,message:s}=n,r=$(n),i={code:"",cause:"",message:""};return typeof s=="object"&&s!==null?i.message=ue(s):s&&(i.message=String(s)),r&&(i.link=r),e&&(i.code=e),t&&(i.cause=t),i},ge=Object.freeze(Object.defineProperty({__proto__:null,EErrorTypes:j,getLinkError:$,getTypeFromError:le,getValuesFromError:de},Symbol.toStringTag,{value:"Module"})),Se=({sessionId:n,remoteAddress:e,isMutedAudio:t,isMutedVideo:s,isRegistered:r,isPresentationCall:i})=>{const c=[],a=t?"0":"1",u=s?"0":"1";return c.push(`X-Vinteo-Mic-State: ${a}`,`X-Vinteo-MainCam-State: ${u}`),r||c.push("X-Vinteo-Purgatory-Call: yes"),n&&c.push(`X-Vinteo-Session: ${n}`),i&&c.push("X-Vinteo-Presentation-Call: yes"),e&&c.push(`X-Vinteo-Remote: ${e}`),c},Ce="[@*!|]",he="_",fe=n=>{let e=n;return e=e.replaceAll(new RegExp(Ce,"g"),he),e},me=({appName:n,appVersion:e,browserName:t,browserVersion:s})=>{const i=`${fe(n)} ${e}`;return`ChromeNew - ${t?`${t} ${s}, ${i}`:i}`},Re=({isUnifiedSdpSemantic:n,appVersion:e,browserName:t,browserVersion:s,appName:r})=>n?me({appVersion:e,browserName:t,browserVersion:s,appName:r}):"Chrome",W="purgatory",B=n=>n===W,pe=n=>e=>[...e].map(s=>async()=>n(s)),Ee=async({accumulatedKeys:n,sendKey:e,canRunTask:t})=>{const r=pe(e)(n);return se.sequentPromises(r,t)},ye=n=>t=>(o.logger("onStartMainCam"),n.onSession("admin-start-main-cam",t)),Te=n=>t=>(o.logger("onStartMic"),n.onSession("admin-start-mic",t)),be=n=>t=>(o.logger("onStopMainCam"),n.onSession("admin-stop-main-cam",t)),Me=n=>t=>(o.logger("onStopMic"),n.onSession("admin-stop-mic",t)),Ae=({sipConnector:n})=>{const e=(h,p)=>({isSyncForced:f=!1})=>{if(f){h();return}p()},t=ye(n),s=be(n),r=Te(n),i=Me(n);let c=()=>{},a=()=>{},u=()=>{},g=()=>{};const C=({onStartMainCamForced:h,onStartMainCamNotForced:p,onStopMainCamForced:f,onStopMainCamNotForced:m,onStartMicForced:E,onStartMicNotForced:y,onStopMicForced:T,onStopMicNotForced:b})=>{const _=e(h,p);c=t(_);const v=e(f,m);a=s(v);const O=e(E,y);u=r(O);const N=e(T,b);g=i(N)},S=()=>{c(),a(),u(),g()};return{start:h=>{C(h)},stop:()=>{S()}}},_e=Object.freeze(Object.defineProperty({__proto__:null,PURGATORY_CONFERENCE_NUMBER:W,createSyncMediaState:Ae,error:ge,getExtraHeaders:Se,getUserAgent:Re,hasPurgatory:B,sendDTMFAccumulated:Ee},Symbol.toStringTag,{value:"Module"})),ve=n=>[...n.keys()].map(e=>n.get(e)),Oe=(n,e)=>ve(n).find(t=>t.type===e),G=async n=>n.getStats().then(e=>{const t=Oe(e,"codec");return t==null?void 0:t.mimeType}),Ne=n=>n.find(e=>{var t;return((t=e==null?void 0:e.track)==null?void 0:t.kind)==="video"}),K=(n,e)=>n!==void 0&&e!==void 0&&n.toLowerCase().includes(e.toLowerCase()),Pe=1e6,R=n=>n*Pe,Y=R(.06),De=R(4),we=n=>n<=64?Y:n<=128?R(.12):n<=256?R(.25):n<=384?R(.32):n<=426?R(.38):n<=640?R(.5):n<=848?R(.7):n<=1280?R(1):n<=1920?R(2):De,Be="av1",Ie=n=>K(n,Be),Fe=.6,z=(n,e)=>Ie(e)?n*Fe:n,ke=n=>z(Y,n),Q=(n,e)=>{const t=we(n);return z(t,e)},Ue=1,J=({videoTrack:n,targetSize:e,codec:t})=>{const s=n.getSettings(),r=s.width,i=s.height,c=r/e.width,a=i/e.height,u=Math.max(c,a,Ue),g=Q(e.width,t);return{scaleResolutionDownBy:u,maxBitrate:g}},Z=oe.createStackPromises(),Ve=async()=>Z().catch(n=>{o.logger("videoSendingBalancer: error",n)}),Le=async n=>(Z.add(n),Ve()),q=async({sender:n,scaleResolutionDownBy:e,maxBitrate:t,onSetParameters:s})=>Le(async()=>o.setEncodingsToSender(n,{scaleResolutionDownBy:e,maxBitrate:t},s)),xe=async({sender:n,codec:e},t)=>{const r=ke(e);return q({sender:n,maxBitrate:r,onSetParameters:t,scaleResolutionDownBy:200})},L=async({sender:n,videoTrack:e,codec:t},s)=>{const c=e.getSettings().width,a=Q(c,t);return q({sender:n,maxBitrate:a,onSetParameters:s,scaleResolutionDownBy:1})},$e=async({sender:n,videoTrack:e,resolution:t,codec:s},r)=>{const[i,c]=t.split("x"),{maxBitrate:a,scaleResolutionDownBy:u}=J({videoTrack:e,codec:s,targetSize:{width:Number(i),height:Number(c)}});return q({sender:n,maxBitrate:a,onSetParameters:r,scaleResolutionDownBy:u})},qe=async({mainCam:n,resolutionMainCam:e,sender:t,videoTrack:s,codec:r},i)=>{switch(n){case o.EEventsMainCAM.PAUSE_MAIN_CAM:return xe({sender:t,codec:r},i);case o.EEventsMainCAM.RESUME_MAIN_CAM:return L({sender:t,videoTrack:s,codec:r},i);case o.EEventsMainCAM.MAX_MAIN_CAM_RESOLUTION:return e!==void 0?$e({sender:t,videoTrack:s,codec:r,resolution:e},i):L({sender:t,videoTrack:s,codec:r},i);default:return L({sender:t,videoTrack:s,codec:r},i)}},H={isChanged:!1,parameters:{encodings:[{}],transactionId:"0",codecs:[],headerExtensions:[],rtcp:{}}},X=async({mainCam:n,resolutionMainCam:e,connection:t,onSetParameters:s,ignoreForCodec:r})=>{const i=t.getSenders(),c=Ne(i);if(!(c!=null&&c.track))return H;const a=await G(c);return K(a,r)?H:qe({mainCam:n,resolutionMainCam:e,sender:c,codec:a,videoTrack:c.track},s)},He=(n,{ignoreForCodec:e,onSetParameters:t}={})=>{const s=async()=>{const{connection:u}=n;if(!u)throw new Error("connection is not exist");return X({connection:u,onSetParameters:t,ignoreForCodec:e})};let r=s;const i=async u=>(r=async()=>{const{mainCam:g,resolutionMainCam:C}=u,{connection:S}=n;if(!S)throw new Error("connection is not exist");return X({mainCam:g,resolutionMainCam:C,connection:S,onSetParameters:t,ignoreForCodec:e})},r());return{subscribe:()=>{n.onSession("main-cam-control",i)},unsubscribe:()=>{n.offSession("main-cam-control",i)},balanceByTrack:s,resetMainCamControl(){r=s},async reBalance(){return r()}}},Xe=n=>n.getVideoTracks()[0],D=({mediaStream:n,simulcastEncodings:e,sendEncodings:t})=>{if(e&&e.length>0){const s=t??[],r=Xe(n);return e.forEach((i,c)=>{const a=s[c]??{};a.active=!0,i.rid!==void 0&&(a.rid=i.rid),i.scalabilityMode!==void 0&&(a.scalabilityMode=i.scalabilityMode);const{maxBitrate:u,scaleResolutionDownBy:g}=J({videoTrack:r,targetSize:{width:i.width,height:i.height}});a.maxBitrate=u,a.scaleResolutionDownBy=g,s[c]=a}),s}return t},je=(n,e)=>[...n,...e].filter((r,i,c)=>i===c.findIndex(a=>a.clockRate===r.clockRate&&a.mimeType===r.mimeType&&a.channels===r.channels&&a.sdpFmtpLine===r.sdpFmtpLine)),We=n=>{const e=RTCRtpSender.getCapabilities(n),t=RTCRtpReceiver.getCapabilities(n),s=e===null?[]:e.codecs,r=t===null?[]:t.codecs;return je(s,r)},Ge=(n,e)=>e===void 0||e.length===0?n:n.sort((t,s)=>{const r=e.indexOf(t.mimeType),i=e.indexOf(s.mimeType),c=r===-1?Number.MAX_VALUE:r,a=i===-1?Number.MAX_VALUE:i;return c-a}),Ke=(n,e)=>e===void 0||e.length===0?n:n.filter(t=>!e.includes(t.mimeType)),w=(n,{preferredMimeTypesVideoCodecs:e,excludeMimeTypesVideoCodecs:t})=>async s=>{var r;if(typeof s.setCodecPreferences=="function"&&((r=s.sender.track)==null?void 0:r.kind)==="video"&&(e!==void 0&&(e==null?void 0:e.length)>0||t!==void 0&&(t==null?void 0:t.length)>0)){const i=We("video"),c=Ke(i,t),a=Ge(c,e);s.setCodecPreferences(a)}Object.keys(n).length>0&&await o.setParametersToSender(s.sender,n)},x=n=>{if(!re.isCanceledError(n)&&!ie.hasCanceledError(n))throw n;return{isSuccessful:!1}},Ye=({kind:n,readyState:e})=>n==="video"&&e==="live";class ze{constructor(e,{preferredMimeTypesVideoCodecs:t,excludeMimeTypesVideoCodecs:s}={}){l(this,"sipConnector");l(this,"preferredMimeTypesVideoCodecs");l(this,"excludeMimeTypesVideoCodecs");l(this,"on");l(this,"once");l(this,"onceRace");l(this,"wait");l(this,"off");l(this,"onSession");l(this,"onceSession");l(this,"onceRaceSession");l(this,"waitSession");l(this,"offSession");l(this,"sendDTMF");l(this,"hangUp");l(this,"declineToIncomingCall");l(this,"isConfigured");l(this,"sendChannels");l(this,"checkTelephony");l(this,"waitChannels");l(this,"ping");l(this,"connectToServer",async e=>{const{userAgent:t,sipWebSocketServerURL:s,sipServerUrl:r,remoteAddress:i,displayName:c,name:a,password:u,isRegisteredUser:g,isDisconnectOnFail:C}=e;return o.logger("connectToServer",e),this.sipConnector.connect({userAgent:t,sipWebSocketServerURL:s,sipServerUrl:r,remoteAddress:i,displayName:c,password:u,user:a,register:g}).then(S=>(o.logger("connectToServer then"),{ua:S,isSuccessful:!0})).catch(async S=>(o.logger("connectToServer catch: error",S),C===!0?this.sipConnector.disconnect().then(()=>x(S)).catch(()=>x(S)):x(S)))});l(this,"callToServer",async e=>{const{conference:t,mediaStream:s,extraHeaders:r,iceServers:i,contentHint:c,simulcastEncodings:a,degradationPreference:u,sendEncodings:g,offerToReceiveAudio:C,offerToReceiveVideo:S,directionVideo:I,directionAudio:F,setRemoteStreams:h,onBeforeProgressCall:p,onSuccessProgressCall:f,onEnterPurgatory:m,onEnterConference:E,onFailProgressCall:y,onFinishProgressCall:T,onEndedCall:b}=e,_=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:h}),v=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:_}),O=w({degradationPreference:u},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});o.logger("callToServer",e);const N=async()=>(o.logger("startCall"),this.sipConnector.call({mediaStream:s,extraHeaders:r,iceServers:i,contentHint:c,offerToReceiveAudio:C,offerToReceiveVideo:S,directionVideo:I,directionAudio:F,sendEncodings:D({mediaStream:s,simulcastEncodings:a,sendEncodings:g}),number:t,onAddedTransceiver:O,ontrack:v}));let M=!1,A;const P=(o.logger("subscribeEnterConference: onEnterConference",E),m??E?this.sipConnector.onSession("enterRoom",({room:d})=>{o.logger("enterRoom",{_room:d,isSuccessProgressCall:M}),A=d,B(A)?m&&m():E&&E({isSuccessProgressCall:M})}):()=>{}),k=d=>(o.logger("onSuccess"),M=!0,_(),f&&f({isPurgatory:B(A)}),this.sipConnector.onceRaceSession(["ended","failed"],()=>{P(),b&&b()}),d),U=d=>{throw o.logger("onFail"),y&&y(),P(),d},V=()=>{o.logger("onFinish"),T&&T()};return o.logger("onBeforeProgressCall"),p&&p(t),N().then(k).catch(d=>U(d)).finally(V)});l(this,"disconnectFromServer",async()=>this.sipConnector.disconnect().then(()=>(o.logger("disconnectFromServer: then"),{isSuccessful:!0})).catch(e=>(o.logger("disconnectFromServer: catch",e),{isSuccessful:!1})));l(this,"answerIncomingCall",async e=>{const{mediaStream:t,extraHeaders:s,iceServers:r,contentHint:i,simulcastEncodings:c,degradationPreference:a,sendEncodings:u,offerToReceiveAudio:g,offerToReceiveVideo:C,directionVideo:S,directionAudio:I,setRemoteStreams:F,onBeforeProgressCall:h,onSuccessProgressCall:p,onEnterPurgatory:f,onEnterConference:m,onFailProgressCall:E,onFinishProgressCall:y,onEndedCall:T}=e,b=this.resolveHandleReadyRemoteStreamsDebounced({onReadyRemoteStreams:F}),_=this.resolveHandleReadyRemoteStreams({onReadyRemoteStreams:b}),v=w({degradationPreference:a},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});o.logger("answerIncomingCall",e);const O=async()=>this.sipConnector.answerToIncomingCall({mediaStream:t,extraHeaders:s,iceServers:r,contentHint:i,offerToReceiveAudio:g,offerToReceiveVideo:C,directionVideo:S,directionAudio:I,sendEncodings:D({mediaStream:t,simulcastEncodings:c,sendEncodings:u}),onAddedTransceiver:v,ontrack:_}),N=()=>{const{remoteCallerData:d}=this.sipConnector;return d.incomingNumber};let M=!1,A;const P=(o.logger("subscribeEnterConference: onEnterConference",m),f??m?this.sipConnector.onSession("enterRoom",d=>{o.logger("enterRoom",{_room:d,isSuccessProgressCall:M}),A=d,B(A)?f&&f():m&&m({isSuccessProgressCall:M})}):()=>{}),k=d=>(o.logger("onSuccess"),M=!0,b(),p&&p({isPurgatory:B(A)}),this.sipConnector.onceRaceSession(["ended","failed"],()=>{P(),T&&T()}),d),U=d=>{throw o.logger("onFail"),E&&E(),P(),d},V=()=>{o.logger("onFinish"),y&&y()};if(o.logger("onBeforeProgressCall"),h){const d=N();h(d)}return O().then(k).catch(d=>U(d)).finally(V)});l(this,"updatePresentation",async({mediaStream:e,isP2P:t,maxBitrate:s,contentHint:r,simulcastEncodings:i,degradationPreference:c,sendEncodings:a,preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g})=>{const C=w({degradationPreference:c},{preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g});return o.logger("updatePresentation"),this.sipConnector.updatePresentation(e,{isP2P:t,maxBitrate:s,contentHint:r,sendEncodings:D({mediaStream:e,simulcastEncodings:i,sendEncodings:a}),onAddedTransceiver:C})});l(this,"startPresentation",async({mediaStream:e,isP2P:t,maxBitrate:s,contentHint:r,simulcastEncodings:i,degradationPreference:c,sendEncodings:a,preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g},C)=>{const S=w({degradationPreference:c},{preferredMimeTypesVideoCodecs:u,excludeMimeTypesVideoCodecs:g});return o.logger("startPresentation"),this.sipConnector.startPresentation(e,{isP2P:t,maxBitrate:s,contentHint:r,sendEncodings:D({mediaStream:e,simulcastEncodings:i,sendEncodings:a}),onAddedTransceiver:S},C)});l(this,"stopShareSipConnector",async({isP2P:e=!1}={})=>(o.logger("stopShareSipConnector"),this.sipConnector.stopPresentation({isP2P:e}).catch(t=>{o.logger(t)})));l(this,"sendRefusalToTurnOnMic",async()=>{if(this.sipConnector.isCallActive)return o.logger("sendRefusalToTurnOnMic"),this.sipConnector.sendRefusalToTurnOnMic().catch(e=>{o.logger("sendRefusalToTurnOnMic: error",e)})});l(this,"sendRefusalToTurnOnCam",async()=>{if(this.sipConnector.isCallActive)return o.logger("sendRefusalToTurnOnCam"),this.sipConnector.sendRefusalToTurnOnCam().catch(e=>{o.logger("sendRefusalToTurnOnCam: error",e)})});l(this,"sendMediaState",async({isEnabledCam:e,isEnabledMic:t})=>{if(this.sipConnector.isCallActive)return o.logger("sendMediaState"),this.sipConnector.sendMediaState({cam:e,mic:t})});l(this,"replaceMediaStream",async(e,{deleteExisting:t,addMissing:s,forceRenegotiation:r,contentHint:i,simulcastEncodings:c,degradationPreference:a,sendEncodings:u}={})=>{const g=w({degradationPreference:a},{preferredMimeTypesVideoCodecs:this.preferredMimeTypesVideoCodecs,excludeMimeTypesVideoCodecs:this.excludeMimeTypesVideoCodecs});return o.logger("replaceMediaStream"),this.sipConnector.replaceMediaStream(e,{deleteExisting:t,addMissing:s,forceRenegotiation:r,contentHint:i,sendEncodings:D({mediaStream:e,simulcastEncodings:c,sendEncodings:u}),onAddedTransceiver:g})});l(this,"askPermissionToEnableCam",async()=>{if(this.sipConnector.isCallActive)return o.logger("askPermissionToEnableCam"),this.sipConnector.askPermissionToEnableCam()});l(this,"resolveHandleReadyRemoteStreamsDebounced",({onReadyRemoteStreams:e})=>ce.debounce(()=>{const t=this.sipConnector.getRemoteStreams();o.logger("remoteStreams",t),t&&e(t)},200));l(this,"resolveHandleReadyRemoteStreams",({onReadyRemoteStreams:e})=>({track:t})=>{Ye(t)&&e()});l(this,"getRemoteStreams",()=>(o.logger("getRemoteStreams"),this.sipConnector.getRemoteStreams()));l(this,"onUseLicense",e=>(o.logger("onUseLicense"),this.sipConnector.onSession("useLicense",e)));l(this,"onMustStopPresentation",e=>(o.logger("onMustStopPresentation"),this.sipConnector.onSession("mustStopPresentation",e)));l(this,"onMoveToSpectators",e=>(o.logger("onMoveToSpectators"),this.sipConnector.onSession(o.PARTICIPANT_MOVE_REQUEST_TO_SPECTATORS,e)));l(this,"onMoveToParticipants",e=>(o.logger("onMoveToParticipants"),this.sipConnector.onSession(o.PARTICIPANT_MOVE_REQUEST_TO_PARTICIPANTS,e)));this.preferredMimeTypesVideoCodecs=t,this.excludeMimeTypesVideoCodecs=s,this.sipConnector=e,this.on=this.sipConnector.on.bind(e),this.once=this.sipConnector.once.bind(e),this.onceRace=this.sipConnector.onceRace.bind(e),this.wait=this.sipConnector.wait.bind(e),this.off=this.sipConnector.off.bind(e),this.onSession=this.sipConnector.onSession.bind(e),this.onceSession=this.sipConnector.onceSession.bind(e),this.onceRaceSession=this.sipConnector.onceRaceSession.bind(e),this.waitSession=this.sipConnector.waitSession.bind(e),this.offSession=this.sipConnector.offSession.bind(e),this.sendDTMF=this.sipConnector.sendDTMF.bind(e),this.hangUp=this.sipConnector.hangUp.bind(e),this.declineToIncomingCall=this.sipConnector.declineToIncomingCall.bind(e),this.isConfigured=this.sipConnector.isConfigured.bind(e),this.sendChannels=this.sipConnector.sendChannels.bind(e),this.checkTelephony=this.sipConnector.checkTelephony.bind(e),this.waitChannels=this.sipConnector.waitChannels.bind(e),this.ping=this.sipConnector.ping.bind(e)}get isRegistered(){return this.sipConnector.isRegistered}}exports.EEventsMainCAM=o.EEventsMainCAM;exports.EEventsMic=o.EEventsMic;exports.EEventsSyncMediaState=o.EEventsSyncMediaState;exports.EMimeTypesVideoCodecs=o.EMimeTypesVideoCodecs;exports.EUseLicense=o.EUseLicense;exports.causes=o.causes;exports.constants=o.constants;exports.default=o.SipConnector;exports.disableDebug=o.disableDebug;exports.enableDebug=o.enableDebug;exports.eventNames=o.eventNames;exports.hasCanceledCallError=o.hasCanceledCallError;exports.setParametersToSender=o.setParametersToSender;exports.debug=ae;exports.SipConnectorFacade=ze;exports.getCodecFromSender=G;exports.resolveVideoSendingBalancer=He;exports.tools=_e;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var se = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { B as G, N as K, l as a, E as L, s as
|
|
5
|
-
import { i as Cn, j as fn, m as
|
|
2
|
+
var oe = (n, e, t) => e in n ? se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var u = (n, e, t) => oe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { B as G, N as K, l as a, E as L, s as re, a as ie, P as ce, b as ae, S as tn } from "./SipConnector-B4xLnl6L.js";
|
|
5
|
+
import { i as Cn, j as fn, m as mn, k as Rn, c as gn, d as pn, f as yn, g as Tn, e as En, h as bn } from "./SipConnector-B4xLnl6L.js";
|
|
6
6
|
import { sequentPromises as ue } from "sequent-promises";
|
|
7
|
-
import { createStackPromises as
|
|
8
|
-
import { isCanceledError as
|
|
7
|
+
import { createStackPromises as de } from "stack-promises";
|
|
8
|
+
import { isCanceledError as le } from "@krivega/cancelable-promise";
|
|
9
9
|
import { hasCanceledError as Se } from "repeated-calls";
|
|
10
|
-
import { debounce as
|
|
10
|
+
import { debounce as he } from "ts-debounce";
|
|
11
11
|
import { default as An } from "debug";
|
|
12
12
|
const H = (n) => {
|
|
13
13
|
const { url: e, cause: t } = n;
|
|
@@ -16,7 +16,7 @@ const H = (n) => {
|
|
|
16
16
|
};
|
|
17
17
|
var q = /* @__PURE__ */ ((n) => (n.CONNECT_SERVER_FAILED = "CONNECT_SERVER_FAILED", n.WRONG_USER_OR_PASSWORD = "WRONG_USER_OR_PASSWORD", n.BAD_MEDIA_ERROR = "BAD_MEDIA_ERROR", n.NOT_FOUND_ERROR = "NOT_FOUND_ERROR", n.WS_CONNECTION_FAILED = "WS_CONNECTION_FAILED", n.CONNECT_SERVER_FAILED_BY_LINK = "CONNECT_SERVER_FAILED_BY_LINK", n))(q || {});
|
|
18
18
|
const Ce = (n = new Error()) => {
|
|
19
|
-
var
|
|
19
|
+
var o;
|
|
20
20
|
const { cause: e, socket: t } = n;
|
|
21
21
|
let s = "CONNECT_SERVER_FAILED";
|
|
22
22
|
switch (e) {
|
|
@@ -33,7 +33,7 @@ const Ce = (n = new Error()) => {
|
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
default:
|
|
36
|
-
t && ((
|
|
36
|
+
t && ((o = t == null ? void 0 : t._ws) == null ? void 0 : o.readyState) === 3 ? s = "WS_CONNECTION_FAILED" : H(n) && (s = "CONNECT_SERVER_FAILED_BY_LINK");
|
|
37
37
|
}
|
|
38
38
|
return s;
|
|
39
39
|
}, fe = (n) => {
|
|
@@ -44,70 +44,70 @@ const Ce = (n = new Error()) => {
|
|
|
44
44
|
a("failed to stringify message", t);
|
|
45
45
|
}
|
|
46
46
|
return e;
|
|
47
|
-
},
|
|
48
|
-
const { code: e, cause: t, message: s } = n,
|
|
49
|
-
return typeof s == "object" && s !== null ?
|
|
47
|
+
}, me = (n = new Error()) => {
|
|
48
|
+
const { code: e, cause: t, message: s } = n, o = H(n), r = { code: "", cause: "", message: "" };
|
|
49
|
+
return typeof s == "object" && s !== null ? r.message = fe(s) : s && (r.message = String(s)), o && (r.link = o), e && (r.code = e), t && (r.cause = t), r;
|
|
50
50
|
}, Re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51
51
|
__proto__: null,
|
|
52
52
|
EErrorTypes: q,
|
|
53
53
|
getLinkError: H,
|
|
54
54
|
getTypeFromError: Ce,
|
|
55
|
-
getValuesFromError:
|
|
55
|
+
getValuesFromError: me
|
|
56
56
|
}, Symbol.toStringTag, { value: "Module" })), ge = ({
|
|
57
57
|
sessionId: n,
|
|
58
58
|
remoteAddress: e,
|
|
59
59
|
isMutedAudio: t,
|
|
60
60
|
isMutedVideo: s,
|
|
61
|
-
isRegistered:
|
|
62
|
-
isPresentationCall:
|
|
61
|
+
isRegistered: o,
|
|
62
|
+
isPresentationCall: r
|
|
63
63
|
}) => {
|
|
64
|
-
const i = [], c = t ? "0" : "1",
|
|
65
|
-
return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${
|
|
66
|
-
}, pe = "[@*!|]", ye = "_",
|
|
64
|
+
const i = [], c = t ? "0" : "1", d = s ? "0" : "1";
|
|
65
|
+
return i.push(`X-Vinteo-Mic-State: ${c}`, `X-Vinteo-MainCam-State: ${d}`), o || i.push("X-Vinteo-Purgatory-Call: yes"), n && i.push(`X-Vinteo-Session: ${n}`), r && i.push("X-Vinteo-Presentation-Call: yes"), e && i.push(`X-Vinteo-Remote: ${e}`), i;
|
|
66
|
+
}, pe = "[@*!|]", ye = "_", Te = (n) => {
|
|
67
67
|
let e = n;
|
|
68
68
|
return e = e.replaceAll(new RegExp(pe, "g"), ye), e;
|
|
69
|
-
},
|
|
69
|
+
}, Ee = ({
|
|
70
70
|
appName: n,
|
|
71
71
|
appVersion: e,
|
|
72
72
|
browserName: t,
|
|
73
73
|
browserVersion: s
|
|
74
74
|
}) => {
|
|
75
|
-
const
|
|
76
|
-
return `ChromeNew - ${t ? `${t} ${s}, ${
|
|
75
|
+
const r = `${Te(n)} ${e}`;
|
|
76
|
+
return `ChromeNew - ${t ? `${t} ${s}, ${r}` : r}`;
|
|
77
77
|
}, be = ({
|
|
78
78
|
isUnifiedSdpSemantic: n,
|
|
79
79
|
appVersion: e,
|
|
80
80
|
browserName: t,
|
|
81
81
|
browserVersion: s,
|
|
82
|
-
appName:
|
|
83
|
-
}) => n ?
|
|
82
|
+
appName: o
|
|
83
|
+
}) => n ? Ee({ appVersion: e, browserName: t, browserVersion: s, appName: o }) : "Chrome", Y = "purgatory", D = (n) => n === Y, Me = (n) => (e) => [...e].map((s) => async () => n(s)), Ae = async ({
|
|
84
84
|
accumulatedKeys: n,
|
|
85
85
|
sendKey: e,
|
|
86
86
|
canRunTask: t
|
|
87
87
|
}) => {
|
|
88
|
-
const
|
|
89
|
-
return ue(
|
|
90
|
-
}, _e = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)),
|
|
91
|
-
const e = (f, p) => ({ isSyncForced:
|
|
92
|
-
if (
|
|
88
|
+
const o = Me(e)(n);
|
|
89
|
+
return ue(o, t);
|
|
90
|
+
}, _e = (n) => (t) => (a("onStartMainCam"), n.onSession("admin-start-main-cam", t)), ve = (n) => (t) => (a("onStartMic"), n.onSession("admin-start-mic", t)), Oe = (n) => (t) => (a("onStopMainCam"), n.onSession("admin-stop-main-cam", t)), Ne = (n) => (t) => (a("onStopMic"), n.onSession("admin-stop-mic", t)), we = ({ sipConnector: n }) => {
|
|
91
|
+
const e = (f, p) => ({ isSyncForced: m = !1 }) => {
|
|
92
|
+
if (m) {
|
|
93
93
|
f();
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
p();
|
|
97
|
-
}, t = _e(n), s = Oe(n),
|
|
97
|
+
}, t = _e(n), s = Oe(n), o = ve(n), r = Ne(n);
|
|
98
98
|
let i = () => {
|
|
99
99
|
}, c = () => {
|
|
100
|
-
},
|
|
100
|
+
}, d = () => {
|
|
101
101
|
}, S = () => {
|
|
102
102
|
};
|
|
103
103
|
const C = ({
|
|
104
104
|
onStartMainCamForced: f,
|
|
105
105
|
onStartMainCamNotForced: p,
|
|
106
|
-
onStopMainCamForced:
|
|
106
|
+
onStopMainCamForced: m,
|
|
107
107
|
onStopMainCamNotForced: R,
|
|
108
108
|
onStartMicForced: y,
|
|
109
|
-
onStartMicNotForced:
|
|
110
|
-
onStopMicForced:
|
|
109
|
+
onStartMicNotForced: T,
|
|
110
|
+
onStopMicForced: E,
|
|
111
111
|
onStopMicNotForced: b
|
|
112
112
|
}) => {
|
|
113
113
|
const _ = e(
|
|
@@ -116,36 +116,36 @@ const Ce = (n = new Error()) => {
|
|
|
116
116
|
);
|
|
117
117
|
i = t(_);
|
|
118
118
|
const v = e(
|
|
119
|
-
|
|
119
|
+
m,
|
|
120
120
|
R
|
|
121
121
|
);
|
|
122
122
|
c = s(v);
|
|
123
|
-
const O = e(y,
|
|
124
|
-
|
|
125
|
-
const N = e(
|
|
126
|
-
S =
|
|
127
|
-
},
|
|
128
|
-
i(), c(),
|
|
123
|
+
const O = e(y, T);
|
|
124
|
+
d = o(O);
|
|
125
|
+
const N = e(E, b);
|
|
126
|
+
S = r(N);
|
|
127
|
+
}, h = () => {
|
|
128
|
+
i(), c(), d(), S();
|
|
129
129
|
};
|
|
130
130
|
return {
|
|
131
131
|
start: (f) => {
|
|
132
132
|
C(f);
|
|
133
133
|
},
|
|
134
134
|
stop: () => {
|
|
135
|
-
|
|
135
|
+
h();
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
}, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
139
139
|
__proto__: null,
|
|
140
140
|
PURGATORY_CONFERENCE_NUMBER: Y,
|
|
141
|
-
createSyncMediaState:
|
|
141
|
+
createSyncMediaState: we,
|
|
142
142
|
error: Re,
|
|
143
143
|
getExtraHeaders: ge,
|
|
144
144
|
getUserAgent: be,
|
|
145
145
|
hasPurgatory: D,
|
|
146
146
|
sendDTMFAccumulated: Ae
|
|
147
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
148
|
-
const t =
|
|
147
|
+
}, Symbol.toStringTag, { value: "Module" })), Be = (n) => [...n.keys()].map((e) => n.get(e)), Pe = (n, e) => Be(n).find((t) => t.type === e), De = async (n) => n.getStats().then((e) => {
|
|
148
|
+
const t = Pe(e, "codec");
|
|
149
149
|
return t == null ? void 0 : t.mimeType;
|
|
150
150
|
}), Ie = (n) => n.find((e) => {
|
|
151
151
|
var t;
|
|
@@ -158,20 +158,20 @@ const Ce = (n = new Error()) => {
|
|
|
158
158
|
targetSize: e,
|
|
159
159
|
codec: t
|
|
160
160
|
}) => {
|
|
161
|
-
const s = n.getSettings(),
|
|
162
|
-
return { scaleResolutionDownBy:
|
|
163
|
-
}, ne =
|
|
161
|
+
const s = n.getSettings(), o = s.width, r = s.height, i = o / e.width, c = r / e.height, d = Math.max(i, c, He), S = Z(e.width, t);
|
|
162
|
+
return { scaleResolutionDownBy: d, maxBitrate: S };
|
|
163
|
+
}, ne = de(), Xe = async () => ne().catch((n) => {
|
|
164
164
|
a("videoSendingBalancer: error", n);
|
|
165
165
|
}), je = async (n) => (ne.add(n), Xe()), X = async ({
|
|
166
166
|
sender: n,
|
|
167
167
|
scaleResolutionDownBy: e,
|
|
168
168
|
maxBitrate: t,
|
|
169
169
|
onSetParameters: s
|
|
170
|
-
}) => je(async () =>
|
|
171
|
-
const
|
|
170
|
+
}) => je(async () => re(n, { scaleResolutionDownBy: e, maxBitrate: t }, s)), We = async ({ sender: n, codec: e }, t) => {
|
|
171
|
+
const o = $e(e);
|
|
172
172
|
return X({
|
|
173
173
|
sender: n,
|
|
174
|
-
maxBitrate:
|
|
174
|
+
maxBitrate: o,
|
|
175
175
|
onSetParameters: t,
|
|
176
176
|
scaleResolutionDownBy: 200
|
|
177
177
|
});
|
|
@@ -192,40 +192,40 @@ const Ce = (n = new Error()) => {
|
|
|
192
192
|
videoTrack: e,
|
|
193
193
|
resolution: t,
|
|
194
194
|
codec: s
|
|
195
|
-
},
|
|
196
|
-
const [
|
|
195
|
+
}, o) => {
|
|
196
|
+
const [r, i] = t.split("x"), { maxBitrate: c, scaleResolutionDownBy: d } = ee({
|
|
197
197
|
videoTrack: e,
|
|
198
198
|
codec: s,
|
|
199
199
|
targetSize: {
|
|
200
|
-
width: Number(
|
|
200
|
+
width: Number(r),
|
|
201
201
|
height: Number(i)
|
|
202
202
|
}
|
|
203
203
|
});
|
|
204
204
|
return X({
|
|
205
205
|
sender: n,
|
|
206
206
|
maxBitrate: c,
|
|
207
|
-
onSetParameters:
|
|
208
|
-
scaleResolutionDownBy:
|
|
207
|
+
onSetParameters: o,
|
|
208
|
+
scaleResolutionDownBy: d
|
|
209
209
|
});
|
|
210
210
|
}, Ke = async ({
|
|
211
211
|
mainCam: n,
|
|
212
212
|
resolutionMainCam: e,
|
|
213
213
|
sender: t,
|
|
214
214
|
videoTrack: s,
|
|
215
|
-
codec:
|
|
216
|
-
},
|
|
215
|
+
codec: o
|
|
216
|
+
}, r) => {
|
|
217
217
|
switch (n) {
|
|
218
218
|
case L.PAUSE_MAIN_CAM:
|
|
219
|
-
return We({ sender: t, codec:
|
|
219
|
+
return We({ sender: t, codec: o }, r);
|
|
220
220
|
case L.RESUME_MAIN_CAM:
|
|
221
|
-
return x({ sender: t, videoTrack: s, codec:
|
|
221
|
+
return x({ sender: t, videoTrack: s, codec: o }, r);
|
|
222
222
|
case L.MAX_MAIN_CAM_RESOLUTION:
|
|
223
223
|
return e !== void 0 ? Ge(
|
|
224
|
-
{ sender: t, videoTrack: s, codec:
|
|
225
|
-
|
|
226
|
-
) : x({ sender: t, videoTrack: s, codec:
|
|
224
|
+
{ sender: t, videoTrack: s, codec: o, resolution: e },
|
|
225
|
+
r
|
|
226
|
+
) : x({ sender: t, videoTrack: s, codec: o }, r);
|
|
227
227
|
default:
|
|
228
|
-
return x({ sender: t, videoTrack: s, codec:
|
|
228
|
+
return x({ sender: t, videoTrack: s, codec: o }, r);
|
|
229
229
|
}
|
|
230
230
|
}, j = {
|
|
231
231
|
isChanged: !1,
|
|
@@ -241,13 +241,13 @@ const Ce = (n = new Error()) => {
|
|
|
241
241
|
resolutionMainCam: e,
|
|
242
242
|
connection: t,
|
|
243
243
|
onSetParameters: s,
|
|
244
|
-
ignoreForCodec:
|
|
244
|
+
ignoreForCodec: o
|
|
245
245
|
}) => {
|
|
246
|
-
const
|
|
246
|
+
const r = t.getSenders(), i = Ie(r);
|
|
247
247
|
if (!(i != null && i.track))
|
|
248
248
|
return j;
|
|
249
249
|
const c = await De(i);
|
|
250
|
-
return z(c,
|
|
250
|
+
return z(c, o) ? j : Ke(
|
|
251
251
|
{
|
|
252
252
|
mainCam: n,
|
|
253
253
|
resolutionMainCam: e,
|
|
@@ -257,150 +257,168 @@ const Ce = (n = new Error()) => {
|
|
|
257
257
|
},
|
|
258
258
|
s
|
|
259
259
|
);
|
|
260
|
-
},
|
|
260
|
+
}, dn = (n, {
|
|
261
261
|
ignoreForCodec: e,
|
|
262
262
|
onSetParameters: t
|
|
263
263
|
} = {}) => {
|
|
264
264
|
const s = async () => {
|
|
265
|
-
const { connection:
|
|
266
|
-
if (!
|
|
265
|
+
const { connection: d } = n;
|
|
266
|
+
if (!d)
|
|
267
267
|
throw new Error("connection is not exist");
|
|
268
268
|
return W({
|
|
269
|
-
connection:
|
|
269
|
+
connection: d,
|
|
270
270
|
onSetParameters: t,
|
|
271
271
|
ignoreForCodec: e
|
|
272
272
|
});
|
|
273
273
|
};
|
|
274
|
-
let
|
|
275
|
-
const
|
|
276
|
-
const { mainCam: S, resolutionMainCam: C } =
|
|
277
|
-
if (!
|
|
274
|
+
let o = s;
|
|
275
|
+
const r = async (d) => (o = async () => {
|
|
276
|
+
const { mainCam: S, resolutionMainCam: C } = d, { connection: h } = n;
|
|
277
|
+
if (!h)
|
|
278
278
|
throw new Error("connection is not exist");
|
|
279
279
|
return W({
|
|
280
280
|
mainCam: S,
|
|
281
281
|
resolutionMainCam: C,
|
|
282
|
-
connection:
|
|
282
|
+
connection: h,
|
|
283
283
|
onSetParameters: t,
|
|
284
284
|
ignoreForCodec: e
|
|
285
285
|
});
|
|
286
|
-
},
|
|
286
|
+
}, o());
|
|
287
287
|
return {
|
|
288
288
|
subscribe: () => {
|
|
289
|
-
n.onSession("main-cam-control",
|
|
289
|
+
n.onSession("main-cam-control", r);
|
|
290
290
|
},
|
|
291
291
|
unsubscribe: () => {
|
|
292
|
-
n.offSession("main-cam-control",
|
|
292
|
+
n.offSession("main-cam-control", r);
|
|
293
293
|
},
|
|
294
294
|
balanceByTrack: s,
|
|
295
295
|
resetMainCamControl() {
|
|
296
|
-
|
|
296
|
+
o = s;
|
|
297
297
|
},
|
|
298
298
|
async reBalance() {
|
|
299
|
-
return
|
|
299
|
+
return o();
|
|
300
300
|
}
|
|
301
301
|
};
|
|
302
|
-
}, qe = (n) => n.getVideoTracks()[0],
|
|
302
|
+
}, qe = (n) => n.getVideoTracks()[0], B = ({
|
|
303
303
|
mediaStream: n,
|
|
304
304
|
simulcastEncodings: e,
|
|
305
305
|
sendEncodings: t
|
|
306
306
|
}) => {
|
|
307
307
|
if (e && e.length > 0) {
|
|
308
|
-
const s = t ?? [],
|
|
309
|
-
return e.forEach((
|
|
308
|
+
const s = t ?? [], o = qe(n);
|
|
309
|
+
return e.forEach((r, i) => {
|
|
310
310
|
const c = s[i] ?? {};
|
|
311
|
-
c.active = !0,
|
|
312
|
-
const { maxBitrate:
|
|
313
|
-
videoTrack:
|
|
311
|
+
c.active = !0, r.rid !== void 0 && (c.rid = r.rid), r.scalabilityMode !== void 0 && (c.scalabilityMode = r.scalabilityMode);
|
|
312
|
+
const { maxBitrate: d, scaleResolutionDownBy: S } = ee({
|
|
313
|
+
videoTrack: o,
|
|
314
314
|
targetSize: {
|
|
315
|
-
width:
|
|
316
|
-
height:
|
|
315
|
+
width: r.width,
|
|
316
|
+
height: r.height
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
|
-
c.maxBitrate =
|
|
319
|
+
c.maxBitrate = d, c.scaleResolutionDownBy = S, s[i] = c;
|
|
320
320
|
}), s;
|
|
321
321
|
}
|
|
322
322
|
return t;
|
|
323
|
-
}, Ye = (n, e) => [...n, ...e].filter((
|
|
324
|
-
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs,
|
|
325
|
-
return Ye(s,
|
|
323
|
+
}, Ye = (n, e) => [...n, ...e].filter((o, r, i) => r === i.findIndex((c) => c.clockRate === o.clockRate && c.mimeType === o.mimeType && c.channels === o.channels && c.sdpFmtpLine === o.sdpFmtpLine)), ze = (n) => {
|
|
324
|
+
const e = RTCRtpSender.getCapabilities(n), t = RTCRtpReceiver.getCapabilities(n), s = e === null ? [] : e.codecs, o = t === null ? [] : t.codecs;
|
|
325
|
+
return Ye(s, o);
|
|
326
326
|
}, Qe = (n, e) => e === void 0 || e.length === 0 ? n : n.sort((t, s) => {
|
|
327
|
-
const
|
|
327
|
+
const o = e.indexOf(t.mimeType), r = e.indexOf(s.mimeType), i = o === -1 ? Number.MAX_VALUE : o, c = r === -1 ? Number.MAX_VALUE : r;
|
|
328
328
|
return i - c;
|
|
329
|
-
}), Je = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)),
|
|
329
|
+
}), Je = (n, e) => e === void 0 || e.length === 0 ? n : n.filter((t) => !e.includes(t.mimeType)), P = (n, {
|
|
330
330
|
preferredMimeTypesVideoCodecs: e,
|
|
331
331
|
excludeMimeTypesVideoCodecs: t
|
|
332
332
|
}) => async (s) => {
|
|
333
|
-
var
|
|
334
|
-
if (typeof s.setCodecPreferences == "function" && ((
|
|
335
|
-
const
|
|
333
|
+
var o;
|
|
334
|
+
if (typeof s.setCodecPreferences == "function" && ((o = s.sender.track) == null ? void 0 : o.kind) === "video" && (e !== void 0 && (e == null ? void 0 : e.length) > 0 || t !== void 0 && (t == null ? void 0 : t.length) > 0)) {
|
|
335
|
+
const r = ze("video"), i = Je(r, t), c = Qe(i, e);
|
|
336
336
|
s.setCodecPreferences(c);
|
|
337
337
|
}
|
|
338
338
|
Object.keys(n).length > 0 && await ie(s.sender, n);
|
|
339
339
|
}, $ = (n) => {
|
|
340
|
-
if (!
|
|
340
|
+
if (!le(n) && !Se(n))
|
|
341
341
|
throw n;
|
|
342
342
|
return { isSuccessful: !1 };
|
|
343
343
|
}, Ze = ({ kind: n, readyState: e }) => n === "video" && e === "live";
|
|
344
|
-
class
|
|
344
|
+
class ln {
|
|
345
345
|
constructor(e, {
|
|
346
346
|
preferredMimeTypesVideoCodecs: t,
|
|
347
347
|
excludeMimeTypesVideoCodecs: s
|
|
348
348
|
} = {}) {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
349
|
+
u(this, "sipConnector");
|
|
350
|
+
u(this, "preferredMimeTypesVideoCodecs");
|
|
351
|
+
u(this, "excludeMimeTypesVideoCodecs");
|
|
352
|
+
u(this, "on");
|
|
353
|
+
u(this, "once");
|
|
354
|
+
u(this, "onceRace");
|
|
355
|
+
u(this, "wait");
|
|
356
|
+
u(this, "off");
|
|
357
|
+
u(this, "onSession");
|
|
358
|
+
u(this, "onceSession");
|
|
359
|
+
u(this, "onceRaceSession");
|
|
360
|
+
u(this, "waitSession");
|
|
361
|
+
u(this, "offSession");
|
|
362
|
+
u(this, "sendDTMF");
|
|
363
|
+
u(this, "hangUp");
|
|
364
|
+
u(this, "declineToIncomingCall");
|
|
365
|
+
u(this, "isConfigured");
|
|
366
|
+
u(this, "sendChannels");
|
|
367
|
+
u(this, "checkTelephony");
|
|
368
|
+
u(this, "waitChannels");
|
|
369
|
+
u(this, "ping");
|
|
370
|
+
u(this, "connectToServer", async (e) => {
|
|
353
371
|
const {
|
|
354
372
|
userAgent: t,
|
|
355
373
|
sipWebSocketServerURL: s,
|
|
356
|
-
sipServerUrl:
|
|
357
|
-
remoteAddress:
|
|
374
|
+
sipServerUrl: o,
|
|
375
|
+
remoteAddress: r,
|
|
358
376
|
displayName: i,
|
|
359
377
|
name: c,
|
|
360
|
-
password:
|
|
378
|
+
password: d,
|
|
361
379
|
isRegisteredUser: S,
|
|
362
380
|
isDisconnectOnFail: C
|
|
363
381
|
} = e;
|
|
364
382
|
return a("connectToServer", e), this.sipConnector.connect({
|
|
365
383
|
userAgent: t,
|
|
366
384
|
sipWebSocketServerURL: s,
|
|
367
|
-
sipServerUrl:
|
|
368
|
-
remoteAddress:
|
|
385
|
+
sipServerUrl: o,
|
|
386
|
+
remoteAddress: r,
|
|
369
387
|
displayName: i,
|
|
370
|
-
password:
|
|
388
|
+
password: d,
|
|
371
389
|
user: c,
|
|
372
390
|
register: S
|
|
373
|
-
}).then((
|
|
391
|
+
}).then((h) => (a("connectToServer then"), { ua: h, isSuccessful: !0 })).catch(async (h) => (a("connectToServer catch: error", h), C === !0 ? this.sipConnector.disconnect().then(() => $(h)).catch(() => $(h)) : $(h)));
|
|
374
392
|
});
|
|
375
|
-
|
|
393
|
+
u(this, "callToServer", async (e) => {
|
|
376
394
|
const {
|
|
377
395
|
conference: t,
|
|
378
396
|
mediaStream: s,
|
|
379
|
-
extraHeaders:
|
|
380
|
-
iceServers:
|
|
397
|
+
extraHeaders: o,
|
|
398
|
+
iceServers: r,
|
|
381
399
|
contentHint: i,
|
|
382
400
|
simulcastEncodings: c,
|
|
383
|
-
degradationPreference:
|
|
401
|
+
degradationPreference: d,
|
|
384
402
|
sendEncodings: S,
|
|
385
403
|
offerToReceiveAudio: C,
|
|
386
|
-
offerToReceiveVideo:
|
|
404
|
+
offerToReceiveVideo: h,
|
|
387
405
|
directionVideo: I,
|
|
388
406
|
directionAudio: F,
|
|
389
407
|
setRemoteStreams: f,
|
|
390
408
|
onBeforeProgressCall: p,
|
|
391
|
-
onSuccessProgressCall:
|
|
409
|
+
onSuccessProgressCall: m,
|
|
392
410
|
onEnterPurgatory: R,
|
|
393
411
|
onEnterConference: y,
|
|
394
|
-
onFailProgressCall:
|
|
395
|
-
onFinishProgressCall:
|
|
412
|
+
onFailProgressCall: T,
|
|
413
|
+
onFinishProgressCall: E,
|
|
396
414
|
onEndedCall: b
|
|
397
415
|
} = e, _ = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
398
416
|
onReadyRemoteStreams: f
|
|
399
417
|
}), v = this.resolveHandleReadyRemoteStreams({
|
|
400
418
|
onReadyRemoteStreams: _
|
|
401
|
-
}), O =
|
|
419
|
+
}), O = P(
|
|
402
420
|
{
|
|
403
|
-
degradationPreference:
|
|
421
|
+
degradationPreference: d
|
|
404
422
|
},
|
|
405
423
|
{
|
|
406
424
|
preferredMimeTypesVideoCodecs: this.preferredMimeTypesVideoCodecs,
|
|
@@ -410,14 +428,14 @@ class dn {
|
|
|
410
428
|
a("callToServer", e);
|
|
411
429
|
const N = async () => (a("startCall"), this.sipConnector.call({
|
|
412
430
|
mediaStream: s,
|
|
413
|
-
extraHeaders:
|
|
414
|
-
iceServers:
|
|
431
|
+
extraHeaders: o,
|
|
432
|
+
iceServers: r,
|
|
415
433
|
contentHint: i,
|
|
416
434
|
offerToReceiveAudio: C,
|
|
417
|
-
offerToReceiveVideo:
|
|
435
|
+
offerToReceiveVideo: h,
|
|
418
436
|
directionVideo: I,
|
|
419
437
|
directionAudio: F,
|
|
420
|
-
sendEncodings:
|
|
438
|
+
sendEncodings: B({
|
|
421
439
|
mediaStream: s,
|
|
422
440
|
simulcastEncodings: c,
|
|
423
441
|
sendEncodings: S
|
|
@@ -427,45 +445,45 @@ class dn {
|
|
|
427
445
|
ontrack: v
|
|
428
446
|
}));
|
|
429
447
|
let M = !1, A;
|
|
430
|
-
const
|
|
431
|
-
a("enterRoom", { _room:
|
|
448
|
+
const w = (a("subscribeEnterConference: onEnterConference", y), R ?? y ? this.sipConnector.onSession("enterRoom", ({ room: l }) => {
|
|
449
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? R && R() : y && y({ isSuccessProgressCall: M });
|
|
432
450
|
}) : () => {
|
|
433
|
-
}), k = (
|
|
434
|
-
|
|
435
|
-
}),
|
|
436
|
-
throw a("onFail"),
|
|
451
|
+
}), k = (l) => (a("onSuccess"), M = !0, _(), m && m({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
452
|
+
w(), b && b();
|
|
453
|
+
}), l), U = (l) => {
|
|
454
|
+
throw a("onFail"), T && T(), w(), l;
|
|
437
455
|
}, V = () => {
|
|
438
|
-
a("onFinish"),
|
|
456
|
+
a("onFinish"), E && E();
|
|
439
457
|
};
|
|
440
|
-
return a("onBeforeProgressCall"), p && p(t), N().then(k).catch((
|
|
458
|
+
return a("onBeforeProgressCall"), p && p(t), N().then(k).catch((l) => U(l)).finally(V);
|
|
441
459
|
});
|
|
442
|
-
|
|
443
|
-
|
|
460
|
+
u(this, "disconnectFromServer", async () => this.sipConnector.disconnect().then(() => (a("disconnectFromServer: then"), { isSuccessful: !0 })).catch((e) => (a("disconnectFromServer: catch", e), { isSuccessful: !1 })));
|
|
461
|
+
u(this, "answerIncomingCall", async (e) => {
|
|
444
462
|
const {
|
|
445
463
|
mediaStream: t,
|
|
446
464
|
extraHeaders: s,
|
|
447
|
-
iceServers:
|
|
448
|
-
contentHint:
|
|
465
|
+
iceServers: o,
|
|
466
|
+
contentHint: r,
|
|
449
467
|
simulcastEncodings: i,
|
|
450
468
|
degradationPreference: c,
|
|
451
|
-
sendEncodings:
|
|
469
|
+
sendEncodings: d,
|
|
452
470
|
offerToReceiveAudio: S,
|
|
453
471
|
offerToReceiveVideo: C,
|
|
454
|
-
directionVideo:
|
|
472
|
+
directionVideo: h,
|
|
455
473
|
directionAudio: I,
|
|
456
474
|
setRemoteStreams: F,
|
|
457
475
|
onBeforeProgressCall: f,
|
|
458
476
|
onSuccessProgressCall: p,
|
|
459
|
-
onEnterPurgatory:
|
|
477
|
+
onEnterPurgatory: m,
|
|
460
478
|
onEnterConference: R,
|
|
461
479
|
onFailProgressCall: y,
|
|
462
|
-
onFinishProgressCall:
|
|
463
|
-
onEndedCall:
|
|
480
|
+
onFinishProgressCall: T,
|
|
481
|
+
onEndedCall: E
|
|
464
482
|
} = e, b = this.resolveHandleReadyRemoteStreamsDebounced({
|
|
465
483
|
onReadyRemoteStreams: F
|
|
466
484
|
}), _ = this.resolveHandleReadyRemoteStreams({
|
|
467
485
|
onReadyRemoteStreams: b
|
|
468
|
-
}), v =
|
|
486
|
+
}), v = P(
|
|
469
487
|
{
|
|
470
488
|
degradationPreference: c
|
|
471
489
|
},
|
|
@@ -478,89 +496,89 @@ class dn {
|
|
|
478
496
|
const O = async () => this.sipConnector.answerToIncomingCall({
|
|
479
497
|
mediaStream: t,
|
|
480
498
|
extraHeaders: s,
|
|
481
|
-
iceServers:
|
|
482
|
-
contentHint:
|
|
499
|
+
iceServers: o,
|
|
500
|
+
contentHint: r,
|
|
483
501
|
offerToReceiveAudio: S,
|
|
484
502
|
offerToReceiveVideo: C,
|
|
485
|
-
directionVideo:
|
|
503
|
+
directionVideo: h,
|
|
486
504
|
directionAudio: I,
|
|
487
|
-
sendEncodings:
|
|
505
|
+
sendEncodings: B({
|
|
488
506
|
mediaStream: t,
|
|
489
507
|
simulcastEncodings: i,
|
|
490
|
-
sendEncodings:
|
|
508
|
+
sendEncodings: d
|
|
491
509
|
}),
|
|
492
510
|
onAddedTransceiver: v,
|
|
493
511
|
ontrack: _
|
|
494
512
|
}), N = () => {
|
|
495
|
-
const { remoteCallerData:
|
|
496
|
-
return
|
|
513
|
+
const { remoteCallerData: l } = this.sipConnector;
|
|
514
|
+
return l.incomingNumber;
|
|
497
515
|
};
|
|
498
516
|
let M = !1, A;
|
|
499
|
-
const
|
|
500
|
-
a("enterRoom", { _room:
|
|
517
|
+
const w = (a("subscribeEnterConference: onEnterConference", R), m ?? R ? this.sipConnector.onSession("enterRoom", (l) => {
|
|
518
|
+
a("enterRoom", { _room: l, isSuccessProgressCall: M }), A = l, D(A) ? m && m() : R && R({ isSuccessProgressCall: M });
|
|
501
519
|
}) : () => {
|
|
502
|
-
}), k = (
|
|
503
|
-
|
|
504
|
-
}),
|
|
505
|
-
throw a("onFail"), y && y(),
|
|
520
|
+
}), k = (l) => (a("onSuccess"), M = !0, b(), p && p({ isPurgatory: D(A) }), this.sipConnector.onceRaceSession(["ended", "failed"], () => {
|
|
521
|
+
w(), E && E();
|
|
522
|
+
}), l), U = (l) => {
|
|
523
|
+
throw a("onFail"), y && y(), w(), l;
|
|
506
524
|
}, V = () => {
|
|
507
|
-
a("onFinish"),
|
|
525
|
+
a("onFinish"), T && T();
|
|
508
526
|
};
|
|
509
527
|
if (a("onBeforeProgressCall"), f) {
|
|
510
|
-
const
|
|
511
|
-
f(
|
|
528
|
+
const l = N();
|
|
529
|
+
f(l);
|
|
512
530
|
}
|
|
513
|
-
return O().then(k).catch((
|
|
531
|
+
return O().then(k).catch((l) => U(l)).finally(V);
|
|
514
532
|
});
|
|
515
|
-
|
|
533
|
+
u(this, "updatePresentation", async ({
|
|
516
534
|
mediaStream: e,
|
|
517
535
|
isP2P: t,
|
|
518
536
|
maxBitrate: s,
|
|
519
|
-
contentHint:
|
|
520
|
-
simulcastEncodings:
|
|
537
|
+
contentHint: o,
|
|
538
|
+
simulcastEncodings: r,
|
|
521
539
|
degradationPreference: i,
|
|
522
540
|
sendEncodings: c,
|
|
523
|
-
preferredMimeTypesVideoCodecs:
|
|
541
|
+
preferredMimeTypesVideoCodecs: d,
|
|
524
542
|
excludeMimeTypesVideoCodecs: S
|
|
525
543
|
}) => {
|
|
526
|
-
const C =
|
|
544
|
+
const C = P(
|
|
527
545
|
{
|
|
528
546
|
degradationPreference: i
|
|
529
547
|
},
|
|
530
548
|
{
|
|
531
|
-
preferredMimeTypesVideoCodecs:
|
|
549
|
+
preferredMimeTypesVideoCodecs: d,
|
|
532
550
|
excludeMimeTypesVideoCodecs: S
|
|
533
551
|
}
|
|
534
552
|
);
|
|
535
553
|
return a("updatePresentation"), this.sipConnector.updatePresentation(e, {
|
|
536
554
|
isP2P: t,
|
|
537
555
|
maxBitrate: s,
|
|
538
|
-
contentHint:
|
|
539
|
-
sendEncodings:
|
|
556
|
+
contentHint: o,
|
|
557
|
+
sendEncodings: B({
|
|
540
558
|
mediaStream: e,
|
|
541
|
-
simulcastEncodings:
|
|
559
|
+
simulcastEncodings: r,
|
|
542
560
|
sendEncodings: c
|
|
543
561
|
}),
|
|
544
562
|
onAddedTransceiver: C
|
|
545
563
|
});
|
|
546
564
|
});
|
|
547
|
-
|
|
565
|
+
u(this, "startPresentation", async ({
|
|
548
566
|
mediaStream: e,
|
|
549
567
|
isP2P: t,
|
|
550
568
|
maxBitrate: s,
|
|
551
|
-
contentHint:
|
|
552
|
-
simulcastEncodings:
|
|
569
|
+
contentHint: o,
|
|
570
|
+
simulcastEncodings: r,
|
|
553
571
|
degradationPreference: i,
|
|
554
572
|
sendEncodings: c,
|
|
555
|
-
preferredMimeTypesVideoCodecs:
|
|
573
|
+
preferredMimeTypesVideoCodecs: d,
|
|
556
574
|
excludeMimeTypesVideoCodecs: S
|
|
557
575
|
}, C) => {
|
|
558
|
-
const
|
|
576
|
+
const h = P(
|
|
559
577
|
{
|
|
560
578
|
degradationPreference: i
|
|
561
579
|
},
|
|
562
580
|
{
|
|
563
|
-
preferredMimeTypesVideoCodecs:
|
|
581
|
+
preferredMimeTypesVideoCodecs: d,
|
|
564
582
|
excludeMimeTypesVideoCodecs: S
|
|
565
583
|
}
|
|
566
584
|
);
|
|
@@ -569,51 +587,51 @@ class dn {
|
|
|
569
587
|
{
|
|
570
588
|
isP2P: t,
|
|
571
589
|
maxBitrate: s,
|
|
572
|
-
contentHint:
|
|
573
|
-
sendEncodings:
|
|
590
|
+
contentHint: o,
|
|
591
|
+
sendEncodings: B({
|
|
574
592
|
mediaStream: e,
|
|
575
|
-
simulcastEncodings:
|
|
593
|
+
simulcastEncodings: r,
|
|
576
594
|
sendEncodings: c
|
|
577
595
|
}),
|
|
578
|
-
onAddedTransceiver:
|
|
596
|
+
onAddedTransceiver: h
|
|
579
597
|
},
|
|
580
598
|
C
|
|
581
599
|
);
|
|
582
600
|
});
|
|
583
|
-
|
|
601
|
+
u(this, "stopShareSipConnector", async ({ isP2P: e = !1 } = {}) => (a("stopShareSipConnector"), this.sipConnector.stopPresentation({
|
|
584
602
|
isP2P: e
|
|
585
603
|
}).catch((t) => {
|
|
586
604
|
a(t);
|
|
587
605
|
})));
|
|
588
|
-
|
|
606
|
+
u(this, "sendRefusalToTurnOnMic", async () => {
|
|
589
607
|
if (this.sipConnector.isCallActive)
|
|
590
608
|
return a("sendRefusalToTurnOnMic"), this.sipConnector.sendRefusalToTurnOnMic().catch((e) => {
|
|
591
609
|
a("sendRefusalToTurnOnMic: error", e);
|
|
592
610
|
});
|
|
593
611
|
});
|
|
594
|
-
|
|
612
|
+
u(this, "sendRefusalToTurnOnCam", async () => {
|
|
595
613
|
if (this.sipConnector.isCallActive)
|
|
596
614
|
return a("sendRefusalToTurnOnCam"), this.sipConnector.sendRefusalToTurnOnCam().catch((e) => {
|
|
597
615
|
a("sendRefusalToTurnOnCam: error", e);
|
|
598
616
|
});
|
|
599
617
|
});
|
|
600
|
-
|
|
618
|
+
u(this, "sendMediaState", async ({
|
|
601
619
|
isEnabledCam: e,
|
|
602
620
|
isEnabledMic: t
|
|
603
621
|
}) => {
|
|
604
622
|
if (this.sipConnector.isCallActive)
|
|
605
623
|
return a("sendMediaState"), this.sipConnector.sendMediaState({ cam: e, mic: t });
|
|
606
624
|
});
|
|
607
|
-
|
|
625
|
+
u(this, "replaceMediaStream", async (e, {
|
|
608
626
|
deleteExisting: t,
|
|
609
627
|
addMissing: s,
|
|
610
|
-
forceRenegotiation:
|
|
611
|
-
contentHint:
|
|
628
|
+
forceRenegotiation: o,
|
|
629
|
+
contentHint: r,
|
|
612
630
|
simulcastEncodings: i,
|
|
613
631
|
degradationPreference: c,
|
|
614
|
-
sendEncodings:
|
|
632
|
+
sendEncodings: d
|
|
615
633
|
} = {}) => {
|
|
616
|
-
const S =
|
|
634
|
+
const S = P(
|
|
617
635
|
{
|
|
618
636
|
degradationPreference: c
|
|
619
637
|
},
|
|
@@ -625,56 +643,59 @@ class dn {
|
|
|
625
643
|
return a("replaceMediaStream"), this.sipConnector.replaceMediaStream(e, {
|
|
626
644
|
deleteExisting: t,
|
|
627
645
|
addMissing: s,
|
|
628
|
-
forceRenegotiation:
|
|
629
|
-
contentHint:
|
|
630
|
-
sendEncodings:
|
|
646
|
+
forceRenegotiation: o,
|
|
647
|
+
contentHint: r,
|
|
648
|
+
sendEncodings: B({
|
|
631
649
|
mediaStream: e,
|
|
632
650
|
simulcastEncodings: i,
|
|
633
|
-
sendEncodings:
|
|
651
|
+
sendEncodings: d
|
|
634
652
|
}),
|
|
635
653
|
onAddedTransceiver: S
|
|
636
654
|
});
|
|
637
655
|
});
|
|
638
|
-
|
|
656
|
+
u(this, "askPermissionToEnableCam", async () => {
|
|
639
657
|
if (this.sipConnector.isCallActive)
|
|
640
658
|
return a("askPermissionToEnableCam"), this.sipConnector.askPermissionToEnableCam();
|
|
641
659
|
});
|
|
642
|
-
|
|
660
|
+
u(this, "resolveHandleReadyRemoteStreamsDebounced", ({
|
|
643
661
|
onReadyRemoteStreams: e
|
|
644
|
-
}) =>
|
|
662
|
+
}) => he(() => {
|
|
645
663
|
const t = this.sipConnector.getRemoteStreams();
|
|
646
664
|
a("remoteStreams", t), t && e(t);
|
|
647
665
|
}, 200));
|
|
648
|
-
|
|
666
|
+
u(this, "resolveHandleReadyRemoteStreams", ({
|
|
649
667
|
onReadyRemoteStreams: e
|
|
650
668
|
}) => ({ track: t }) => {
|
|
651
669
|
Ze(t) && e();
|
|
652
670
|
});
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
this.sipConnector = e, this.
|
|
671
|
+
u(this, "getRemoteStreams", () => (a("getRemoteStreams"), this.sipConnector.getRemoteStreams()));
|
|
672
|
+
u(this, "onUseLicense", (e) => (a("onUseLicense"), this.sipConnector.onSession("useLicense", e)));
|
|
673
|
+
u(this, "onMustStopPresentation", (e) => (a("onMustStopPresentation"), this.sipConnector.onSession("mustStopPresentation", e)));
|
|
674
|
+
u(this, "onMoveToSpectators", (e) => (a("onMoveToSpectators"), this.sipConnector.onSession(ce, e)));
|
|
675
|
+
u(this, "onMoveToParticipants", (e) => (a("onMoveToParticipants"), this.sipConnector.onSession(ae, e)));
|
|
676
|
+
this.preferredMimeTypesVideoCodecs = t, this.excludeMimeTypesVideoCodecs = s, this.sipConnector = e, this.on = this.sipConnector.on.bind(e), this.once = this.sipConnector.once.bind(e), this.onceRace = this.sipConnector.onceRace.bind(e), this.wait = this.sipConnector.wait.bind(e), this.off = this.sipConnector.off.bind(e), this.onSession = this.sipConnector.onSession.bind(e), this.onceSession = this.sipConnector.onceSession.bind(e), this.onceRaceSession = this.sipConnector.onceRaceSession.bind(e), this.waitSession = this.sipConnector.waitSession.bind(e), this.offSession = this.sipConnector.offSession.bind(e), this.sendDTMF = this.sipConnector.sendDTMF.bind(e), this.hangUp = this.sipConnector.hangUp.bind(e), this.declineToIncomingCall = this.sipConnector.declineToIncomingCall.bind(e), this.isConfigured = this.sipConnector.isConfigured.bind(e), this.sendChannels = this.sipConnector.sendChannels.bind(e), this.checkTelephony = this.sipConnector.checkTelephony.bind(e), this.waitChannels = this.sipConnector.waitChannels.bind(e), this.ping = this.sipConnector.ping.bind(e);
|
|
677
|
+
}
|
|
678
|
+
get isRegistered() {
|
|
679
|
+
return this.sipConnector.isRegistered;
|
|
659
680
|
}
|
|
660
681
|
}
|
|
661
682
|
export {
|
|
662
683
|
L as EEventsMainCAM,
|
|
663
684
|
Cn as EEventsMic,
|
|
664
685
|
fn as EEventsSyncMediaState,
|
|
665
|
-
|
|
686
|
+
mn as EMimeTypesVideoCodecs,
|
|
666
687
|
Rn as EUseLicense,
|
|
667
|
-
|
|
688
|
+
ln as SipConnectorFacade,
|
|
668
689
|
gn as causes,
|
|
669
690
|
pn as constants,
|
|
670
691
|
An as debug,
|
|
671
692
|
tn as default,
|
|
672
693
|
yn as disableDebug,
|
|
673
|
-
|
|
674
|
-
|
|
694
|
+
Tn as enableDebug,
|
|
695
|
+
En as eventNames,
|
|
675
696
|
De as getCodecFromSender,
|
|
676
697
|
bn as hasCanceledCallError,
|
|
677
|
-
|
|
698
|
+
dn as resolveVideoSendingBalancer,
|
|
678
699
|
ie as setParametersToSender,
|
|
679
700
|
un as tools
|
|
680
701
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sip-connector",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "Module for connect to Vinteo server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webrtc",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
88
88
|
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
89
89
|
"eslint-config-prettier": "^9.1.0",
|
|
90
|
-
"eslint-import-resolver-typescript": "^3.
|
|
90
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
91
91
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
92
92
|
"eslint-plugin-import": "^2.31.0",
|
|
93
93
|
"eslint-plugin-jest": "^28.9.0",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"jest-extended": "^4.0.2",
|
|
100
100
|
"jest-junit": "^16.0.0",
|
|
101
101
|
"lint-staged": "^15.2.10",
|
|
102
|
-
"prettier": "^3.4.
|
|
102
|
+
"prettier": "^3.4.2",
|
|
103
103
|
"standard-version": "^9.5.0",
|
|
104
104
|
"ts-jest": "^29.2.5",
|
|
105
105
|
"ts-node": "^10.9.2",
|