@siphon-project/control 0.12.0 → 0.13.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/index.d.cts CHANGED
@@ -238,6 +238,13 @@ declare const SipVerb: {
238
238
  readonly RecordStart: "record_start";
239
239
  /** Stop one recording by id, or every recording on the call. */
240
240
  readonly RecordStop: "record_stop";
241
+ /**
242
+ * Accept a recording session (a channel whose `StasisStart` has
243
+ * `kind: "siprec"`): siphon answers the recording client 200 and records each
244
+ * stream. {@link SipVerb.Reject} refuses one; neither within the handoff
245
+ * deadline refuses it `503`.
246
+ */
247
+ readonly Accept: "accept";
241
248
  };
242
249
  /** A value of {@link SipVerb}. */
243
250
  type SipVerbToken = (typeof SipVerb)[keyof typeof SipVerb];
@@ -1821,6 +1828,22 @@ type RecordChannels = "mono" | "stereo";
1821
1828
  * write Ogg Opus refuses the verb.
1822
1829
  */
1823
1830
  type RecordFormat = "wav" | "ogg_opus";
1831
+ /** How an accepted recording session is recorded ({@link Call.acceptRecording}). */
1832
+ interface RecordingAcceptOptions {
1833
+ /** A media profile in place of `srs.rtpengine_profile`. */
1834
+ profile?: string;
1835
+ /** The file format; unset is `wav`. */
1836
+ format?: RecordFormat;
1837
+ /** Opus target bitrate (`ogg_opus` only). */
1838
+ bitrateBps?: number;
1839
+ /**
1840
+ * `"stereo"` writes a two-stream session as one file, a participant per
1841
+ * channel; unset or `"mono"` is a file per stream.
1842
+ */
1843
+ channels?: "mono" | "stereo";
1844
+ /** An absolute directory siphon writes the files to; it names them. */
1845
+ path?: string;
1846
+ }
1824
1847
  /** Optional shaping for {@link Call.recordStart}. */
1825
1848
  interface RecordOptions {
1826
1849
  /** Which side to record (`"ingress"` server-side when unset). */
@@ -2026,6 +2049,13 @@ declare class Call {
2026
2049
  * `183 Session Progress`). For plain alerting use {@link Call.ring}.
2027
2050
  */
2028
2051
  progress(options?: ResponseOptions): Promise<void>;
2052
+ /**
2053
+ * Accept a recording session (`StasisStart` with `kind: "siprec"`): siphon
2054
+ * answers the recording client and records each stream as `options` say.
2055
+ * Unset fields take siphon's `srs:` configuration. Refuse one with
2056
+ * {@link Call.reject}.
2057
+ */
2058
+ acceptRecording(options?: RecordingAcceptOptions): Promise<void>;
2029
2059
  /** Send a final non-2xx and tear the call down. */
2030
2060
  reject(code: number, reason?: string): Promise<void>;
2031
2061
  /**
@@ -2560,4 +2590,4 @@ declare class SipServer {
2560
2590
  close(): Promise<void>;
2561
2591
  }
2562
2592
 
2563
- 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 MediaFlags, 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 RecordFormat, 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 };
2593
+ 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 MediaFlags, 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 RecordFormat, type RecordOptions, type Recording, type RecordingAcceptOptions, 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 };
package/dist/index.d.ts CHANGED
@@ -238,6 +238,13 @@ declare const SipVerb: {
238
238
  readonly RecordStart: "record_start";
239
239
  /** Stop one recording by id, or every recording on the call. */
240
240
  readonly RecordStop: "record_stop";
241
+ /**
242
+ * Accept a recording session (a channel whose `StasisStart` has
243
+ * `kind: "siprec"`): siphon answers the recording client 200 and records each
244
+ * stream. {@link SipVerb.Reject} refuses one; neither within the handoff
245
+ * deadline refuses it `503`.
246
+ */
247
+ readonly Accept: "accept";
241
248
  };
242
249
  /** A value of {@link SipVerb}. */
243
250
  type SipVerbToken = (typeof SipVerb)[keyof typeof SipVerb];
@@ -1821,6 +1828,22 @@ type RecordChannels = "mono" | "stereo";
1821
1828
  * write Ogg Opus refuses the verb.
1822
1829
  */
1823
1830
  type RecordFormat = "wav" | "ogg_opus";
1831
+ /** How an accepted recording session is recorded ({@link Call.acceptRecording}). */
1832
+ interface RecordingAcceptOptions {
1833
+ /** A media profile in place of `srs.rtpengine_profile`. */
1834
+ profile?: string;
1835
+ /** The file format; unset is `wav`. */
1836
+ format?: RecordFormat;
1837
+ /** Opus target bitrate (`ogg_opus` only). */
1838
+ bitrateBps?: number;
1839
+ /**
1840
+ * `"stereo"` writes a two-stream session as one file, a participant per
1841
+ * channel; unset or `"mono"` is a file per stream.
1842
+ */
1843
+ channels?: "mono" | "stereo";
1844
+ /** An absolute directory siphon writes the files to; it names them. */
1845
+ path?: string;
1846
+ }
1824
1847
  /** Optional shaping for {@link Call.recordStart}. */
1825
1848
  interface RecordOptions {
1826
1849
  /** Which side to record (`"ingress"` server-side when unset). */
@@ -2026,6 +2049,13 @@ declare class Call {
2026
2049
  * `183 Session Progress`). For plain alerting use {@link Call.ring}.
2027
2050
  */
2028
2051
  progress(options?: ResponseOptions): Promise<void>;
2052
+ /**
2053
+ * Accept a recording session (`StasisStart` with `kind: "siprec"`): siphon
2054
+ * answers the recording client and records each stream as `options` say.
2055
+ * Unset fields take siphon's `srs:` configuration. Refuse one with
2056
+ * {@link Call.reject}.
2057
+ */
2058
+ acceptRecording(options?: RecordingAcceptOptions): Promise<void>;
2029
2059
  /** Send a final non-2xx and tear the call down. */
2030
2060
  reject(code: number, reason?: string): Promise<void>;
2031
2061
  /**
@@ -2560,4 +2590,4 @@ declare class SipServer {
2560
2590
  close(): Promise<void>;
2561
2591
  }
2562
2592
 
2563
- 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 MediaFlags, 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 RecordFormat, 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 };
2593
+ 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 MediaFlags, 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 RecordFormat, type RecordOptions, type Recording, type RecordingAcceptOptions, 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 };
package/dist/index.js CHANGED
@@ -159,7 +159,14 @@ var SipVerb = {
159
159
  /** Record the call's decoded audio to a wav file (siphon-rtp backend only). */
160
160
  RecordStart: "record_start",
161
161
  /** Stop one recording by id, or every recording on the call. */
162
- RecordStop: "record_stop"
162
+ RecordStop: "record_stop",
163
+ /**
164
+ * Accept a recording session (a channel whose `StasisStart` has
165
+ * `kind: "siprec"`): siphon answers the recording client 200 and records each
166
+ * stream. {@link SipVerb.Reject} refuses one; neither within the handoff
167
+ * deadline refuses it `503`.
168
+ */
169
+ Accept: "accept"
163
170
  };
164
171
  function sipEventKind(name) {
165
172
  return name;
@@ -1102,6 +1109,31 @@ var Call = class {
1102
1109
  async progress(options) {
1103
1110
  await this.sip(SipVerb.Progress, options ? responseArgs(options) : {});
1104
1111
  }
1112
+ /**
1113
+ * Accept a recording session (`StasisStart` with `kind: "siprec"`): siphon
1114
+ * answers the recording client and records each stream as `options` say.
1115
+ * Unset fields take siphon's `srs:` configuration. Refuse one with
1116
+ * {@link Call.reject}.
1117
+ */
1118
+ async acceptRecording(options = {}) {
1119
+ const args = {};
1120
+ if (options.profile !== void 0) {
1121
+ args.profile = options.profile;
1122
+ }
1123
+ if (options.format !== void 0) {
1124
+ args.format = options.format;
1125
+ }
1126
+ if (options.bitrateBps !== void 0) {
1127
+ args.bitrate_bps = options.bitrateBps;
1128
+ }
1129
+ if (options.channels !== void 0) {
1130
+ args.channels = options.channels;
1131
+ }
1132
+ if (options.path !== void 0) {
1133
+ args.path = options.path;
1134
+ }
1135
+ await this.sip(SipVerb.Accept, args);
1136
+ }
1105
1137
  /** Send a final non-2xx and tear the call down. */
1106
1138
  async reject(code, reason) {
1107
1139
  const args = { code };