@16x/webphone-sdk 3.2.5 → 3.2.7
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/CHANGELOG.md +33 -0
- package/dist/{Diagnostics-A7Z5fddO.cjs → Diagnostics-2u57yWWY.cjs} +1 -1
- package/dist/{Diagnostics-bC1jC3qZ.js → Diagnostics-Cf_5N1Sy.js} +1 -1
- package/dist/JsSipAdapter-B8ueIoBA.js +710 -0
- package/dist/JsSipAdapter-l97xq1ao.cjs +1 -0
- package/dist/core/CCBarClient.d.ts +2 -0
- package/dist/diagnostics/Diagnostics.d.ts +14 -0
- package/dist/diagnostics/index.cjs +1 -1
- package/dist/diagnostics/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.umd.js +1 -22
- package/dist/legacy/index.cjs +1 -1
- package/dist/legacy/index.js +1 -1
- package/dist/{legacySessionProvider-DEC6MTLR.cjs → legacySessionProvider-CVdDA4kI.cjs} +1 -1
- package/dist/{legacySessionProvider-BlHM7TTM.js → legacySessionProvider-DiE43FBy.js} +29 -13
- package/dist/version.d.ts +1 -1
- package/package.json +3 -2
- package/dist/JsSipAdapter-Cz6MwjPa.js +0 -405
- package/dist/JsSipAdapter-DZZ6vQSa.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./SharedWorkerProtocol-C-4KpECM.cjs");require("./createJsSipFactory-B1ORbJiP.cjs");function t(e){let t=new Map;return{peerConnection:{getSenders:()=>e.getSenders().map(n=>{let r=t.get(n);if(r!==void 0)return r;let i={get track(){return n.track},get senderKind(){let t=n.track;if(t!==null)return t.kind===`audio`||t.kind===`video`?t.kind:void 0;let r=e.getTransceivers().find(e=>e.sender===n)?.receiver.track;if(r?.kind===`audio`||r?.kind===`video`)return r.kind;let i=n.getParameters().codecs?.find(e=>typeof e.mimeType==`string`);if(i?.mimeType?.toLowerCase().startsWith(`video/`))return`video`;if(i?.mimeType?.toLowerCase().startsWith(`audio/`))return`audio`},replaceTrack:e=>n.replaceTrack(e)};return t.set(n,i),i}),close:()=>{e.connectionState!==`closed`&&e.close()}},trackSource:{onTrack(t){let n=e=>{let n=e.track;t({streams:[...e.streams],track:n})};return e.addEventListener(`track`,n),()=>e.removeEventListener(`track`,n)}}}}var n=2e3,r=[5e3,15e3,6e4];function i(){return{runs:0,lastMs:null,udpOk:!1,tcpRelayOk:!1,convergedServers:null,unchanged:null,status:`idle`,lastProbeAt:null,cacheAgeMs:null,unknownCount:0,unavailableCount:0,dialMode:`original`}}function a(e){if(!e)return``;let t=String(e.type??``);return t===``?/ typ (\w+)/.exec(String(e.candidate??``))?.[1]??``:t}function o(e){return/^turns:/i.test(e)?`tls`:/transport=tcp/i.test(e)?`tcp`:`udp`}function s(e,t){let n=t.flatMap(e=>(Array.isArray(e.urls)?e.urls:[e.urls]).map(t=>[String(t),e])),r=new Map(n),i=[];for(let t of e){let e=Array.isArray(t.urls)?t.urls:[t.urls];for(let t of e){let e=r.get(String(t));e&&i.push({...e,urls:[t]})}}return i}function c(e,t={}){let r=Number.isFinite(t.timeoutMs)&&t.timeoutMs>0?t.timeoutMs:n;if(!Array.isArray(e))return Promise.resolve([]);let i=[];for(let t of e){if(!t)continue;let e=Array.isArray(t.urls)?t.urls:[t.urls];for(let n of e){let e=String(n??``).trim();/^(stun|turn|turns):/i.test(e)&&i.push({url:e,entry:t})}}return Promise.all(i.map(e=>new Promise(t=>{let n=!1,i=!1,s,c=o(e.url),l=(r,i)=>{if(!n){n=!0,clearTimeout(u);try{s?.close()}catch{}t({url:e.url,status:r,transport:c,reason:i})}},u=setTimeout(()=>l(i?`unavailable`:`unknown`,i?`server-error`:`timeout`),r);try{if(typeof RTCPeerConnection>`u`){l(`unknown`,`local-error`);return}let t={urls:[e.url]};e.entry.username&&(t.username=e.entry.username),e.entry.credential&&(t.credential=e.entry.credential),s=new RTCPeerConnection({iceServers:[t]}),s.createDataChannel(`webphone-ice-probe`),s.onicecandidate=e=>{if(!e||!e.candidate)return;let t=a(e.candidate);(t===`srflx`||t===`relay`)&&l(`available`,`candidate`)},s.onicecandidateerror=t=>{t?.url&&t.url===e.url&&(i=!0)},s.createOffer().then(e=>s?.setLocalDescription(e)).catch(()=>l(`unknown`,`local-error`))}catch{l(`unknown`,`local-error`)}})))}function l(e,t){let n=new Map;for(let e of t)e&&e.url&&n.set(String(e.url),e.status===`available`);let r=[];for(let t of e??[]){if(!t)continue;let e=(Array.isArray(t.urls)?t.urls:[t.urls]).filter(Boolean).filter(e=>n.get(String(e))===!0);if(e.length===0)continue;let i={...t,urls:e};r.push(i)}return r}var u=class{availableList;lastGoodList;lastGoodAt;lastResults=[];snapshotState=i();running=!1;seq=0;consecutiveFailures=0;lastAttemptAt;retryTimer;pendingRequest;serversForDial(e,t=Date.now()){if(!e)return;if(!this.lastResults.length)return this.setDialMode(`original`),e;let n=this.lastGoodAt===void 0?null:Math.max(0,t-this.lastGoodAt);this.snapshotState={...this.snapshotState,cacheAgeMs:n};let r=n!==null&&n>3e5,i=this.snapshotState.lastProbeAt===null?null:Math.max(0,t-this.snapshotState.lastProbeAt);if(r||i!==null&&i>3e5)return this.snapshotState={...this.snapshotState,status:`stale`,cacheAgeMs:n??i},this.assess(e,`ttl-expired`),this.availableList&&this.availableList.length>0?(this.setDialMode(`original`),e):(this.setDialMode(`host-only`),[]);if(!r&&this.availableList&&this.availableList.length>0)return this.setDialMode(`known-available`),this.availableList.map(e=>({...e,urls:Array.isArray(e.urls)?[...e.urls]:e.urls}));if(this.lastGoodList&&n!==null&&n<=3e5){let t=s(this.lastGoodList,e);if(t.length>0)return this.setDialMode(`last-known-good`),t}return this.setDialMode(`host-only`),[]}snapshot(){return this.snapshotState}reset(){this.retryTimer!==void 0&&clearTimeout(this.retryTimer),this.retryTimer=void 0,this.pendingRequest=void 0,this.seq++,this.running=!1,this.availableList=void 0,this.lastGoodList=void 0,this.lastGoodAt=void 0,this.lastResults=[],this.consecutiveFailures=0,this.lastAttemptAt=void 0,this.snapshotState=i()}cancelInFlight(){this.seq++,this.running=!1,this.retryTimer!==void 0&&clearTimeout(this.retryTimer),this.retryTimer=void 0,this.pendingRequest=void 0}assess(e,t=`initial-registration`){if(e===void 0)return;if(e.length===0){this.reset();return}if(this.running){t!==`initial-registration`&&(this.pendingRequest={servers:e,trigger:t});return}let n=Date.now();if(t!==`initial-registration`&&this.consecutiveFailures>0&&this.lastAttemptAt!==void 0){let i=r[Math.min(this.consecutiveFailures-1,r.length-1)]-(n-this.lastAttemptAt);if(i>0){this.pendingRequest={servers:e,trigger:t},this.retryTimer===void 0&&(this.retryTimer=setTimeout(()=>{this.retryTimer=void 0;let e=this.pendingRequest;this.pendingRequest=void 0,e&&this.assess(e.servers,e.trigger)},i));return}}let i=e.map(e=>({...e,urls:Array.isArray(e.urls)?[...e.urls]:[e.urls]}));if(!i.some(e=>(Array.isArray(e.urls)?e.urls:[e.urls]).some(e=>/^(stun|turn|turns):/i.test(String(e??``)))))return;let a=++this.seq;this.running=!0,this.lastAttemptAt=n,this.availableList=void 0,this.snapshotState={...this.snapshotState,status:t===`ttl-expired`?`stale`:`probing`};let o=Date.now();c(i).then(e=>{if(a!==this.seq)return;this.lastResults=e;let t=i,n=l(t,e);this.availableList=n.length>0?n:void 0,this.availableList&&(this.lastGoodList=n.map(e=>({...e,urls:Array.isArray(e.urls)?[...e.urls]:e.urls})),this.lastGoodAt=Date.now());let s=e.filter(e=>e.status===`unknown`).length,c=e.filter(e=>e.status===`unavailable`).length;this.consecutiveFailures=n.length===0?this.consecutiveFailures+1:0,n.length===0&&this.consecutiveFailures<=r.length&&this.pendingRequest===void 0&&(this.pendingRequest={servers:i,trigger:`retry-backoff`}),this.snapshotState={runs:this.snapshotState.runs+1,lastMs:Date.now()-o,udpOk:e.some(e=>e.status===`available`&&e.transport===`udp`),tcpRelayOk:e.some(e=>e.status===`available`&&(e.transport===`tcp`||e.transport===`tls`)),convergedServers:n.length,unchanged:JSON.stringify(n)===JSON.stringify(t),status:s+c>0?`degraded`:`healthy`,lastProbeAt:Date.now(),cacheAgeMs:0,unknownCount:s,unavailableCount:c,dialMode:n.length>0?`known-available`:`host-only`}}).catch(()=>{this.seq}).finally(()=>{if(a!==this.seq)return;this.running=!1;let e=this.pendingRequest;this.pendingRequest=void 0,e&&this.assess(e.servers,e.trigger)})}isRunning(){return this.running}setDialMode(e){let t=this.snapshotState.status;this.snapshotState={...this.snapshotState,dialMode:e,status:t===`healthy`&&e===`host-only`?`stale`:t}}},d=3e3;function f(e){if(!e)return``;let t=String(e.type??``);return t===``?/ typ (\w+)/.exec(String(e.candidate??``))?.[1]??``:t}function p(e,t={}){if(typeof e.on!=`function`)return()=>void 0;let n=Number.isFinite(t.timeoutMs)&&t.timeoutMs>0?t.timeoutMs:d,r=!1,i,a=()=>{if(!r){r=!0,clearTimeout(s);try{i?.()}catch{}}},o=e=>{let t=e;if(!t||typeof t.ready!=`function`)return;i=t.ready;let n=f(t.candidate);(n===`srflx`||n===`relay`)&&a()};e.on(`icecandidate`,o);let s=setTimeout(a,n);return()=>{clearTimeout(s);try{e.off?.(`icecandidate`,o)}catch{}}}var m=300,h=25,g=2,_=``,v=120;function y(e){let t=Math.floor(Number(e.sip.registerExpires));return Number.isFinite(t)&&t>0?t:m}var b=class{factory;transportBaseUrl;keepaliveSeconds;agentTerminal;sessionTimers;ua;uaListeners;incomingHandlers;iceServers;pendingConnection;disposed=!1;warmPc;keepaliveTimer;keepaliveBusy=!1;registerExpiresSeconds=0;connectionHandlers=new Set;iceQuality=new u;constructor(e,t,n=h,r=_,i=!1){this.factory=e,this.transportBaseUrl=t,this.keepaliveSeconds=n,this.agentTerminal=r,this.sessionTimers=i}terminalHeaders(){return this.agentTerminal===``?[]:[`X-Agent-Terminal: ${this.agentTerminal}`]}warmIceCandidatePool(){if(this.closeWarmPc(),typeof RTCPeerConnection<`u`&&this.iceServers!==void 0)try{this.warmPc=new RTCPeerConnection({iceServers:[...this.iceServers],iceCandidatePoolSize:g})}catch{this.warmPc=void 0}}closeWarmPc(){try{this.warmPc?.close()}catch{}this.warmPc=void 0}keepaliveTick(e){if(this.isCurrentUa(e)&&!this.keepaliveBusy)try{if(typeof e.isConnected==`function`&&e.isConnected()===!1||typeof e.register!=`function`)return;this.keepaliveBusy=!0,e.register({extraHeaders:this.terminalHeaders()})}catch{}finally{this.keepaliveBusy=!1}}startKeepalive(e,t){if(this.stopKeepalive(),!Number.isFinite(this.keepaliveSeconds)||this.keepaliveSeconds<=0||t>0&&t<=this.keepaliveSeconds)return;let n=Math.max(10,Math.floor(this.keepaliveSeconds))*1e3;this.keepaliveTimer=setInterval(()=>this.keepaliveTick(e),n)}stopKeepalive(){this.keepaliveTimer!==void 0&&clearInterval(this.keepaliveTimer),this.keepaliveTimer=void 0}connect(t){this.assertNotDisposed();let n=this.iceQuality.snapshot().runs>0;this.disconnect(this.registrationError(`SIP connection replaced`),!n);try{let e=this.factory.createUa({sockets:w(this.factory.createSocket(this.withoutTicket(this.resolveWssUrl(t.transport.wssUrl)),t.transport.ticket)),uri:t.sip.uri,password:t.sip.registerTicket,registrar_server:t.sip.registrar,register:!0,register_expires:y(t),session_timers:this.sessionTimers,...this.agentTerminal===``?{}:{user_agent:this.agentTerminal}});return this.ua=e,this.registerExpiresSeconds=y(t),this.iceServers=t.iceServers,this.uaListeners=[],this.startRegistration(e)}catch(t){let n=t instanceof e.i&&t.code===`CONFIG_INVALID`?t:this.transportError(t);return this.disconnect(n),Promise.reject(n)}}disconnect(e=this.registrationError(`SIP connection disconnected`),t=!0){this.stopKeepalive(),this.closeWarmPc(),t?this.iceQuality.reset():this.iceQuality.cancelInFlight();let n=this.pendingConnection;this.pendingConnection=void 0,this.ua!==void 0&&(this.removeUaListeners(this.ua),this.ua.stop()),this.ua=void 0,this.uaListeners=void 0,this.iceServers=void 0,n?.reject(e)}dial(t,n){let r=this.requireUa();if(t.trim()===``)throw new e.i(`CALL_INVALID_DESTINATION`,`call`,!1);try{let e=n===void 0?{mediaConstraints:{audio:!0,video:!1},sessionTimersExpires:v,pcConfig:{iceServers:this.dialIceServers(),iceCandidatePoolSize:g}}:{mediaConstraints:{audio:!0,video:!1},sessionTimersExpires:v,pcConfig:{iceServers:[...n.iceServers],iceCandidatePoolSize:g},extraHeaders:[...this.terminalHeaders(),...n.extraHeaders,...n.type===`extension`?[`X-XCall-Destination-Type: extension`]:[]]};return this.createSessionHandle(r.call(t,e))}catch(t){throw new e.i(`CALL_OPERATION_NOT_ALLOWED`,`call`,!1,{cause:t})}}onIncoming(e){this.assertNotDisposed();let t=this.incomingHandlers??new Set;return this.incomingHandlers=t,t.add(e),()=>t.delete(e)}onConnectionStateChanged(e){return this.disposed?()=>void 0:(this.connectionHandlers.add(e),()=>this.connectionHandlers.delete(e))}dispose(){this.disposed||(this.disposed=!0,this.disconnect(),this.incomingHandlers=void 0,this.connectionHandlers.clear())}dialIceServers(){return this.iceQuality.serversForDial(this.iceServers)}iceQualitySnapshot(){return this.iceQuality.snapshot()}reassessIceServers(e=`network-online`){this.iceQuality.assess(this.iceServers,e)}getResourceCounts(){return{listeners:(this.uaListeners?.length??0)+(this.incomingHandlers?.size??0)+this.connectionHandlers.size,webSockets:this.ua===void 0?0:1}}handleIncoming(e){if(!S(e))return;let t=e.session;if(t===void 0)return;let n=this.createSessionHandle(t);this.incomingHandlers?.forEach(e=>e(n))}createSessionHandle(e){return new x(e,()=>this.reassessIceServers(`ice-failed`))}startRegistration(e){let t=!0,n=!1,r=new Promise((t,n)=>{this.pendingConnection={ua:e,resolve:t,reject:n}});this.listen(e,`registered`,()=>{if(this.isCurrentUa(e)){if(t){n=!0;return}this.resolveConnection(e)}}),this.listen(e,`registrationFailed`,t=>{if(!this.isCurrentUa(e))return;let n=this.registrationError(this.registrationFailureCause(t));this.connectionHandlers.forEach(e=>e(`failed`,n)),this.disconnect(n)}),this.listen(e,`disconnected`,t=>{if(!this.isCurrentUa(e))return;let n=this.transportError(t);this.connectionHandlers.forEach(e=>e(`disconnected`,n)),this.disconnect(n,!1)}),this.listen(e,`newRTCSession`,t=>{this.isCurrentUa(e)&&this.handleIncoming(t)});try{e.start()}catch(e){let t=this.transportError(e);this.connectionHandlers.forEach(e=>e(`failed`,t)),this.disconnect(t)}finally{t=!1}return n&&this.resolveConnection(e),r}listen(e,t,n){e.on(t,n),this.uaListeners?.push({event:t,handler:n})}removeUaListeners(e){this.uaListeners?.forEach(({event:t,handler:n})=>e.off(t,n))}isCurrentUa(e){return this.ua===e}resolveConnection(e){let t=this.pendingConnection;if(t?.ua!==e)return;this.pendingConnection=void 0,t.resolve(),this.warmIceCandidatePool();let n=this.iceQuality.snapshot().runs>0?`sip-reconnected`:`initial-registration`;this.iceQuality.assess(this.iceServers,n),this.startKeepalive(e,this.registerExpiresSeconds),this.connectionHandlers.forEach(e=>e(`registered`))}resolveWssUrl(e){let t=this.transportBaseUrl?.trim()===``||this.transportBaseUrl===void 0?typeof location>`u`?`http://localhost`:location.origin:this.transportBaseUrl,n=e.startsWith(`/`)?new URL(e,t):new URL(e);return n.protocol===`http:`&&(n.protocol=`ws:`),n.protocol===`https:`&&(n.protocol=`wss:`),this.assertAllowedWssUrl(n),n.toString()}assertAllowedWssUrl(t){if(t.protocol!==`wss:`&&!(t.protocol===`ws:`&&T(t.hostname)))throw new e.i(`CONFIG_INVALID`,`configuration`,!1,{cause:t.origin})}withoutTicket(e){let t=new URL(e);return t.searchParams.delete(`ticket`),t.toString()}requireUa(){if(this.assertNotDisposed(),this.ua===void 0)throw new e.i(`CALL_NOT_CONNECTED`,`call`,!1);return this.ua}assertNotDisposed(){if(this.disposed)throw new e.i(`SDK_ALREADY_DISPOSED`,`internal`,!1)}registrationError(t){return new e.i(`REGISTRATION_FAILED`,`registration`,!0,{cause:t})}transportError(t){return new e.i(`SIP_WS_UNAVAILABLE`,`registration`,!0,{cause:t})}registrationFailureCause(e){return typeof e==`object`&&e&&`cause`in e?e.cause:e}},x=class{session;pendingHoldReject;mediaRegistration;mediaConnection;mediaHandlers=new Set;mediaWatchStarted=!1;sessionUnsubscribeFromPeerConnection;detachIceGatheringTimeout;detachIceFailureWatch;constructor(e,t){this.session=e,this.detachIceGatheringTimeout=p(e),t!==void 0&&this.watchIceFailure(t)}get id(){return this.session.id}get from(){return this.session.from??E(this.session.remote_identity)}getMediaRegistration(){let e=this.session.connection;if(e!=null)return this.mediaRegistration!==void 0&&this.mediaConnection===e?this.mediaRegistration:(this.mediaConnection=e,this.mediaRegistration=t(e),this.mediaRegistration)}answer(e){this.session.answer({mediaConstraints:e.mediaConstraints,pcConfig:{iceServers:[...e.pcConfig.iceServers],iceCandidatePoolSize:g}})}terminate(){this.detachIceGatheringTimeout?.(),this.detachIceGatheringTimeout=void 0,this.detachIceFailureWatch?.(),this.detachIceFailureWatch=void 0,this.pendingHoldReject?.(Error(`SIP session terminated`)),this.session.terminate()}watchIceFailure(e){let t,n=()=>{t?.iceConnectionState===`failed`&&e()},r=e=>{e&&e!==t&&(t?.removeEventListener(`iceconnectionstatechange`,n),t=e,t.addEventListener(`iceconnectionstatechange`,n),n())},i=e=>{r(e?.peerconnection)},a=()=>{this.session.off(`peerconnection`,i),this.session.off(`ended`,a),this.session.off(`failed`,a),t?.removeEventListener(`iceconnectionstatechange`,n),t=void 0},o=this.session.connection;o!=null&&r(o),this.session.on(`peerconnection`,i),this.session.on(`ended`,a),this.session.on(`failed`,a),this.detachIceFailureWatch=a}hold(){return this.changeHoldState(`hold`)}unhold(){return this.changeHoldState(`unhold`)}mute(){this.session.mute()}unmute(){this.session.unmute()}sendDtmf(e){this.session.sendDTMF(e)}refer(e){this.session.refer(e)}on(e,t){return e===`mediaConnected`?(this.mediaHandlers.add(t),this.watchMediaConnection(),()=>{this.mediaHandlers.delete(t),this.mediaHandlers.size===0&&(this.sessionUnsubscribeFromPeerConnection?.(),this.sessionUnsubscribeFromPeerConnection=void 0)}):(this.session.on(e,t),()=>this.session.off(e,t))}watchMediaConnection(){if(this.mediaWatchStarted)return;this.mediaWatchStarted=!0;let e=!1,t=t=>{if(t==null)return;let n=()=>{if(e)return;let n=t.connectionState||t.iceConnectionState;if(n===`connected`){e=!0;for(let e of this.mediaHandlers)try{e({state:n})}catch{}}};t.addEventListener(`connectionstatechange`,n),n()},n=this.session.connection;if(n!=null){t(n);return}let r=e=>{t(e?.peerconnection??void 0)};this.session.on(`peerconnection`,r),this.sessionUnsubscribeFromPeerConnection=()=>this.session.off(`peerconnection`,r)}changeHoldState(t){return new Promise((n,r)=>{let i=!1,a=e=>{c(e)},o=()=>{try{this.session.off(`ended`,a)}catch{}try{this.session.off(`failed`,a)}catch{}this.pendingHoldReject===c&&(this.pendingHoldReject=void 0)},s=()=>{i||(i=!0,o(),n())},c=t=>{i||(i=!0,o(),r(new e.i(`CALL_OPERATION_NOT_ALLOWED`,`call`,!1,{cause:t})))};try{this.session.on(`ended`,a),this.session.on(`failed`,a)}catch(e){c(e);return}this.pendingHoldReject=c;try{this.session[t](void 0,s)||c({reason:`jssip_operation_rejected`,operation:t})}catch(e){c(e)}})}};function S(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.originator===`remote`&&C(t.session)}function C(e){return typeof e==`object`&&!!e&&`id`in e}function w(e){return typeof e==`object`&&e&&(e.via_transport=`WSS`),e}function T(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase();return t===`localhost`||t===`127.0.0.1`||t===`::1`||t===`0:0:0:0:0:0:0:1`}function E(e){let t=e?.uri;if(t==null)return;if(typeof t.user==`string`&&t.user!==``)return t.user;let n=t.toString();return n.match(/^sips?:([^@;>]+)/i)?.[1]??(n===``?void 0:n)}exports.JsSipAdapter=b;
|
|
@@ -90,6 +90,7 @@ export declare class CCBarClient {
|
|
|
90
90
|
private managerUnsubscribers;
|
|
91
91
|
private sipUnsubscribe?;
|
|
92
92
|
private networkUnsubscribers;
|
|
93
|
+
private networkProbeTimer?;
|
|
93
94
|
private readonly sessionDeleteOperations;
|
|
94
95
|
private readonly deletedSessions;
|
|
95
96
|
private readonly ownedSessionIds;
|
|
@@ -136,6 +137,7 @@ export declare class CCBarClient {
|
|
|
136
137
|
private getSip;
|
|
137
138
|
private attachSipListener;
|
|
138
139
|
private attachNetworkListeners;
|
|
140
|
+
private scheduleIceReassessment;
|
|
139
141
|
private detachNetworkListeners;
|
|
140
142
|
private getActiveMediaContext;
|
|
141
143
|
private hasNonTerminalCalls;
|
|
@@ -26,6 +26,20 @@ export interface DiagnosticIceSummary {
|
|
|
26
26
|
readonly serverCount: number;
|
|
27
27
|
readonly stunServerCount: number;
|
|
28
28
|
readonly turnServerCount: number;
|
|
29
|
+
/** url 级探测收敛快照(3.2.6+;SharedWorker 模式下主页面侧可能缺失) */
|
|
30
|
+
readonly probe?: {
|
|
31
|
+
readonly runs: number;
|
|
32
|
+
readonly lastMs: number | null;
|
|
33
|
+
readonly udpOk: boolean;
|
|
34
|
+
readonly tcpRelayOk: boolean;
|
|
35
|
+
readonly convergedServers: number | null;
|
|
36
|
+
readonly status: 'idle' | 'probing' | 'healthy' | 'degraded' | 'stale';
|
|
37
|
+
readonly lastProbeAt: number | null;
|
|
38
|
+
readonly cacheAgeMs: number | null;
|
|
39
|
+
readonly unknownCount: number;
|
|
40
|
+
readonly unavailableCount: number;
|
|
41
|
+
readonly dialMode: 'original' | 'known-available' | 'last-known-good' | 'host-only';
|
|
42
|
+
};
|
|
29
43
|
}
|
|
30
44
|
export interface DiagnosticWssSummary {
|
|
31
45
|
readonly configured: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Diagnostics-2u57yWWY.cjs"),t=require("../redact-Bq26pObO.cjs");require("../createJsSipFactory-B1ORbJiP.cjs"),exports.Diagnostics=e.t,exports.RingBuffer=e.n,exports.diagnosticsVersion=e.r,exports.redactText=t.t,exports.redactValue=t.n;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as e, r as t, t as n } from "../Diagnostics-
|
|
1
|
+
import { n as e, r as t, t as n } from "../Diagnostics-Cf_5N1Sy.js";
|
|
2
2
|
import { n as r, t as i } from "../redact-DB3CMbsK.js";
|
|
3
3
|
export { n as Diagnostics, e as RingBuffer, t as diagnosticsVersion, i as redactText, r as redactValue };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-C-4KpECM.cjs"),t=require("./legacySessionProvider-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SharedWorkerProtocol-C-4KpECM.cjs"),t=require("./legacySessionProvider-CVdDA4kI.cjs"),n=require("./Diagnostics-2u57yWWY.cjs"),r=require("./redact-Bq26pObO.cjs");require("./diagnostics/index.cjs"),require("./createJsSipFactory-B1ORbJiP.cjs");function i(e){if(e.code!==`OK`)throw TypeError(`Unexpected session response code: ${e.code}`);if(e.data===void 0||e.data===null)throw TypeError(`Unexpected session response: missing data`);return e.data}function a(e={}){return{version:`0.1.0`,options:e}}var o=`0.1.0`;exports.CCBarCall=t.c,exports.CCBarClient=t.r,exports.CCBarError=e.i,exports.CallManager=t.s,exports.CallStateError=t.l,exports.Diagnostics=n.t,exports.RingBuffer=n.n,exports.TypedEventBus=t.m,exports.assertCallTransition=t.u,exports.canTransition=t.d,exports.createSdk=a,exports.createSharedWorkerSelection=t.i,exports.createTokenSessionProvider=t.n,exports.diagnosticsVersion=n.r,exports.parseSessionResponse=i,exports.redactText=r.t,exports.redactValue=r.n,exports.resolveWorkerUrl=t.a,exports.transition=t.f,exports.transitions=t.p,exports.version=o;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./SharedWorkerProtocol-CffZrUXg.js";
|
|
2
|
-
import { a as t, c as n, d as r, f as i, i as a, l as o, m as s, n as c, p as l, r as u, s as d, u as f } from "./legacySessionProvider-
|
|
3
|
-
import { n as p, r as m, t as h } from "./Diagnostics-
|
|
2
|
+
import { a as t, c as n, d as r, f as i, i as a, l as o, m as s, n as c, p as l, r as u, s as d, u as f } from "./legacySessionProvider-DiE43FBy.js";
|
|
3
|
+
import { n as p, r as m, t as h } from "./Diagnostics-Cf_5N1Sy.js";
|
|
4
4
|
import { n as g, t as _ } from "./redact-DB3CMbsK.js";
|
|
5
5
|
import "./diagnostics/index.js";
|
|
6
6
|
//#region src/api/contracts.ts
|