@siphon-project/control 0.9.0 → 0.10.1
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/README.md +5 -5
- package/dist/index.cjs +155 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +337 -6
- package/dist/index.d.ts +337 -6
- package/dist/index.js +154 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -86,6 +86,16 @@ declare const DESCRIBE = "describe";
|
|
|
86
86
|
declare const SET_VAR = "set_var";
|
|
87
87
|
/** Substrate verb: read a per-channel variable. */
|
|
88
88
|
declare const GET_VAR = "get_var";
|
|
89
|
+
/**
|
|
90
|
+
* Substrate verb: every registered AoR and the `seq` the set is current to
|
|
91
|
+
* (the app must subscribe to `registration`).
|
|
92
|
+
*/
|
|
93
|
+
declare const REGISTRATIONS = "registrations";
|
|
94
|
+
/**
|
|
95
|
+
* Substrate verb: every outbound registration and its `seq` (the app must
|
|
96
|
+
* subscribe to `outbound_registration`).
|
|
97
|
+
*/
|
|
98
|
+
declare const OUTBOUND_REGISTRATIONS = "outbound_registrations";
|
|
89
99
|
/** The `type` discriminator on every frame. */
|
|
90
100
|
type FrameType = "command" | "reply" | "event";
|
|
91
101
|
/** The status of a reply. */
|
|
@@ -232,7 +242,7 @@ declare const SipVerb: {
|
|
|
232
242
|
/** A value of {@link SipVerb}. */
|
|
233
243
|
type SipVerbToken = (typeof SipVerb)[keyof typeof SipVerb];
|
|
234
244
|
/** The well-known SIP-adapter event names (the ARI *Stasis* model). */
|
|
235
|
-
type SipEventKind = "StasisStart" | "StasisEnd" | "ChannelStateChange" | "ChannelHangupRequest" | "ChannelDtmfReceived" | "PlayStarted" | "TransferRequested" | "TransferTimedOut" | "TransferProgress" | "TransferCompleted" | "TransferFailed" | "ChannelBridged" | "BridgeFailed" | "ChannelUnbridged" | "PeerReplaced" | "ReplaceFailed" | "PlayFinished" | "WsTeeStarted" | "WsTeeEnded" | "WsBridgeStarted" | "WsBridgeEnded" | "MediaSummary" | "MediaStarted" | "DialBranch" | "DialBranchFailed" | "DialAnswered" | "DialFailed" | "DialogStateChanged" | (string & {});
|
|
245
|
+
type SipEventKind = "StasisStart" | "StasisEnd" | "ChannelStateChange" | "ChannelHangupRequest" | "ChannelDtmfReceived" | "PlayStarted" | "TransferRequested" | "TransferTimedOut" | "TransferProgress" | "TransferCompleted" | "TransferFailed" | "ChannelBridged" | "BridgeFailed" | "ChannelUnbridged" | "PeerReplaced" | "ReplaceFailed" | "PlayFinished" | "WsTeeStarted" | "WsTeeEnded" | "WsBridgeStarted" | "WsBridgeEnded" | "MediaSummary" | "MediaStarted" | "DialBranch" | "DialBranchFailed" | "DialAnswered" | "DialFailed" | "DialogStateChanged" | "RegistrationChanged" | "RegistrantChanged" | (string & {});
|
|
236
246
|
/** Parse a wire event name; unknown names pass through verbatim (forward-compatible). */
|
|
237
247
|
declare function sipEventKind(name: string): SipEventKind;
|
|
238
248
|
/**
|
|
@@ -780,6 +790,125 @@ interface DialogStateChangedPayload {
|
|
|
780
790
|
remote_tag: string | null;
|
|
781
791
|
remote_identity: DialogIdentity;
|
|
782
792
|
}
|
|
793
|
+
/**
|
|
794
|
+
* One binding of a registered AoR, as `RegistrationChanged` and the
|
|
795
|
+
* `registrations` reply report it. Fields past `q` are absent from a server
|
|
796
|
+
* older than the one that added them.
|
|
797
|
+
*/
|
|
798
|
+
interface RegistrationContact {
|
|
799
|
+
/** The Contact URI. */
|
|
800
|
+
uri: string;
|
|
801
|
+
/** Seconds left on the binding. */
|
|
802
|
+
expires: number;
|
|
803
|
+
/** Its q-value. */
|
|
804
|
+
q: number;
|
|
805
|
+
/**
|
|
806
|
+
* Where the REGISTER came from, `sip:<ip>:<port>;transport=<proto>`, byte for
|
|
807
|
+
* byte the script's `Contact.received`; `null` when unknown. This, not `uri`,
|
|
808
|
+
* is what an INVITE from the same phone comes from.
|
|
809
|
+
*/
|
|
810
|
+
received?: string | null;
|
|
811
|
+
/** The transport the REGISTER arrived on. */
|
|
812
|
+
transport?: string | null;
|
|
813
|
+
/** The transport the client used to reach a front that declared a different one. */
|
|
814
|
+
client_transport?: string;
|
|
815
|
+
/** The `+sip.instance` (RFC 5626). */
|
|
816
|
+
instance?: string | null;
|
|
817
|
+
/** The `reg-id` (RFC 5626). */
|
|
818
|
+
reg_id?: number | null;
|
|
819
|
+
/** The binding's Path (RFC 3327), topmost first. */
|
|
820
|
+
path?: string[];
|
|
821
|
+
/** The Call-ID of the REGISTER that last wrote the binding. */
|
|
822
|
+
call_id?: string;
|
|
823
|
+
/** The CSeq number of the REGISTER that last wrote the binding. */
|
|
824
|
+
cseq?: number;
|
|
825
|
+
}
|
|
826
|
+
/**
|
|
827
|
+
* The `payload` of a `RegistrationChanged` event (`events: [registration]`).
|
|
828
|
+
* A gap in `seq` means events were lost: call
|
|
829
|
+
* {@link import("./sip").SipClient.registrations} and apply only events numbered
|
|
830
|
+
* above its `seq`.
|
|
831
|
+
*/
|
|
832
|
+
interface RegistrationChangedPayload {
|
|
833
|
+
/** Per-process number, one higher per event published. */
|
|
834
|
+
seq?: number;
|
|
835
|
+
/**
|
|
836
|
+
* The server process's boot epoch, new at every start: `seq` restarts with
|
|
837
|
+
* it, so a changed epoch means the numbers began again. An identifier, not an
|
|
838
|
+
* order; `null` without a registrar identity.
|
|
839
|
+
*/
|
|
840
|
+
instance_epoch?: string | null;
|
|
841
|
+
aor: string;
|
|
842
|
+
/**
|
|
843
|
+
* `registered`, `refreshed`, `deregistered`, `expired` or `snapshot` (a
|
|
844
|
+
* re-report after the server's event task fell behind, not a change).
|
|
845
|
+
*/
|
|
846
|
+
event: string;
|
|
847
|
+
/** The AoR's bindings now; empty once it has none. */
|
|
848
|
+
contacts: RegistrationContact[];
|
|
849
|
+
}
|
|
850
|
+
/** The reply of `registrations`, one page in AoR order. */
|
|
851
|
+
interface RegistrationsReply {
|
|
852
|
+
/** Every event numbered at or below this is reflected here; across pages keep the first's. */
|
|
853
|
+
seq: number;
|
|
854
|
+
/**
|
|
855
|
+
* The server process's boot epoch, new at every start: `seq` restarts with
|
|
856
|
+
* it, so a changed epoch means the numbers began again. An identifier, not an
|
|
857
|
+
* order; `null` without a registrar identity.
|
|
858
|
+
*/
|
|
859
|
+
instance_epoch?: string | null;
|
|
860
|
+
/** The registered AoRs of this page; over the whole set, one not listed has no binding. */
|
|
861
|
+
registrations: {
|
|
862
|
+
aor: string;
|
|
863
|
+
contacts: RegistrationContact[];
|
|
864
|
+
}[];
|
|
865
|
+
/** The `after` that asks for the next page; `null` on the last. */
|
|
866
|
+
next?: string | null;
|
|
867
|
+
}
|
|
868
|
+
/** One outbound registration (a REGISTER the server sends upstream). */
|
|
869
|
+
interface OutboundRegistration {
|
|
870
|
+
aor: string;
|
|
871
|
+
/** The registrar it registers with; `null` once removed. */
|
|
872
|
+
registrar: string | null;
|
|
873
|
+
/**
|
|
874
|
+
* `unregistered`, `registering`, `challenging`, `registered`, `failed` or
|
|
875
|
+
* `awaiting_address` (it needs an address of its own and has none); `null`
|
|
876
|
+
* once removed.
|
|
877
|
+
*/
|
|
878
|
+
state: string | null;
|
|
879
|
+
/** Seconds left on the granted binding, `0` when none. */
|
|
880
|
+
expires_in: number;
|
|
881
|
+
/** Consecutive failed attempts. */
|
|
882
|
+
failure_count: number;
|
|
883
|
+
/** The status of the last failed attempt, `null` once one succeeded. */
|
|
884
|
+
status_code: number | null;
|
|
885
|
+
}
|
|
886
|
+
/** The `payload` of a `RegistrantChanged` event (`events: [outbound_registration]`). */
|
|
887
|
+
interface RegistrantChangedPayload extends OutboundRegistration {
|
|
888
|
+
/** Per-process number, its own sequence. */
|
|
889
|
+
seq?: number;
|
|
890
|
+
/**
|
|
891
|
+
* The server process's boot epoch, new at every start: `seq` restarts with
|
|
892
|
+
* it, so a changed epoch means the numbers began again. An identifier, not an
|
|
893
|
+
* order; `null` without a registrar identity.
|
|
894
|
+
*/
|
|
895
|
+
instance_epoch?: string | null;
|
|
896
|
+
/** `registered`, `refreshed`, `failed`, `deregistered`, `awaiting_address` or `snapshot`. */
|
|
897
|
+
event: string;
|
|
898
|
+
}
|
|
899
|
+
/** The reply of `outbound_registrations`, paged like {@link RegistrationsReply}. */
|
|
900
|
+
interface OutboundRegistrationsReply {
|
|
901
|
+
seq: number;
|
|
902
|
+
/**
|
|
903
|
+
* The server process's boot epoch, new at every start: `seq` restarts with
|
|
904
|
+
* it, so a changed epoch means the numbers began again. An identifier, not an
|
|
905
|
+
* order; `null` without a registrar identity.
|
|
906
|
+
*/
|
|
907
|
+
instance_epoch?: string | null;
|
|
908
|
+
registrations: OutboundRegistration[];
|
|
909
|
+
/** The `after` that asks for the next page; `null` on the last. */
|
|
910
|
+
next?: string | null;
|
|
911
|
+
}
|
|
783
912
|
/**
|
|
784
913
|
* Whether an event name ends a `dial`. Exactly one `DialAnswered` or
|
|
785
914
|
* `DialFailed` arrives per dial, so this is the signal to stop waiting;
|
|
@@ -1002,7 +1131,9 @@ interface CallEvent {
|
|
|
1002
1131
|
/**
|
|
1003
1132
|
* An application-level event: pushed to every connection of an app that opted
|
|
1004
1133
|
* into its class (`control.apps[].events`), about the deployment rather than a
|
|
1005
|
-
* channel — `RegistrationChanged`, `
|
|
1134
|
+
* channel — `RegistrationChanged`, `RegistrantChanged`, `DialogStateChanged`
|
|
1135
|
+
* (cast `payload` to {@link import("./protocol").RegistrationChangedPayload},
|
|
1136
|
+
* {@link import("./protocol").RegistrantChangedPayload} or
|
|
1006
1137
|
* {@link import("./protocol").DialogStateChangedPayload}). Its frame has no
|
|
1007
1138
|
* channel, so it reaches {@link SipClient.onAppEvent}, never a call.
|
|
1008
1139
|
*/
|
|
@@ -1022,6 +1153,58 @@ interface ResponseOptions {
|
|
|
1022
1153
|
reason?: string;
|
|
1023
1154
|
body?: string;
|
|
1024
1155
|
contentType?: string;
|
|
1156
|
+
/**
|
|
1157
|
+
* Host siphon presents in its own `Contact` toward the caller, in place of
|
|
1158
|
+
* the address it advertises, for a peer that identifies the tenant or
|
|
1159
|
+
* account by that host. Only the host changes, and every later Contact
|
|
1160
|
+
* siphon presents the caller carries it. Fixed once an 18x or 2xx went out:
|
|
1161
|
+
* the same host again is accepted, another rejects with `invalid_state`.
|
|
1162
|
+
*/
|
|
1163
|
+
contactHost?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* User part siphon presents in its own `Contact` toward the caller, which is
|
|
1166
|
+
* otherwise userless (`<sip:trunk-7@sbc.example.net:5061;transport=tls>`),
|
|
1167
|
+
* for a peer that keys the account on the Contact user. An RFC 3261 SIP URI
|
|
1168
|
+
* user; the server refuses an empty or invalid one with `bad_request`. Fixed
|
|
1169
|
+
* as `contactHost` is: another one after an 18x or 2xx rejects with
|
|
1170
|
+
* `invalid_state`.
|
|
1171
|
+
*/
|
|
1172
|
+
contactUser?: string;
|
|
1173
|
+
}
|
|
1174
|
+
/** Options for {@link Call.ring}. */
|
|
1175
|
+
interface RingOptions {
|
|
1176
|
+
/**
|
|
1177
|
+
* Host siphon presents in its own `Contact` toward the caller, in place of
|
|
1178
|
+
* the address it advertises, for a peer that identifies the tenant or
|
|
1179
|
+
* account by that host. Only the host changes, and every later Contact
|
|
1180
|
+
* siphon presents the caller carries it. Fixed once an 18x or 2xx went out:
|
|
1181
|
+
* the same host again is accepted, another rejects with `invalid_state`.
|
|
1182
|
+
*/
|
|
1183
|
+
contactHost?: string;
|
|
1184
|
+
/**
|
|
1185
|
+
* User part siphon presents in its own `Contact` toward the caller, which is
|
|
1186
|
+
* otherwise userless (`<sip:trunk-7@sbc.example.net:5061;transport=tls>`),
|
|
1187
|
+
* for a peer that keys the account on the Contact user. An RFC 3261 SIP URI
|
|
1188
|
+
* user; the server refuses an empty or invalid one with `bad_request`. Fixed
|
|
1189
|
+
* as `contactHost` is: another one after an 18x or 2xx rejects with
|
|
1190
|
+
* `invalid_state`.
|
|
1191
|
+
*/
|
|
1192
|
+
contactUser?: string;
|
|
1193
|
+
}
|
|
1194
|
+
/** Options for {@link Call.route}. */
|
|
1195
|
+
interface RouteOptions {
|
|
1196
|
+
/**
|
|
1197
|
+
* Host of siphon's own `Contact` toward the caller, as `contactHost` is on
|
|
1198
|
+
* {@link Call.answer}. Each target's `contactHost` is the host its attempt
|
|
1199
|
+
* presents the carrier.
|
|
1200
|
+
*/
|
|
1201
|
+
callerContactHost?: string;
|
|
1202
|
+
/**
|
|
1203
|
+
* User part of siphon's own `Contact` toward the caller, as `contactUser` is
|
|
1204
|
+
* on {@link Call.answer}. Each target's `contactUser` is the user its
|
|
1205
|
+
* attempt presents the carrier.
|
|
1206
|
+
*/
|
|
1207
|
+
callerContactUser?: string;
|
|
1025
1208
|
}
|
|
1026
1209
|
/** Options for an anchored answer ({@link Call.answerAnchored}). */
|
|
1027
1210
|
interface AnchoredAnswerOptions {
|
|
@@ -1038,6 +1221,10 @@ interface AnchoredAnswerOptions {
|
|
|
1038
1221
|
* `callId`.
|
|
1039
1222
|
*/
|
|
1040
1223
|
wsUri?: string;
|
|
1224
|
+
/** Host of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
|
|
1225
|
+
contactHost?: string;
|
|
1226
|
+
/** User part of siphon's own `Contact` toward the caller; see {@link ResponseOptions}. */
|
|
1227
|
+
contactUser?: string;
|
|
1041
1228
|
}
|
|
1042
1229
|
/** The RFC 3891 `Replaces` triple for an attended transfer. */
|
|
1043
1230
|
interface ReferReplaces {
|
|
@@ -1166,6 +1353,22 @@ interface RouteTargetObject {
|
|
|
1166
1353
|
* {@link DialTarget}'s `route`.
|
|
1167
1354
|
*/
|
|
1168
1355
|
route?: string[];
|
|
1356
|
+
/**
|
|
1357
|
+
* Host siphon presents in its own `Contact` on this attempt, in place of the
|
|
1358
|
+
* address it advertises. See {@link DialTarget}'s `contactHost`.
|
|
1359
|
+
*/
|
|
1360
|
+
contactHost?: string;
|
|
1361
|
+
/**
|
|
1362
|
+
* User part siphon presents in its own `Contact` on this attempt, which is
|
|
1363
|
+
* otherwise userless. See {@link DialTarget}'s `contactUser`.
|
|
1364
|
+
*/
|
|
1365
|
+
contactUser?: string;
|
|
1366
|
+
/**
|
|
1367
|
+
* Verify (`true`) or not (`false`) the server certificate when this attempt
|
|
1368
|
+
* opens a new outbound TLS connection. See {@link DialTarget}'s
|
|
1369
|
+
* `verifyServer`.
|
|
1370
|
+
*/
|
|
1371
|
+
verifyServer?: boolean;
|
|
1169
1372
|
}
|
|
1170
1373
|
/**
|
|
1171
1374
|
* One entry in a {@link Call.route} target list: a bare URI string, or a
|
|
@@ -1248,6 +1451,20 @@ interface OriginateOptions {
|
|
|
1248
1451
|
* has configured runs, if any.
|
|
1249
1452
|
*/
|
|
1250
1453
|
sessionTimer?: SessionTimer;
|
|
1454
|
+
/**
|
|
1455
|
+
* Host siphon presents in its own `Contact` on the call (on every leg of an
|
|
1456
|
+
* {@link SipClient.originateAor}), in place of the address it advertises,
|
|
1457
|
+
* for a peer that identifies the tenant or account by that host. Only the
|
|
1458
|
+
* host changes, and every in-dialog request on the call presents it too.
|
|
1459
|
+
*/
|
|
1460
|
+
contactHost?: string;
|
|
1461
|
+
/**
|
|
1462
|
+
* User part siphon presents in its own `Contact` on the call (on every leg
|
|
1463
|
+
* of an {@link SipClient.originateAor}), which is otherwise userless, for a
|
|
1464
|
+
* peer that keys the account on the Contact user. An RFC 3261 SIP URI user;
|
|
1465
|
+
* the server refuses anything else with `bad_request`.
|
|
1466
|
+
*/
|
|
1467
|
+
contactUser?: string;
|
|
1251
1468
|
}
|
|
1252
1469
|
/**
|
|
1253
1470
|
* How {@link SipClient.originateAor} rings the phones registered at an AoR.
|
|
@@ -1338,6 +1555,60 @@ type DialTarget = {
|
|
|
1338
1555
|
* it (TS 24.229 §5.7.5.2.1); `Route` cannot ride `headers`.
|
|
1339
1556
|
*/
|
|
1340
1557
|
route?: string[];
|
|
1558
|
+
/**
|
|
1559
|
+
* Host siphon presents in its own `Contact` on this branch, in place of
|
|
1560
|
+
* the address it advertises, for a peer that identifies the tenant or
|
|
1561
|
+
* account by that host. Only the host changes (port, transport and user
|
|
1562
|
+
* part stay siphon's), and siphon keeps it as the leg's dialog Contact,
|
|
1563
|
+
* so every in-dialog request on the leg presents it too. A hostname or an
|
|
1564
|
+
* IP address; the server refuses anything else with `bad_request`.
|
|
1565
|
+
*/
|
|
1566
|
+
contactHost?: string;
|
|
1567
|
+
/**
|
|
1568
|
+
* User part siphon presents in its own `Contact` on this branch, which is
|
|
1569
|
+
* otherwise userless (`<sip:trunk-7@sbc.example.net:5061;transport=tls>`),
|
|
1570
|
+
* for a peer that keys the account on the Contact user. Composes with
|
|
1571
|
+
* `contactHost`, sticks the same way, and outranks a script's
|
|
1572
|
+
* `call.set_contact_user()`. An RFC 3261 SIP URI user; the server
|
|
1573
|
+
* refuses anything else with `bad_request`.
|
|
1574
|
+
*/
|
|
1575
|
+
contactUser?: string;
|
|
1576
|
+
/**
|
|
1577
|
+
* Whether a sequential dial still moves on from this target once it has
|
|
1578
|
+
* rung (sent the far end's 101-199). Sent only when given; the server's
|
|
1579
|
+
* default is `true`, a hunt through phones moving on when one rings out
|
|
1580
|
+
* or is busy. `false` ends a sequential dial on this target once it has
|
|
1581
|
+
* rung: its ring timeout, busy or other failure is the dial's and no
|
|
1582
|
+
* later target is rung, for a hunt across several routes to the same
|
|
1583
|
+
* destination. A target that never rang, and a `503` carrying
|
|
1584
|
+
* `Retry-After`, still move the hunt on; a `6xx` ends a sequential dial
|
|
1585
|
+
* whatever this says. A parallel dial ignores it.
|
|
1586
|
+
*/
|
|
1587
|
+
rerouteAfterProgress?: boolean;
|
|
1588
|
+
/**
|
|
1589
|
+
* Media profile for this branch alone, over the dial's own. A target
|
|
1590
|
+
* without one inherits the dial's. One ring can then reach a phone behind
|
|
1591
|
+
* NAT that needs a latching relay and a trunk that asks for SDES-SRTP. An
|
|
1592
|
+
* unknown name fails the dial as an unknown dial-level `profile` does; a
|
|
1593
|
+
* connecting dial that names no `profile` anchors every branch or none, so
|
|
1594
|
+
* either every target names one or none does (a mix is `bad_request`).
|
|
1595
|
+
*/
|
|
1596
|
+
profile?: string;
|
|
1597
|
+
/**
|
|
1598
|
+
* When this branch's INVITE carries its SDP offer, over the dial's own
|
|
1599
|
+
* `offer` (see {@link DialOptions.offer}). Bridge dials only.
|
|
1600
|
+
*/
|
|
1601
|
+
offer?: DialOffer;
|
|
1602
|
+
/**
|
|
1603
|
+
* Verify (`true`) or not (`false`) the server certificate when this branch
|
|
1604
|
+
* opens a new outbound TLS connection, over the gateway it routes to and
|
|
1605
|
+
* the server's `tls.verify_server`: the chain against the server's
|
|
1606
|
+
* `tls.server_ca` (or its bundled public roots), and the host this branch
|
|
1607
|
+
* routes to (`nextHop`, else `uri`) as a SIP domain (RFC 5922 §7: exact
|
|
1608
|
+
* match, no wildcards), or its IP address for an IP-literal target. A
|
|
1609
|
+
* branch that fails is not sent. Unset leaves it to the server.
|
|
1610
|
+
*/
|
|
1611
|
+
verifyServer?: boolean;
|
|
1341
1612
|
} | {
|
|
1342
1613
|
/**
|
|
1343
1614
|
* The address of record to fork to its registered contacts. It takes no
|
|
@@ -1349,7 +1620,28 @@ type DialTarget = {
|
|
|
1349
1620
|
headers?: Record<string, string>;
|
|
1350
1621
|
/** Called party for every branch the AoR expands to (see the URI form). */
|
|
1351
1622
|
to?: string;
|
|
1623
|
+
/** Host of siphon's own `Contact` on every branch the AoR expands to (see the URI form). */
|
|
1624
|
+
contactHost?: string;
|
|
1625
|
+
/** User part of siphon's own `Contact` on every branch the AoR expands to (see the URI form). */
|
|
1626
|
+
contactUser?: string;
|
|
1627
|
+
/** `rerouteAfterProgress` for every branch the AoR expands to (see the URI form). */
|
|
1628
|
+
rerouteAfterProgress?: boolean;
|
|
1629
|
+
/** Media profile for every branch the AoR expands to (see the URI form). */
|
|
1630
|
+
profile?: string;
|
|
1631
|
+
/** When every branch the AoR expands to carries its offer (see the URI form). */
|
|
1632
|
+
offer?: DialOffer;
|
|
1633
|
+
/** Server certificate verification on every branch the AoR expands to (see the URI form). */
|
|
1634
|
+
verifyServer?: boolean;
|
|
1352
1635
|
};
|
|
1636
|
+
/**
|
|
1637
|
+
* When a phone an `onAnswer: "bridge"` dial rings is sent its SDP offer:
|
|
1638
|
+
* `"delayed"` (the server's default) sends the INVITE offerless and the phone
|
|
1639
|
+
* offers in its 2xx; `"early"` sends an offer the media engine allocated from
|
|
1640
|
+
* the caller's media under the phone's profile, for peers that refuse a
|
|
1641
|
+
* delayed-offer INVITE. The phone then answers in its 2xx (one without SDP
|
|
1642
|
+
* fails that branch with 488) and only the caller is re-INVITEd at the bridge.
|
|
1643
|
+
*/
|
|
1644
|
+
type DialOffer = "early" | "delayed";
|
|
1353
1645
|
/**
|
|
1354
1646
|
* Optional shaping for {@link Call.dial}; anything left out takes the server's
|
|
1355
1647
|
* own default rather than a copy of it pinned here.
|
|
@@ -1425,6 +1717,28 @@ interface DialOptions {
|
|
|
1425
1717
|
* (`bad_request`, `requires_bridge`).
|
|
1426
1718
|
*/
|
|
1427
1719
|
ringback?: string | boolean;
|
|
1720
|
+
/**
|
|
1721
|
+
* Host of siphon's own `Contact` toward the caller, as `contactHost` is on
|
|
1722
|
+
* {@link Call.answer}; each target's `contactHost` is the host its leg
|
|
1723
|
+
* presents. On a bridging dial, whose caller is answered already, it can
|
|
1724
|
+
* only repeat the host that answer carried (another rejects with
|
|
1725
|
+
* `invalid_state`).
|
|
1726
|
+
*/
|
|
1727
|
+
callerContactHost?: string;
|
|
1728
|
+
/**
|
|
1729
|
+
* User part of siphon's own `Contact` toward the caller, as `contactUser` is
|
|
1730
|
+
* on {@link Call.answer}; each target's `contactUser` is the user its leg
|
|
1731
|
+
* presents. On a bridging dial it can only repeat what the answer carried.
|
|
1732
|
+
*/
|
|
1733
|
+
callerContactUser?: string;
|
|
1734
|
+
/**
|
|
1735
|
+
* When each phone of an `onAnswer: "bridge"` dial is sent its offer, where
|
|
1736
|
+
* its target names none ({@link DialOffer}). Bridge-only: naming it, on the
|
|
1737
|
+
* dial or on a target, without `onAnswer: "bridge"` throws a `TypeError`
|
|
1738
|
+
* before anything is sent, since the server refuses it on a connecting dial
|
|
1739
|
+
* (`bad_request`, `requires_bridge`).
|
|
1740
|
+
*/
|
|
1741
|
+
offer?: DialOffer;
|
|
1428
1742
|
}
|
|
1429
1743
|
/**
|
|
1430
1744
|
* What the server answers an accepted `dial` with: the INVITEs are on the wire
|
|
@@ -1453,6 +1767,8 @@ interface Dialing {
|
|
|
1453
1767
|
totalTimeout?: number;
|
|
1454
1768
|
/** The ringback in force on a bridge dial (a preset or cadence, or `false`). */
|
|
1455
1769
|
ringback?: string | boolean;
|
|
1770
|
+
/** The offer mode of a bridge dial's phones, where a target names none. */
|
|
1771
|
+
offer?: DialOffer;
|
|
1456
1772
|
/** The phone INVITEs a bridge dial built, one per branch. */
|
|
1457
1773
|
branches?: DialBranchPayload[];
|
|
1458
1774
|
}
|
|
@@ -1646,7 +1962,7 @@ declare class Call {
|
|
|
1646
1962
|
* then {@link Call.answer}; open an early-media path with
|
|
1647
1963
|
* {@link Call.progress}.
|
|
1648
1964
|
*/
|
|
1649
|
-
ring(reason?: string): Promise<void>;
|
|
1965
|
+
ring(reason?: string, options?: RingOptions): Promise<void>;
|
|
1650
1966
|
/**
|
|
1651
1967
|
* Send a UAS 1xx, optionally opening an early-media path with SDP (default
|
|
1652
1968
|
* `183 Session Progress`). For plain alerting use {@link Call.ring}.
|
|
@@ -1738,7 +2054,7 @@ declare class Call {
|
|
|
1738
2054
|
*
|
|
1739
2055
|
* `targets` is a non-empty list of carriers tried cheapest-first: each entry
|
|
1740
2056
|
* is a bare URI string or a {@link RouteTargetObject}
|
|
1741
|
-
* (`{uri, nextHop?, headers?, timeout?, rerouteAfterProgress?, route?}`). A target
|
|
2057
|
+
* (`{uri, nextHop?, headers?, timeout?, rerouteAfterProgress?, route?, contactHost?, contactUser?}`). A target
|
|
1742
2058
|
* that has shown progress keeps the call past its `timeout` unless it sets
|
|
1743
2059
|
* `rerouteAfterProgress`. `strategy` defaults to
|
|
1744
2060
|
* `"sequential"` (v1 supports only sequential/single — anything else rejects
|
|
@@ -1749,7 +2065,7 @@ declare class Call {
|
|
|
1749
2065
|
* empty / invalid `targets` list rejects with `code === "bad_request"`; a call
|
|
1750
2066
|
* that is already gone rejects with `code === "not_found"`.
|
|
1751
2067
|
*/
|
|
1752
|
-
route(targets: RouteTarget[], strategy?: string, headers?: Record<string, string
|
|
2068
|
+
route(targets: RouteTarget[], strategy?: string, headers?: Record<string, string>, options?: RouteOptions): Promise<unknown>;
|
|
1753
2069
|
/**
|
|
1754
2070
|
* Ring `targets` as B-legs while the caller stays **unanswered** and this
|
|
1755
2071
|
* application keeps the channel.
|
|
@@ -2084,6 +2400,21 @@ declare class SipClient {
|
|
|
2084
2400
|
run(): Promise<void>;
|
|
2085
2401
|
/** Fetch the registered adapters' schema (`describe`). */
|
|
2086
2402
|
describe(): Promise<unknown>;
|
|
2403
|
+
/**
|
|
2404
|
+
* Everything the registrar holds now and the `seq` it is current to
|
|
2405
|
+
* (`registrations`; the app must subscribe to `registration`). Fetches every
|
|
2406
|
+
* page and merges them, keeping the first page's `seq`. Ask on connecting
|
|
2407
|
+
* and whenever a `RegistrationChanged` `seq` skips a number: replace your
|
|
2408
|
+
* copy with the reply and apply only events numbered above it.
|
|
2409
|
+
*/
|
|
2410
|
+
registrations(): Promise<RegistrationsReply>;
|
|
2411
|
+
/**
|
|
2412
|
+
* Every outbound registration's state and its `seq`
|
|
2413
|
+
* (`outbound_registrations`; the app must subscribe to `outbound_registration`).
|
|
2414
|
+
* Fetches every page, as {@link SipClient.registrations} does.
|
|
2415
|
+
*/
|
|
2416
|
+
outboundRegistrations(): Promise<OutboundRegistrationsReply>;
|
|
2417
|
+
private everyPage;
|
|
2087
2418
|
/**
|
|
2088
2419
|
* Place an outbound call under a caller-supplied channel id.
|
|
2089
2420
|
*
|
|
@@ -2170,4 +2501,4 @@ declare class SipServer {
|
|
|
2170
2501
|
close(): Promise<void>;
|
|
2171
2502
|
}
|
|
2172
2503
|
|
|
2173
|
-
export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, RESYNC, type RecordChannels, type RecordDirection, type RecordOptions, type Recording, type ReferReplaces, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
|
|
2504
|
+
export { type AcceptReferOptions, type AnchoredAnswerOptions, type AppEvent, type AppEventHandler, type BridgeFailedPayload, type BridgeOptions, type BridgeRole, type BridgeStage, Call, type CallEvent, type CallHandler, CallStream, type ChannelBridgedPayload, type ChannelDtmfPayload, type ChannelSnapshot, type ChannelUnbridgedPayload, type ClientConfig, type ClientEvent, type CommandTransport, type ConnectionEventSink, ControlClient, ControlError, type ControlErrorCode, type ControlErrorKind, ControlServer, DESCRIBE, type DialAnsweredPayload, type DialBranchCause, type DialBranchOutcome, type DialBranchPayload, type DialFailedPayload, type DialOffer, type DialOptions, type DialTarget, type Dialing, type DialogDirection, type DialogIdentity, type DialogState, type DialogStateChangedPayload, type DtmfOptions, type EventFrame, type EventSink, EventStream, type FrameType, GET_VAR, HELLO, type HelloArgs, type HelloResult, MODULE_SIP, MODULE_SMPP, MODULE_SS7, type MediaLegSummary, type MediaStartedPayload, type MediaSummaryPayload, OUTBOUND_REGISTRATIONS, type OriginateMedia, type OriginateOptions, type OriginateRing, type OriginatedGroup, type OutboundRegistration, type OutboundRegistrationsReply, PROTOCOL_VERSION, type PeerHangupPolicy, type PlayFinishedPayload, type PlayOptions, type PlaySource, type PlayStartedPayload, REGISTRATIONS, RESYNC, type RecordChannels, type RecordDirection, type RecordOptions, type Recording, type ReferReplaces, type RegistrantChangedPayload, type RegistrationChangedPayload, type RegistrationContact, type RegistrationsReply, type ReplyError, type ReplyFrame, type ReplyStatus, type ResponseOptions, type ResyncResult, type RingOptions, type RouteOptions, type RouteTarget, type RouteTargetObject, SET_VAR, SUBPROTOCOL, type ServerConfig, type SessionRefresher, type SessionTimer, SipClient, type SipEventKind, SipServer, SipVerb, type SipVerbToken, type StreamMode, type StreamOptions, type StreamStopOptions, type TransferOutcomePayload, type TransferReplaces, type TransferRequestedPayload, type TransferStage, type TransferTimedOutPayload, type WsBridgeEndedPayload, type WsBridgeStartedPayload, type WsTeeEndedPayload, type WsTeeStartedPayload, dialArgs, encodeCommand, isBridgeFinal, isDialFinal, isTransferFinal, originateAorArgs, originateArgs, parseInboundFrame, recordStartArgs, recordStopArgs, sipEventKind, transferOutcome };
|