@dialstack/sdk-react 3.9.0 → 3.10.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.
@@ -134,14 +134,14 @@ declare function useCallDuration(call: Call | null, intervalMs?: number): string
134
134
  * `useEmergencyBinding` — the Softphone's built-in E911 provisioning logic.
135
135
  *
136
136
  * Model: "always send it, the server decides." The server binds the presented
137
- * emergency address to the connection's network at the `authenticate` handshake
138
- * and is the authority on whether it's valid here — it rejects a mismatch via
139
- * the `network.changed` signal.
137
+ * emergency address to the connection's network, at the `authenticate` handshake
138
+ * or in-band on the open socket, and is the authority on whether it's valid
139
+ * here — it rejects a mismatch via the `network.changed` signal.
140
140
  *
141
141
  * - On connect, if the session has a saved address but presented none (fresh
142
- * browser), auto-present it (select + reconnect once). Same network → the
143
- * server binds it silently (reused). Different network → the server denies
144
- * (network.changed) → we prompt.
142
+ * browser), auto-present it (one in-band rebind). Same network → the server
143
+ * binds it silently (reused). Different network → the server denies
144
+ * (network.changed) → we prompt. Live calls are unaffected either way.
145
145
  * - `bound` is true unless the server denied (network.changed) or there is no
146
146
  * saved address to present at all.
147
147
  *
@@ -164,15 +164,15 @@ interface UseEmergencyBinding {
164
164
  bound: boolean;
165
165
  /** Saved addresses to offer as "Are you here?" choices. */
166
166
  savedAddresses: EmergencyAddress[];
167
- /** True while an address submit (confirm/create, which forces a reconnect) is in flight. */
167
+ /** True while an address submit (confirm/create) is in flight. */
168
168
  submitting: boolean;
169
169
  /** Last error (e.g. a carrier rejection). */
170
170
  error: string | null;
171
171
  /** Called from the Softphone when the phone emits `network.changed` (denied). */
172
172
  onNetworkChanged: () => void;
173
- /** Confirm an existing saved address for this network (selects + reconnects). */
173
+ /** Confirm an existing saved address for this network (clears its anchor + rebinds). */
174
174
  confirm: (id: string) => Promise<void>;
175
- /** Create + validate a new address, then bind it (reconnect). */
175
+ /** Create + validate a new address, then bind it. */
176
176
  create: (input: EmergencyAddressInput) => Promise<void>;
177
177
  }
178
178
 
@@ -215,9 +215,11 @@ interface PeerInfo {
215
215
  };
216
216
  }
217
217
  /**
218
- * Looks up the remote party of a call; may be async. Called once per call for
219
- * each resolver identity, so pass a new function (e.g. `useCallback` over the
220
- * data it reads) when its answers would change, and keep it stable otherwise.
218
+ * Looks up the remote party of a call; may be async. Called once per remote
219
+ * number for each resolver identity: calls to or from the same number share
220
+ * the answer, so base it on the number, and a call whose other party changes
221
+ * is asked about again. Pass a new function (e.g. `useCallback` over the data
222
+ * it reads) when its answers would change, and keep it stable otherwise.
221
223
  * A `null`/`undefined` result, a rejection or a throw all leave the call on the
222
224
  * default display (caller-id name, else the number).
223
225
  */
@@ -311,6 +313,14 @@ declare function sanitizeDestination(value: string, defaultCountry?: CountryCode
311
313
  * state shows which label, without forcing a shared i18n table.
312
314
  */
313
315
  declare function callStateLabelKey(state: CallState): keyof Locale['softphone'];
316
+ /**
317
+ * The in-call status line: "Reconnecting…" while the signalling socket is down
318
+ * and the call is being resumed, the call state otherwise.
319
+ */
320
+ declare function callStatusLabelKey(call: {
321
+ state: CallState;
322
+ isReconnecting: boolean;
323
+ }): keyof Locale['softphone'];
314
324
  declare function errorMessageKey(code: string): keyof Locale['softphone'];
315
325
  /**
316
326
  * One entry of the host's directory, offered when transferring or adding a
@@ -489,6 +499,11 @@ interface SoftphoneContextBase {
489
499
  * has entries.
490
500
  */
491
501
  directory: readonly DirectoryContact[];
502
+ /**
503
+ * The name for a call's number, or null: the host's `directory` first, then
504
+ * the account's users when they are listed, matched in `defaultCountry`.
505
+ */
506
+ peerName: (number: string) => string | null;
492
507
  }
493
508
 
494
509
  /**
@@ -595,7 +610,8 @@ interface SoftphoneProviderProps {
595
610
  * off. Each user is dialled on their first extension; users without one are
596
611
  * left out. Presence is watched for the first 100 (the server's limit); the
597
612
  * rest are listed without a status. A `directory` entry whose `id` is a
598
- * user's id replaces them in the list and keeps their presence.
613
+ * user's id replaces them in the list and keeps their presence. Listed
614
+ * users also name calls to and from their extensions.
599
615
  */
600
616
  accountDirectory?: boolean;
601
617
  /**
@@ -757,5 +773,5 @@ declare const OngoingCall: React.FC;
757
773
 
758
774
  declare const EmergencyBanner: React.FC;
759
775
 
760
- export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
776
+ export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, callStatusLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
761
777
  export type { DialPadProps, DirectoryContact, PeerInfo, ResolvePeer, SoftphoneConnectionState, SoftphoneContextValue, SoftphoneError, SoftphoneLayoutVariant, SoftphoneProps, SoftphoneProviderProps, SoftphoneScreen, UseCallActions, UseCallActionsOptions, UseDialInput, UseLastError };
@@ -134,14 +134,14 @@ declare function useCallDuration(call: Call | null, intervalMs?: number): string
134
134
  * `useEmergencyBinding` — the Softphone's built-in E911 provisioning logic.
135
135
  *
136
136
  * Model: "always send it, the server decides." The server binds the presented
137
- * emergency address to the connection's network at the `authenticate` handshake
138
- * and is the authority on whether it's valid here — it rejects a mismatch via
139
- * the `network.changed` signal.
137
+ * emergency address to the connection's network, at the `authenticate` handshake
138
+ * or in-band on the open socket, and is the authority on whether it's valid
139
+ * here — it rejects a mismatch via the `network.changed` signal.
140
140
  *
141
141
  * - On connect, if the session has a saved address but presented none (fresh
142
- * browser), auto-present it (select + reconnect once). Same network → the
143
- * server binds it silently (reused). Different network → the server denies
144
- * (network.changed) → we prompt.
142
+ * browser), auto-present it (one in-band rebind). Same network → the server
143
+ * binds it silently (reused). Different network → the server denies
144
+ * (network.changed) → we prompt. Live calls are unaffected either way.
145
145
  * - `bound` is true unless the server denied (network.changed) or there is no
146
146
  * saved address to present at all.
147
147
  *
@@ -164,15 +164,15 @@ interface UseEmergencyBinding {
164
164
  bound: boolean;
165
165
  /** Saved addresses to offer as "Are you here?" choices. */
166
166
  savedAddresses: EmergencyAddress[];
167
- /** True while an address submit (confirm/create, which forces a reconnect) is in flight. */
167
+ /** True while an address submit (confirm/create) is in flight. */
168
168
  submitting: boolean;
169
169
  /** Last error (e.g. a carrier rejection). */
170
170
  error: string | null;
171
171
  /** Called from the Softphone when the phone emits `network.changed` (denied). */
172
172
  onNetworkChanged: () => void;
173
- /** Confirm an existing saved address for this network (selects + reconnects). */
173
+ /** Confirm an existing saved address for this network (clears its anchor + rebinds). */
174
174
  confirm: (id: string) => Promise<void>;
175
- /** Create + validate a new address, then bind it (reconnect). */
175
+ /** Create + validate a new address, then bind it. */
176
176
  create: (input: EmergencyAddressInput) => Promise<void>;
177
177
  }
178
178
 
@@ -215,9 +215,11 @@ interface PeerInfo {
215
215
  };
216
216
  }
217
217
  /**
218
- * Looks up the remote party of a call; may be async. Called once per call for
219
- * each resolver identity, so pass a new function (e.g. `useCallback` over the
220
- * data it reads) when its answers would change, and keep it stable otherwise.
218
+ * Looks up the remote party of a call; may be async. Called once per remote
219
+ * number for each resolver identity: calls to or from the same number share
220
+ * the answer, so base it on the number, and a call whose other party changes
221
+ * is asked about again. Pass a new function (e.g. `useCallback` over the data
222
+ * it reads) when its answers would change, and keep it stable otherwise.
221
223
  * A `null`/`undefined` result, a rejection or a throw all leave the call on the
222
224
  * default display (caller-id name, else the number).
223
225
  */
@@ -311,6 +313,14 @@ declare function sanitizeDestination(value: string, defaultCountry?: CountryCode
311
313
  * state shows which label, without forcing a shared i18n table.
312
314
  */
313
315
  declare function callStateLabelKey(state: CallState): keyof Locale['softphone'];
316
+ /**
317
+ * The in-call status line: "Reconnecting…" while the signalling socket is down
318
+ * and the call is being resumed, the call state otherwise.
319
+ */
320
+ declare function callStatusLabelKey(call: {
321
+ state: CallState;
322
+ isReconnecting: boolean;
323
+ }): keyof Locale['softphone'];
314
324
  declare function errorMessageKey(code: string): keyof Locale['softphone'];
315
325
  /**
316
326
  * One entry of the host's directory, offered when transferring or adding a
@@ -489,6 +499,11 @@ interface SoftphoneContextBase {
489
499
  * has entries.
490
500
  */
491
501
  directory: readonly DirectoryContact[];
502
+ /**
503
+ * The name for a call's number, or null: the host's `directory` first, then
504
+ * the account's users when they are listed, matched in `defaultCountry`.
505
+ */
506
+ peerName: (number: string) => string | null;
492
507
  }
493
508
 
494
509
  /**
@@ -595,7 +610,8 @@ interface SoftphoneProviderProps {
595
610
  * off. Each user is dialled on their first extension; users without one are
596
611
  * left out. Presence is watched for the first 100 (the server's limit); the
597
612
  * rest are listed without a status. A `directory` entry whose `id` is a
598
- * user's id replaces them in the list and keeps their presence.
613
+ * user's id replaces them in the list and keeps their presence. Listed
614
+ * users also name calls to and from their extensions.
599
615
  */
600
616
  accountDirectory?: boolean;
601
617
  /**
@@ -757,5 +773,5 @@ declare const OngoingCall: React.FC;
757
773
 
758
774
  declare const EmergencyBanner: React.FC;
759
775
 
760
- export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
776
+ export { DIAL_COUNTRY, DialPad, EmergencyBanner, IncomingCall, IncomingStack, OngoingCall, Softphone, SoftphoneProvider, callPeerName, callPeerNumber, callStateLabelKey, callStatusLabelKey, errorMessageKey, formatCallDuration, formatDisplayNumber, isCallActive, isIncomingRinging, sanitizeDestination, selectScreen, shouldRingIncoming, stripToDialString, useActiveCall, useCallActions, useCallDuration, useDialInput, useIncomingCall, useLastError, useSoftphone };
761
777
  export type { DialPadProps, DirectoryContact, PeerInfo, ResolvePeer, SoftphoneConnectionState, SoftphoneContextValue, SoftphoneError, SoftphoneLayoutVariant, SoftphoneProps, SoftphoneProviderProps, SoftphoneScreen, UseCallActions, UseCallActionsOptions, UseDialInput, UseLastError };