fix(proxy-engine): fix inbound route browser ringing and provider-facing SDP advertisement while preventing RTP port exhaustion

This commit is contained in:
2026-04-11 18:40:56 +00:00
parent 21ffc1d017
commit 81441e7853
17 changed files with 208 additions and 469 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: 'siprouter',
version: '1.20.1',
version: '1.20.2',
description: 'undefined'
}

View File

@@ -94,6 +94,11 @@ export interface IIncomingCallEvent {
from_uri: string;
to_number: string;
provider_id: string;
/** Whether registered browsers should see a `webrtc-incoming` toast for
* this call. Set by the Rust engine from the matched inbound route's
* `ringBrowsers` flag (defaults to `true` when no route matches, so
* deployments without explicit routes preserve pre-routing behavior). */
ring_browsers?: boolean;
}
export interface IOutboundCallEvent {

View File

@@ -273,15 +273,23 @@ async function startProxyEngine(): Promise<void> {
legs: new Map(),
});
// Notify browsers of incoming call.
const browserIds = getAllBrowserDeviceIds();
for (const bid of browserIds) {
sendToBrowserDevice(bid, {
type: 'webrtc-incoming',
callId: data.call_id,
from: data.from_uri,
deviceId: bid,
});
// Notify browsers of the incoming call, but only if the matched inbound
// route asked for it. `ring_browsers !== false` preserves today's
// ring-by-default behavior for any Rust release that predates this
// field or for the fallback "no route matched" case (where Rust still
// sends `true`). Note: this is an informational toast — browsers do
// NOT race the SIP device to answer. First-to-answer-wins requires
// a multi-leg fork which is not yet implemented.
if (data.ring_browsers !== false) {
const browserIds = getAllBrowserDeviceIds();
for (const bid of browserIds) {
sendToBrowserDevice(bid, {
type: 'webrtc-incoming',
callId: data.call_id,
from: data.from_uri,
deviceId: bid,
});
}
}
});