sinch.domains.voice.helpers.v2.svaml package

class sinch.domains.voice.helpers.v2.svaml.Amd[source]

Bases: object

Helpers to build the Answering Machine Detection SVAML commands.

static activate(
*,
on_human: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_machine: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_beep: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_unknown: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
) → AmdCommandDict[source]

AMD (Answering Machine Detection) command to detect what answered the call. Possible outcomes are: human, machine, beep, or unknown.

This is a non-blocking command — the next command in the sequence executes immediately while detection runs in parallel. Results are delivered via events, which defines different call flows depending on whether a human, machine, beep, or unknown entity answers the call.

Parameters:
  • on_human (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a human is detected.

  • on_machine (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a machine is detected.

  • on_beep (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a beep is detected.

  • on_unknown (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when an unknown event is detected.

Returns:

The amd command.

Return type:

AmdCommandDict

class sinch.domains.voice.helpers.v2.svaml.Calls[source]

Bases: object

Helpers to build the call control SVAML commands.

static answer() → AnswerCommandDict[source]

Answers an inbound call leg. This is a non-blocking command — execution continues to the next command in the sequence immediately after the answer is initiated.

Returns:

The answer command.

Return type:

AnswerCommandDict

static bridge_call(
name: str,
) → BridgeCallCommandDict[source]

Adds the current call to a bridge, enabling bidirectional audio communication with other calls in the same session. This is a non-blocking command — execution continues to the next command in the sequence immediately after the call joins the bridge.

Bridges are created automatically when referenced by name. If a bridge with the specified name already exists, the call joins that bridge; otherwise, a new bridge is created.

Parameters:

name (str) – Name of the bridge to join. If no bridge with this name exists in the session, a new one is created automatically.

Returns:

The bridgeCall command.

Return type:

BridgeCallCommandDict

static dial(
to: str | PhoneDict | BaseSipDict | BaseStreamDict | SipDict | StreamDict | VoiceRelayDict,
*,
from_: str | PhoneDict | BaseSipDict | BaseStreamDict | SipFromDict | Unset = <sinch.core.sentinel.Unset object>,
name: str | Unset = <sinch.core.sentinel.Unset object>,
timeout_duration_seconds: int | Unset = <sinch.core.sentinel.Unset object>,
max_duration_seconds: int | Unset = <sinch.core.sentinel.Unset object>,
on_answer: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_busy: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_reject: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_timeout: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_hangup: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_failure: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
) → DialCommandDict[source]

Initiates a new outbound call leg within the current session.

This is a non-blocking command — the next command in the sequence executes immediately while the call is being established in parallel. Call lifecycle events (answer, busy, reject, timeout, hangup, failure) are handled via the events property.

The from and to endpoint types should ideally match. If they differ, the platform attempts to convert the from value to be compatible with the to type. For example, PSTN supports only E.164 phone numbers, so a SIP address such as sip:46701234567@acme.se can be converted to an E.164 number. If the from value cannot be converted, it defaults to null (anonymous).

Parameters:
  • to (Union[str, BaseCallDestinationDict, CallDestinationDict]) – Call destination: a phone number in E.164 format, a SIP URI, a WebSocket endpoint for real-time audio streaming or the Voice Relay service for real-time speech-to-text and text-to-speech. A string is parsed with Destination.of().

  • from (UnsetOr[Union[str, BaseCallDestinationDict, CallOriginDict]]) – Call origin: a phone number in E.164 format or a SIP URI. A string is parsed with Destination.of().

  • name (UnsetOr[str]) – Identifier for this call leg within the session. Must be unique across all active call legs in the session. Other commands (e.g., hangup) can reference this name to target this specific leg.

  • timeout_duration_seconds (UnsetOr[int]) – Maximum time in seconds to wait for the call to be answered. If the timeout expires without an answer, the onTimeout event is triggered.

  • max_duration_seconds (UnsetOr[int]) – Maximum duration of the call in seconds. The call is terminated automatically when this limit is reached.

  • on_answer (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is answered.

  • on_busy (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is busy.

  • on_reject (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is rejected.

  • on_timeout (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is timed out.

  • on_hangup (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is hung up.

  • on_failure (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call fails.

  • from_ (str | PhoneDict | BaseSipDict | BaseStreamDict | SipFromDict | Unset)

Returns:

The dial command.

Return type:

DialCommandDict

static hangup(
name: str | Unset = <sinch.core.sentinel.Unset object>,
) → HangupCommandDict[source]

Ends a call leg. This is a non-blocking command — execution continues to the next command in the sequence even though the call has been ended. The onHangup event is triggered for the call leg that was ended.

Any subsequent commands that target the ended call leg (such as messages or other media commands) are valid but will not be executed. Commands that operate independently — such as initiating a new call with dial — will execute normally. This makes it possible, for example, to end one call and immediately start another within the same sequence.

Parameters:

name (UnsetOr[str]) – Name of the call leg to end, as set by callName in the dial command. If omitted, the current call leg is ended.

Returns:

The hangup command.

Return type:

HangupCommandDict

static pause(
duration_milliseconds: int,
) → PauseCommandDict[source]

Delays execution of the next command in the sequence for a specified duration. This is a blocking command — no further commands execute until the pause completes.

The pause does not affect call audio; the call remains connected and audio continues uninterrupted.

Parameters:

duration_milliseconds (int) – Duration of the pause in milliseconds.

Returns:

The pause command.

Return type:

PauseCommandDict

class sinch.domains.voice.helpers.v2.svaml.CommandsSequenceCreator[source]

Bases: CommandsHolder, Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict]

Immutable fluent creator of a sequence of SVAML commands.

Each method takes the same parameters as the matching helper and returns a new creator with the command appended, so a creator can be reused as the prefix of several sequences.

A creator is a sequence of commands, so it can be passed wherever a sequence of commands is expected, such as commands or the on_* handlers, without calling build().

command(
command: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict,
) → CommandsSequenceCreator[source]

Appends a command, such as one built with a helper or by hand.

Parameters:

command (SvamlCommandDict) – The command to append.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

build() → List[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict][source]

Returns the commands as a list.

Returns:

The commands, in order.

Return type:

List[SvamlCommandDict]

Raises:

ValueError – If the start menu of a menu command or the target of one of its gotoMenu commands is not one of its menus.

answer

Answers an inbound call leg. This is a non-blocking command — execution continues to the next command in the sequence immediately after the answer is initiated.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

bridge_call

Adds the current call to a bridge, enabling bidirectional audio communication with other calls in the same session. This is a non-blocking command — execution continues to the next command in the sequence immediately after the call joins the bridge.

Bridges are created automatically when referenced by name. If a bridge with the specified name already exists, the call joins that bridge; otherwise, a new bridge is created.

Parameters:

name (str) – Name of the bridge to join. If no bridge with this name exists in the session, a new one is created automatically.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

dial

Initiates a new outbound call leg within the current session.

This is a non-blocking command — the next command in the sequence executes immediately while the call is being established in parallel. Call lifecycle events (answer, busy, reject, timeout, hangup, failure) are handled via the events property.

The from and to endpoint types should ideally match. If they differ, the platform attempts to convert the from value to be compatible with the to type. For example, PSTN supports only E.164 phone numbers, so a SIP address such as sip:46701234567@acme.se can be converted to an E.164 number. If the from value cannot be converted, it defaults to null (anonymous).

Parameters:
  • to (Union[str, BaseCallDestinationDict, CallDestinationDict]) – Call destination: a phone number in E.164 format, a SIP URI, a WebSocket endpoint for real-time audio streaming or the Voice Relay service for real-time speech-to-text and text-to-speech. A string is parsed with Destination.of().

  • from (UnsetOr[Union[str, BaseCallDestinationDict, CallOriginDict]]) – Call origin: a phone number in E.164 format or a SIP URI. A string is parsed with Destination.of().

  • name (UnsetOr[str]) – Identifier for this call leg within the session. Must be unique across all active call legs in the session. Other commands (e.g., hangup) can reference this name to target this specific leg.

  • timeout_duration_seconds (UnsetOr[int]) – Maximum time in seconds to wait for the call to be answered. If the timeout expires without an answer, the onTimeout event is triggered.

  • max_duration_seconds (UnsetOr[int]) – Maximum duration of the call in seconds. The call is terminated automatically when this limit is reached.

  • on_answer (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is answered.

  • on_busy (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is busy.

  • on_reject (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is rejected.

  • on_timeout (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is timed out.

  • on_hangup (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call is hung up.

  • on_failure (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when the call fails.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

hangup

Ends a call leg. This is a non-blocking command — execution continues to the next command in the sequence even though the call has been ended. The onHangup event is triggered for the call leg that was ended.

Any subsequent commands that target the ended call leg (such as messages or other media commands) are valid but will not be executed. Commands that operate independently — such as initiating a new call with dial — will execute normally. This makes it possible, for example, to end one call and immediately start another within the same sequence.

Parameters:

name (UnsetOr[str]) – Name of the call leg to end, as set by callName in the dial command. If omitted, the current call leg is ended.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

pause

Delays execution of the next command in the sequence for a specified duration. This is a blocking command — no further commands execute until the pause completes.

The pause does not affect call audio; the call remains connected and audio continues uninterrupted.

Parameters:

duration_milliseconds (int) – Duration of the pause in milliseconds.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

amd

AMD (Answering Machine Detection) command to detect what answered the call. Possible outcomes are: human, machine, beep, or unknown.

This is a non-blocking command — the next command in the sequence executes immediately while detection runs in parallel. Results are delivered via events, which defines different call flows depending on whether a human, machine, beep, or unknown entity answers the call.

Parameters:
  • on_human (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a human is detected.

  • on_machine (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a machine is detected.

  • on_beep (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when a beep is detected.

  • on_unknown (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to be executed when an unknown event is detected.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

custom_events

Triggers a mid-call event to the application backend, allowing it to return a new set of SVAML commands that control the remainder of the call flow.

This is a blocking command — execution pauses until a response is received from the event destination. The next command in the sequence runs only after the backend responds. Event requests use a 5-second timeout. If fallback_url is provided, a failed request is re-sent to it.

Parameters:
  • name (str) – Name for this custom event, between 1 and 64 characters, matching ^\S+$. When triggered, the event request’s event property contains this name prepended with call.customEvent..

  • url (str) – URL of the event destination to send the mid-call event to.

  • fallback_url (UnsetOr[str]) – Fallback URL used when the primary URL fails. A failed request is re-sent to this URL immediately. After repeated consecutive failures of the primary URL, requests are sent only here until the primary URL recovers.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

messages

Plays one or more messages on the call, sequentially in order. The messages are added right after with text, ssml and play, which add to this command until another method is called. Between 1 and 10 messages are required.

This is a non-blocking command — the next command in the sequence executes immediately while messages play in parallel.

Parameters:
  • name (UnsetOr[str]) – Name of the message sequence, between 1 and 32 characters, matching ^\S+$. Must be unique within the current call session. Can be referenced by stop_messages() to control this specific message sequence.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to execute when all messages in the sequence have finished playing.

Returns:

A new creator with the command appended.

Return type:

OpenMessagesStep

stop_messages

Stops a message sequence started by start(). It also cancels any messages with the same name that appear in the call session in the future.

This is a non-blocking command.

Parameters:

name (str) – Name of the message sequence to stop, as set by name in start(). Between 1 and 32 characters, matching ^\S+$.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

text

Plays a single text-to-speech message on the call. Shortcut for messages() with one Messages.text() message.

Parameters:
  • text (str) – The plain text to be synthesized into speech, at most 600 characters.

  • voice_name (Union[VoiceNameEnum, VoiceName]) – The name of the voice to use for text-to-speech synthesis. Use VoiceNameEnum to browse voices with their language, gender and pricing, or VoiceNameByLanguageEnum to browse them grouped by language.

  • name (UnsetOr[str]) – Name of the message sequence, between 1 and 32 characters, matching ^\S+$. Must be unique within the current call session. Can be referenced by stop_messages() to control this specific message sequence.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to execute when the message has finished playing.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

play

Plays a single audio file on the call. Shortcut for messages() with one Messages.play() message.

Parameters:
  • url (str) – URL of the media to play.

  • name (UnsetOr[str]) – Name of the message sequence, between 1 and 32 characters, matching ^\S+$. Must be unique within the current call session. Can be referenced by stop_messages() to control this specific message sequence.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to execute when the message has finished playing.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

recording

Starts recording the call. This is a non-blocking command — execution continues to the next command in the sequence immediately after recording begins.

Parameters:
  • options (RecordingOptionsDict) – Recording options for this recording, built with options().

  • name (UnsetOr[str]) – Identifier for this recording within the session, between 1 and 32 characters, matching ^\S+$. Must be unique across active recordings in the session. Setting the recording name is useful for stopping the recording with stop(). If name is not set, recording can only be stopped when the call is disconnected.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – Commands to execute when the recording is successfully stopped. Note that this does not mean that the file is delivered to the configured destination yet.

  • on_failure (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – Commands to execute if the recording fails to start. If omitted, failures are silently ignored and the call flow continues.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

stop_recording

Stops a recording previously started by start(). This is a non-blocking command — execution continues to the next command in the sequence immediately after the stop is initiated.

Parameters:

name (str) – Name of the recording to stop, as set by name in start(). Between 1 and 32 characters, matching ^\S+$.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

menu

Defines a set of named menus and executes them starting from name. The menus are added right after with item. At least one menu is required.

This is a blocking command — execution waits for the menu to complete before proceeding to the next command.

Parameters:

name (str) – Name of the menu to execute first, between 1 and 16 characters. Must match the name of one of the menus.

Returns:

A new creator with the command appended.

Return type:

OpenMenuStep

goto_menu

Switches execution to another menu within the current menu context. The menu name must be a menu defined in the menu command. This is a blocking command — execution waits for the menu to complete before proceeding to the next command.

This command can only be used within a menu execution context, in the matches or on_failure of a item().

Parameters:

name (str) – Name of the target menu to execute next, between 1 and 16 characters. Must match the name of one of the items of the menu.

Returns:

A new creator with the command appended.

Return type:

CommandsSequenceCreator

class sinch.domains.voice.helpers.v2.svaml.CustomEvents[source]

Bases: object

Helpers to build the custom event SVAML commands.

static trigger(
name: str,
url: str,
*,
fallback_url: str | Unset = <sinch.core.sentinel.Unset object>,
) → CustomEventCommandDict[source]

Triggers a mid-call event to the application backend, allowing it to return a new set of SVAML commands that control the remainder of the call flow.

This is a blocking command — execution pauses until a response is received from the event destination. The next command in the sequence runs only after the backend responds. Event requests use a 5-second timeout. If fallback_url is provided, a failed request is re-sent to it.

Parameters:
  • name (str) – Name for this custom event, between 1 and 64 characters, matching ^\S+$. When triggered, the event request’s event property contains this name prepended with call.customEvent..

  • url (str) – URL of the event destination to send the mid-call event to.

  • fallback_url (UnsetOr[str]) – Fallback URL used when the primary URL fails. A failed request is re-sent to this URL immediately. After repeated consecutive failures of the primary URL, requests are sent only here until the primary URL recovers.

Returns:

The customEvent command.

Return type:

CustomEventCommandDict

class sinch.domains.voice.helpers.v2.svaml.Menu[source]

Bases: object

Helpers to build the menu SVAML commands.

static create(
name: str,
item: NamedMenuItemDict,
*items: NamedMenuItemDict,
) → MenuCommandDict[source]

Defines a set of named menus and executes them starting from name. This is a blocking command — execution waits for the menu to complete before proceeding to the next command.

Each menu item configures prompts, input collection, timeout handling, and repeat behavior.

Parameters:
  • name (str) – Name of the menu to execute first, between 1 and 16 characters. Must match the name of one of the menu items.

  • item (NamedMenuItemDict) – First menu definition, built with item().

  • items (NamedMenuItemDict) – Further menu definitions. Menu names must be unique.

Returns:

The menu command.

Return type:

MenuCommandDict

Raises:

ValueError – If a menu name is duplicated, or if name or the target of a goto() is not one of the menu items.

static item(
name: str,
*,
prompt: MenuPromptDict | Unset = <sinch.core.sentinel.Unset object>,
repeat_prompt: MenuPromptDict | Unset = <sinch.core.sentinel.Unset object>,
input_timeout_duration_seconds: int | Unset = <sinch.core.sentinel.Unset object>,
repeat_count: int | Unset = <sinch.core.sentinel.Unset object>,
minimum_input_length: int | Unset = <sinch.core.sentinel.Unset object>,
maximum_input_length: int | Unset = <sinch.core.sentinel.Unset object>,
terminating_sequence: str | Unset = <sinch.core.sentinel.Unset object>,
input_methods: List[Literal['DTMF'] | str] | Unset = <sinch.core.sentinel.Unset object>,
matches: Mapping[str,
~collections.abc.Sequence[~sinch.domains.voice.models.v2.svaml.types.amd_command_dict.AmdCommandDict | ~sinch.domains.voice.models.v2.svaml.types.dial_command_dict.DialCommandDict | ~sinch.domains.voice.models.v2.svaml.types.messages_command_dict.MessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_messages_command_dict.StopMessagesCommandDict | ~sinch.domains.voice.models.v2.svaml.types.custom_event_command_dict.CustomEventCommandDict | ~sinch.domains.voice.models.v2.svaml.types.hangup_command_dict.HangupCommandDict | ~sinch.domains.voice.models.v2.svaml.types.answer_command_dict.AnswerCommandDict | ~sinch.domains.voice.models.v2.svaml.types.pause_command_dict.PauseCommandDict | ~sinch.domains.voice.models.v2.svaml.types.start_recording_command_dict.StartRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.stop_recording_command_dict.StopRecordingCommandDict | ~sinch.domains.voice.models.v2.svaml.types.bridge_call_command_dict.BridgeCallCommandDict | ~sinch.domains.voice.models.v2.svaml.types.menu_command_dict.MenuCommandDict | ~sinch.domains.voice.models.v2.svaml.types.goto_menu_command_dict.GotoMenuCommandDict]] | ~sinch.core.sentinel.Unset=<sinch.core.sentinel.Unset object>,
on_failure: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
) → NamedMenuItemDict[source]

Defines a single menu step, including prompts, input handling rules, input-to-command matches, and failure handling.

Each collected input is matched against the values in matches. If no match succeeds, the on_failure commands are executed.

If no match succeeds and on_failure is not defined, a call.menu event including the collected input is sent to the event destination when the service call behavior is EVENT_DESTINATION.

Parameters:
  • name (str) – Name of the menu, between 1 and 16 characters. Used as the start menu in create() and as the target of goto().

  • prompt (UnsetOr[MenuPromptDict]) – Prompt played when this menu starts. This prompt is also used as the repeat prompt when repeat_prompt is not defined for the menu.

  • repeat_prompt (UnsetOr[MenuPromptDict]) – Prompt played when the menu is repeated. Repeats occur when input times out or when the provided input does not match any menu match item.

  • input_timeout_duration_seconds (UnsetOr[int]) – Maximum number of seconds to wait for user input before the input attempt times out, between 1 and 60. Defaults to 5.

  • repeat_count (UnsetOr[int]) – Maximum number of times the menu is repeated, between 0 and 10. A repeat occurs when input times out or when the provided input does not match any menu match item. Defaults to 2.

  • minimum_input_length (UnsetOr[int]) – Minimum number of input characters required before the menu evaluates the collected input, between 1 and 100. Defaults to 1.

  • maximum_input_length (UnsetOr[int]) – Maximum number of input characters that triggers the menu to evaluate the collected input, between 1 and 100. Defaults to 1.

  • terminating_sequence (UnsetOr[str]) – Character sequence that signals the end of input and triggers immediate evaluation, at most 10 characters, matching ^[0-9*#]+$. Useful when variable-length input is allowed and shorter valid options should be submitted without waiting for timeout or maximum length. The terminating sequence value is included in the evaluated input.

  • input_methods (UnsetOr[List[Union[Literal["DTMF"], str]]]) –

    Input methods accepted for this menu when collecting user input. Defaults to ["DTMF"].

    • DTMF: Collect input from keypad tones (Dual-Tone Multi-Frequency).

  • matches (UnsetOr[Mapping[str, Sequence[SvamlCommandDict]]]) – Items matched against the collected input, at most 50. Each key is a literal or a regular expression string, between 1 and 256 characters, and its value is the SVAML commands to execute. Keys are evaluated sequentially in the order defined; the first key that matches the input triggers its commands. Use \* to match the DTMF star tone (*).

  • on_failure (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands executed when the menu fails to collect a matching input. This handler runs after the repeat limit is reached without any input matching a menu match item.

Returns:

The named menu item.

Return type:

NamedMenuItemDict

static prompt(
message: SayMessageDict | PlayMessageDict,
*messages: SayMessageDict | PlayMessageDict,
allow_barge_in: bool | Unset = <sinch.core.sentinel.Unset object>,
) → MenuPromptDict[source]

Prompt configuration for menu playback, including prompt messages and barge-in behavior.

Parameters:
  • message (MessageDict) – First message to play, built with Messages.text(), Messages.ssml() or Messages.play().

  • messages (MessageDict) – Further messages to play in order, up to 10 messages in total.

  • allow_barge_in (UnsetOr[bool]) – Controls whether input can interrupt prompt playback. When enabled, playback stops as soon as input is detected and the input is evaluated immediately if matching conditions are met. When disabled, input is still collected during playback and evaluated after playback finishes. Defaults to True.

Returns:

The menu prompt.

Return type:

MenuPromptDict

static goto(
name: str,
) → GotoMenuCommandDict[source]

Switches execution to another menu within the current menu context. The menu name must be a menu defined in the menu command. This is a blocking command — execution waits for the menu to complete before proceeding to the next command.

This command can only be used within a menu execution context, in the matches or on_failure of a item().

Parameters:

name (str) – Name of the target menu to execute next, between 1 and 16 characters. Must match the name of one of the items of the menu.

Returns:

The gotoMenu command.

Return type:

GotoMenuCommandDict

class sinch.domains.voice.helpers.v2.svaml.Messages[source]

Bases: object

Helpers to build the message playback SVAML commands.

static text(
text: str,
voice_name: VoiceNameEnum | Literal['Aarav', 'Aarav_2', 'Aarohi', 'Aarti', 'Aarti_2', 'Aarti_3', 'Aashi', 'Abbi', 'Abdullah', 'Abeo', 'Abril', 'Achara', 'Ada', 'Ada_2', 'Adam', 'Adam_2', 'Aditi', 'Adri', 'Adriano', 'Agnieszka', 'Ahmet', 'Aigul', 'Ainhoa', 'Alain', 'Alba', 'Aled', 'Aleksandar', 'Alessio', 'Alessio_2', 'Alex', 'Alfie', 'Ali', 'Alina', 'Alloy', 'Alloy_2', 'Alonso', 'Alvaro', 'Amal', 'Amala', 'Amanda', 'Amany', 'Amber', 'Ambre', 'Ameha', 'Amina', 'Amy', 'Amy_2', 'Amy_3', 'Ana', 'Anahit', 'Ananya', 'Ananya_2', 'Anbu', 'Ander', 'Andre', 'Andre_2', 'Andrea', 'Andres', 'Andrew', 'Andrew_2', 'Andrew_3', 'Andrew_4', 'Angelo', 'Anila', 'Annette', 'Antoine', 'Antonin', 'Antonio', 'Anu', 'Aoi', 'Arabella', 'Ardi', 'Aria', 'Aria_2', 'Ariane', 'Arjun', 'Arjun_2', 'Arjun_3', 'Arlet', 'Arnau', 'Arnaud', 'Arthur', 'Arya', 'Arya_2', 'Asad', 'Ashley', 'Asilia', 'Astrid', 'Athina', 'Ava', 'Ava_2', 'Ava_3', 'Avri', 'Ayanda', 'Ayanda_2', 'Aysha', 'Babek', 'Banu', 'Bashkar', 'Bassel', 'Bataa', 'Beatrice', 'Beatriz', 'Belkys', 'Bella', 'Benigno', 'Bernd', 'Bianca', 'Bianca_2', 'Bianca_3', 'Blessica', 'BongJin', 'Borislav', 'Brandon', 'Brandon_2', 'Bree', 'Brenda', 'Brian', 'Brian_2', 'Brian_3', 'Brigitte', 'Bryan', 'Bryan_2', 'Bryan_3', 'Burcu', 'Calimero', 'Camila', 'Camilla', 'Camilla_2', 'Camilla_3', 'Candela', 'Carla', 'Carlos', 'Carlota', 'Carly', 'Carmen', 'Cataldo', 'Catalina', 'Cecilio', 'Celeste', 'Celine', 'Celine_2', 'Chantal', 'Chanthavong', 'Charline', 'Chilemba', 'Christel', 'Christoph', 'Christopher', 'Christopher_2', 'Clara', 'Claude', 'Colette', 'Colm', 'Conchita', 'Connor', 'Conrad', 'Cora', 'Cora_2', 'Coralie', 'Cristiano', 'Daichi', 'Dalia', 'Dalia_2', 'Daniel', 'Daniel_2', 'Danielle', 'Danielle_2', 'Dario', 'Dariya', 'Darren', 'Daudi', 'Daulet', 'Davis', 'Davis_2', 'Davis_3', 'Dena', 'Denise', 'Derek', 'Dhwani', 'Diego', 'Dilara', 'Dimas', 'Dmitry', 'Donato', 'Dora', 'Duarte', 'Duncan', 'Dustin', 'Echo', 'Eka', 'Elena', 'Elias', 'Elimu', 'Elin', 'Elizabeth', 'Elke', 'Elliot', 'Eloise', 'Elsa', 'Elsie', 'Elvira', 'Elza', 'Emel', 'Emil', 'Emilio', 'Emily', 'Emma', 'Emma_2', 'Emma_3', 'Emma_4', 'Enric', 'Enrique', 'Eric', 'Estrella', 'Ethan', 'Evelyn', 'Everita', 'Ewa', 'Ewa_2', 'Ezinne', 'Fabio', 'Fabiola', 'Fable', 'Fabrice', 'Fahed', 'Farid', 'Fatima', 'Federico', 'Fenna', 'Fernanda', 'Fiamma', 'Filiz', 'Finn', 'Florian', 'Florian_2', 'Florin', 'Francisca', 'Freya', 'Gabrielle', 'Gabrielle_2', 'Gabrijela', 'Gadis', 'Gagan', 'Gemma', 'Gemma_2', 'Geraint', 'Gerard', 'Gerardo', 'Gianni', 'Giorgi', 'Giorgio', 'Giovanna', 'Gisela', 'Giuseppe', 'Giuseppe_2', 'Gonzalo', 'GookMin', 'Goran', 'Grace', 'Gregory', 'Gudrun', 'Gul', 'GulNawaz', 'Gunnar', 'Guy', 'Gwyneth', 'Hala', 'Hamdan', 'Hamed', 'Hannah', 'Hannah_2', 'Hans', 'Harri', 'Hayk', 'Hedi', 'Hemkala', 'Henri', 'Hila', 'Hillevi', 'HiuGaai', 'Hiujin', 'HiuMaan', 'HoaiMy', 'Hollie', 'HsiaoChen', 'HsiaoYu', 'Humberto', 'Hyunsu', 'Hyunsu_2', 'Hyunsu_3', 'Ida', 'Ilir', 'Iman', 'Imani', 'Imelda', 'Ines', 'Ines_2', 'Ingrid', 'InJoon', 'Irene', 'Irma', 'Isabella', 'Isabella_2', 'Isabella_3', 'Isabelle', 'Isabelle_2', 'Iselin', 'Isidora', 'Ismael', 'Ivy', 'Ivy_2', 'Jacek', 'Jacob', 'Jacqueline', 'Jajang', 'Jamal', 'James', 'Jan', 'Jane', 'Jane_2', 'Jann', 'Jasmine', 'Jasmine_2', 'Jason', 'Javier', 'Jean', 'Jenny', 'Jenny_2', 'Jenny_3', 'Jeppe', 'Jerome', 'Jihye', 'JiMin', 'Jimmie', 'Jitka', 'Joana', 'Joanna', 'Joanna_2', 'Joanna_3', 'Joanne', 'Joey', 'Joey_2', 'Jonas', 'Jorge', 'Jorge_2', 'Joseph', 'Josephine', 'Juan', 'Julio', 'Justin', 'Justin_2', 'Kai', 'Kajal', 'Kajal_2', 'Kalina', 'Kani', 'Karina', 'Karl', 'Karla', 'Kasper', 'Katja', 'Kavya', 'Kavya_2', 'Kazuha', 'Keita', 'Ken', 'Kendra', 'Kendra_2', 'Keomany', 'Kert', 'Kevin', 'Killian', 'Kim', 'Kimberly', 'Kimberly_2', 'Klarissa', 'Klaus', 'Kumar', 'Kunal', 'Kunal_2', 'Laia', 'Laila', 'Laith', 'Larissa', 'Latifa', 'Laura', 'Laura_2', 'Layla', 'Lea', 'Lea_2', 'Lea_3', 'Leah', 'Leila', 'Leni', 'Lennart', 'Leonas', 'Leticia', 'Lewis', 'Lia', 'Liam', 'Lian', 'Lian_2', 'Libby', 'Liberto', 'Lisa', 'Lisa_2', 'Lisandro', 'Liv', 'Livia', 'Livia_2', 'Lola', 'Lorena', 'Lorenzio', 'Lorenzo', 'Lotte', 'Louisa', 'Lucia', 'Lucia_2', 'Lucia_3', 'Luciano', 'Lucien', 'Luis', 'Lukas', 'Luke', 'Luna', 'Luna_2', 'Lupe', 'Lupe_2', 'Lupe_3', 'Maarten', 'Macerio', 'Macerio_2', 'Madhur', 'Madina', 'Mads', 'Maisie', 'Maja', 'Manohar', 'Manuel', 'Manuela', 'Marcello', 'Marcelo', 'Marek', 'Margarita', 'Maria', 'Marija', 'Marina', 'Mario', 'Marlene', 'Marta', 'Maryam', 'Masaru', 'Mateo', 'Mathieu', 'Matthew', 'Matthew_2', 'Matthew_3', 'Mattias', 'Maurice', 'Maxim', 'Maya', 'Mayu', 'Mekdes', 'Mia', 'Mia_2', 'Mia_3', 'Michelle', 'Midhun', 'Miguel', 'Mitchell', 'Mizuki', 'Moaz', 'Mohan', 'Molly', 'Monica', 'Mouna', 'Muuse', 'Nabanita', 'Naja', 'NamMinh', 'Nanami', 'Nanami_2', 'Nancy', 'Nancy_2', 'Naoki', 'Natasha', 'Neerja', 'Neerja_2', 'Neil', 'Nestoras', 'Nia', 'Niamh', 'Niamh_2', 'Nicholas', 'Nicholas_2', 'Nicolau', 'Nicole', 'Nil', 'Nilar', 'Nils', 'Niranjan', 'Niwat', 'Noah', 'Noemi', 'Noora', 'Noura', 'Nova', 'Nova_2', 'Nuria', 'Ojas', 'Ola', 'Ola_2', 'Oliver', 'Olivia', 'Ollie', 'Ollie_2', 'Omar', 'Ona', 'Onyx', 'Orla', 'Osman', 'Ostap', 'Pallavi', 'Palmira', 'Paloma', 'Paola', 'Pedro', 'Pedro_2', 'Pelayo', 'Penelope', 'Pernille', 'Petra', 'Phoebe', 'Phoebe_2', 'Pierina', 'Piseth', 'Polina', 'Prabhat', 'Prabhat_2', 'Pradeep', 'Premwadee', 'Priyom', 'Rafiki', 'Ralf', 'Rami', 'Ramona', 'Rana', 'Raquel', 'Raveena', 'Reem', 'Rehaan', 'Rehaan_2', 'Rehema', 'Remi', 'Remi_2', 'Remy', 'Remy_2', 'Renata', 'Ricardo', 'Rinaldo', 'Roberto', 'Rodrigo', 'Roger', 'Roi', 'Rok', 'Rosa', 'Ruben', 'Russell', 'Ruth', 'Ruth_2', 'Ryan', 'Ryan_2', 'Sabela', 'Sabrina', 'Sabrina_2', 'Sagar', 'Saleh', 'Salli', 'Salli_2', 'Salli_3', 'Salma', 'Salman', 'Salome', 'Sam', 'Sameera', 'Samuel', 'Sana', 'Sapna', 'Sara', 'Saranya', 'Sardor', 'Saul', 'Sebastian', 'Selma', 'SeoHyeon', 'Seoyeon', 'Seoyeon_2', 'Seoyeon_3', 'Seraphina', 'Seraphina_2', 'Serena', 'Serena_2', 'Sergio', 'Sergio_2', 'Shakir', 'Shimmer', 'Shiori', 'Shruti', 'Siqiniq', 'Siqiniq_2', 'Siti', 'Sobhana', 'Soffie', 'Sofia', 'Sofie', 'Sonia', 'SoonBok', 'Sophie', 'Sophie_2', 'Srecko', 'Sreymom', 'Steffan', 'Steffan_2', 'Steffan_3', 'Stephen', 'Stephen_2', 'Subhasini', 'Sukant', 'SunHi', 'SunHi_2', 'Surya', 'Suvi', 'Svetlana', 'Swara', 'Sylvie', 'Sylvie_2', 'Taim', 'Takumi', 'Takumi_2', 'Tamas', 'Tania', 'Tanishaa', 'Tanja', 'Taqqiq', 'Taqqiq_2', 'Tatyana', 'Teo', 'Teresa', 'Thalita', 'Thalita_2', 'Thalita_3', 'Thando', 'Themba', 'Thiago', 'Thierry', 'Thierry_2', 'Thiha', 'Thilini', 'Thomas', 'Tiana', 'Tiffany', 'Tim', 'Tina', 'Tomas', 'Tomoko', 'Tony', 'Triana', 'Tristan', 'Tristan_ES', 'Tristan_ES_2', 'Tuti', 'Tyler', 'Ubax', 'Uzma', 'Vaani', 'Valentina', 'Valerio', 'Valluvar', 'Venba', 'Vera', 'Vesna', 'Vicki', 'Vicki_2', 'Vicki_3', 'Victor', 'Viktoria', 'Vitoria', 'Vitoria_2', 'Vivienne', 'Vivienne_2', 'Vlasta', 'WanLung', 'Wayne', 'Willem', 'William', 'William_2', 'Xiaochen', 'Xiaochen_2', 'Xiaochen_3', 'Xiaochen_4', 'Xiaohan', 'Xiaohan_2', 'Xiaomeng', 'XiaoMin', 'Xiaomo', 'Xiaoqiu', 'Xiaorou', 'Xiaorui', 'Xiaoshuang', 'Xiaoshuang_2', 'Xiaoshuang_3', 'Xiaotong', 'Xiaoxiao', 'Xiaoxiao_2', 'Xiaoxiao_3', 'Xiaoxiao_4', 'Xiaoxiao_5', 'Xiaoyan', 'Xiaoyi', 'Xiaoyi_2', 'Xiaoyou', 'Xiaoyou_2', 'Xiaoyou_3', 'Xiaoyu', 'Xiaoyu_2', 'Xiaozhen', 'Ximena', 'Ximena_ES', 'Ximena_ES_2', 'Ximena_ES_3', 'Yago', 'Yan', 'Yara', 'Yashica', 'Yasmin', 'Yesui', 'Yolanda', 'YuJin', 'Yundeng', 'Yunfan', 'Yunfan_2', 'Yunfeng', 'Yunhan', 'Yunhao', 'YunJhe', 'Yunjian', 'Yunjie', 'YunSong', 'Yunxi', 'Yunxi_2', 'Yunxia', 'Yunxia_2', 'Yunxiang', 'Yunxiao', 'Yunxiao_2', 'Yunyang', 'Yunye', 'Yunye_2', 'Yunyi', 'Yunyi_2', 'Yunze', 'Yunzhe', 'Yves', 'Yvette', 'Zariyah', 'Zayd', 'Zeina', 'Zhiyu', 'Zhiyu_2', 'Zofia', 'Zuri'] | Annotated[str, Strict(strict=True)],
) → SayMessageDict[source]

A text-to-speech (TTS) message item. The platform synthesizes the provided plain text into speech and plays it on the call.

Parameters:
  • text (str) – The plain text to be synthesized into speech, at most 600 characters.

  • voice_name (Union[VoiceNameEnum, VoiceName]) – The name of the voice to use for text-to-speech synthesis. Use VoiceNameEnum to browse voices with their language, gender and pricing, or VoiceNameByLanguageEnum to browse them grouped by language.

Returns:

The SAY message, in TEXT format.

Return type:

SayMessageDict

static ssml(
ssml: str,
voice_name: VoiceNameEnum | Literal['Aarav', 'Aarav_2', 'Aarohi', 'Aarti', 'Aarti_2', 'Aarti_3', 'Aashi', 'Abbi', 'Abdullah', 'Abeo', 'Abril', 'Achara', 'Ada', 'Ada_2', 'Adam', 'Adam_2', 'Aditi', 'Adri', 'Adriano', 'Agnieszka', 'Ahmet', 'Aigul', 'Ainhoa', 'Alain', 'Alba', 'Aled', 'Aleksandar', 'Alessio', 'Alessio_2', 'Alex', 'Alfie', 'Ali', 'Alina', 'Alloy', 'Alloy_2', 'Alonso', 'Alvaro', 'Amal', 'Amala', 'Amanda', 'Amany', 'Amber', 'Ambre', 'Ameha', 'Amina', 'Amy', 'Amy_2', 'Amy_3', 'Ana', 'Anahit', 'Ananya', 'Ananya_2', 'Anbu', 'Ander', 'Andre', 'Andre_2', 'Andrea', 'Andres', 'Andrew', 'Andrew_2', 'Andrew_3', 'Andrew_4', 'Angelo', 'Anila', 'Annette', 'Antoine', 'Antonin', 'Antonio', 'Anu', 'Aoi', 'Arabella', 'Ardi', 'Aria', 'Aria_2', 'Ariane', 'Arjun', 'Arjun_2', 'Arjun_3', 'Arlet', 'Arnau', 'Arnaud', 'Arthur', 'Arya', 'Arya_2', 'Asad', 'Ashley', 'Asilia', 'Astrid', 'Athina', 'Ava', 'Ava_2', 'Ava_3', 'Avri', 'Ayanda', 'Ayanda_2', 'Aysha', 'Babek', 'Banu', 'Bashkar', 'Bassel', 'Bataa', 'Beatrice', 'Beatriz', 'Belkys', 'Bella', 'Benigno', 'Bernd', 'Bianca', 'Bianca_2', 'Bianca_3', 'Blessica', 'BongJin', 'Borislav', 'Brandon', 'Brandon_2', 'Bree', 'Brenda', 'Brian', 'Brian_2', 'Brian_3', 'Brigitte', 'Bryan', 'Bryan_2', 'Bryan_3', 'Burcu', 'Calimero', 'Camila', 'Camilla', 'Camilla_2', 'Camilla_3', 'Candela', 'Carla', 'Carlos', 'Carlota', 'Carly', 'Carmen', 'Cataldo', 'Catalina', 'Cecilio', 'Celeste', 'Celine', 'Celine_2', 'Chantal', 'Chanthavong', 'Charline', 'Chilemba', 'Christel', 'Christoph', 'Christopher', 'Christopher_2', 'Clara', 'Claude', 'Colette', 'Colm', 'Conchita', 'Connor', 'Conrad', 'Cora', 'Cora_2', 'Coralie', 'Cristiano', 'Daichi', 'Dalia', 'Dalia_2', 'Daniel', 'Daniel_2', 'Danielle', 'Danielle_2', 'Dario', 'Dariya', 'Darren', 'Daudi', 'Daulet', 'Davis', 'Davis_2', 'Davis_3', 'Dena', 'Denise', 'Derek', 'Dhwani', 'Diego', 'Dilara', 'Dimas', 'Dmitry', 'Donato', 'Dora', 'Duarte', 'Duncan', 'Dustin', 'Echo', 'Eka', 'Elena', 'Elias', 'Elimu', 'Elin', 'Elizabeth', 'Elke', 'Elliot', 'Eloise', 'Elsa', 'Elsie', 'Elvira', 'Elza', 'Emel', 'Emil', 'Emilio', 'Emily', 'Emma', 'Emma_2', 'Emma_3', 'Emma_4', 'Enric', 'Enrique', 'Eric', 'Estrella', 'Ethan', 'Evelyn', 'Everita', 'Ewa', 'Ewa_2', 'Ezinne', 'Fabio', 'Fabiola', 'Fable', 'Fabrice', 'Fahed', 'Farid', 'Fatima', 'Federico', 'Fenna', 'Fernanda', 'Fiamma', 'Filiz', 'Finn', 'Florian', 'Florian_2', 'Florin', 'Francisca', 'Freya', 'Gabrielle', 'Gabrielle_2', 'Gabrijela', 'Gadis', 'Gagan', 'Gemma', 'Gemma_2', 'Geraint', 'Gerard', 'Gerardo', 'Gianni', 'Giorgi', 'Giorgio', 'Giovanna', 'Gisela', 'Giuseppe', 'Giuseppe_2', 'Gonzalo', 'GookMin', 'Goran', 'Grace', 'Gregory', 'Gudrun', 'Gul', 'GulNawaz', 'Gunnar', 'Guy', 'Gwyneth', 'Hala', 'Hamdan', 'Hamed', 'Hannah', 'Hannah_2', 'Hans', 'Harri', 'Hayk', 'Hedi', 'Hemkala', 'Henri', 'Hila', 'Hillevi', 'HiuGaai', 'Hiujin', 'HiuMaan', 'HoaiMy', 'Hollie', 'HsiaoChen', 'HsiaoYu', 'Humberto', 'Hyunsu', 'Hyunsu_2', 'Hyunsu_3', 'Ida', 'Ilir', 'Iman', 'Imani', 'Imelda', 'Ines', 'Ines_2', 'Ingrid', 'InJoon', 'Irene', 'Irma', 'Isabella', 'Isabella_2', 'Isabella_3', 'Isabelle', 'Isabelle_2', 'Iselin', 'Isidora', 'Ismael', 'Ivy', 'Ivy_2', 'Jacek', 'Jacob', 'Jacqueline', 'Jajang', 'Jamal', 'James', 'Jan', 'Jane', 'Jane_2', 'Jann', 'Jasmine', 'Jasmine_2', 'Jason', 'Javier', 'Jean', 'Jenny', 'Jenny_2', 'Jenny_3', 'Jeppe', 'Jerome', 'Jihye', 'JiMin', 'Jimmie', 'Jitka', 'Joana', 'Joanna', 'Joanna_2', 'Joanna_3', 'Joanne', 'Joey', 'Joey_2', 'Jonas', 'Jorge', 'Jorge_2', 'Joseph', 'Josephine', 'Juan', 'Julio', 'Justin', 'Justin_2', 'Kai', 'Kajal', 'Kajal_2', 'Kalina', 'Kani', 'Karina', 'Karl', 'Karla', 'Kasper', 'Katja', 'Kavya', 'Kavya_2', 'Kazuha', 'Keita', 'Ken', 'Kendra', 'Kendra_2', 'Keomany', 'Kert', 'Kevin', 'Killian', 'Kim', 'Kimberly', 'Kimberly_2', 'Klarissa', 'Klaus', 'Kumar', 'Kunal', 'Kunal_2', 'Laia', 'Laila', 'Laith', 'Larissa', 'Latifa', 'Laura', 'Laura_2', 'Layla', 'Lea', 'Lea_2', 'Lea_3', 'Leah', 'Leila', 'Leni', 'Lennart', 'Leonas', 'Leticia', 'Lewis', 'Lia', 'Liam', 'Lian', 'Lian_2', 'Libby', 'Liberto', 'Lisa', 'Lisa_2', 'Lisandro', 'Liv', 'Livia', 'Livia_2', 'Lola', 'Lorena', 'Lorenzio', 'Lorenzo', 'Lotte', 'Louisa', 'Lucia', 'Lucia_2', 'Lucia_3', 'Luciano', 'Lucien', 'Luis', 'Lukas', 'Luke', 'Luna', 'Luna_2', 'Lupe', 'Lupe_2', 'Lupe_3', 'Maarten', 'Macerio', 'Macerio_2', 'Madhur', 'Madina', 'Mads', 'Maisie', 'Maja', 'Manohar', 'Manuel', 'Manuela', 'Marcello', 'Marcelo', 'Marek', 'Margarita', 'Maria', 'Marija', 'Marina', 'Mario', 'Marlene', 'Marta', 'Maryam', 'Masaru', 'Mateo', 'Mathieu', 'Matthew', 'Matthew_2', 'Matthew_3', 'Mattias', 'Maurice', 'Maxim', 'Maya', 'Mayu', 'Mekdes', 'Mia', 'Mia_2', 'Mia_3', 'Michelle', 'Midhun', 'Miguel', 'Mitchell', 'Mizuki', 'Moaz', 'Mohan', 'Molly', 'Monica', 'Mouna', 'Muuse', 'Nabanita', 'Naja', 'NamMinh', 'Nanami', 'Nanami_2', 'Nancy', 'Nancy_2', 'Naoki', 'Natasha', 'Neerja', 'Neerja_2', 'Neil', 'Nestoras', 'Nia', 'Niamh', 'Niamh_2', 'Nicholas', 'Nicholas_2', 'Nicolau', 'Nicole', 'Nil', 'Nilar', 'Nils', 'Niranjan', 'Niwat', 'Noah', 'Noemi', 'Noora', 'Noura', 'Nova', 'Nova_2', 'Nuria', 'Ojas', 'Ola', 'Ola_2', 'Oliver', 'Olivia', 'Ollie', 'Ollie_2', 'Omar', 'Ona', 'Onyx', 'Orla', 'Osman', 'Ostap', 'Pallavi', 'Palmira', 'Paloma', 'Paola', 'Pedro', 'Pedro_2', 'Pelayo', 'Penelope', 'Pernille', 'Petra', 'Phoebe', 'Phoebe_2', 'Pierina', 'Piseth', 'Polina', 'Prabhat', 'Prabhat_2', 'Pradeep', 'Premwadee', 'Priyom', 'Rafiki', 'Ralf', 'Rami', 'Ramona', 'Rana', 'Raquel', 'Raveena', 'Reem', 'Rehaan', 'Rehaan_2', 'Rehema', 'Remi', 'Remi_2', 'Remy', 'Remy_2', 'Renata', 'Ricardo', 'Rinaldo', 'Roberto', 'Rodrigo', 'Roger', 'Roi', 'Rok', 'Rosa', 'Ruben', 'Russell', 'Ruth', 'Ruth_2', 'Ryan', 'Ryan_2', 'Sabela', 'Sabrina', 'Sabrina_2', 'Sagar', 'Saleh', 'Salli', 'Salli_2', 'Salli_3', 'Salma', 'Salman', 'Salome', 'Sam', 'Sameera', 'Samuel', 'Sana', 'Sapna', 'Sara', 'Saranya', 'Sardor', 'Saul', 'Sebastian', 'Selma', 'SeoHyeon', 'Seoyeon', 'Seoyeon_2', 'Seoyeon_3', 'Seraphina', 'Seraphina_2', 'Serena', 'Serena_2', 'Sergio', 'Sergio_2', 'Shakir', 'Shimmer', 'Shiori', 'Shruti', 'Siqiniq', 'Siqiniq_2', 'Siti', 'Sobhana', 'Soffie', 'Sofia', 'Sofie', 'Sonia', 'SoonBok', 'Sophie', 'Sophie_2', 'Srecko', 'Sreymom', 'Steffan', 'Steffan_2', 'Steffan_3', 'Stephen', 'Stephen_2', 'Subhasini', 'Sukant', 'SunHi', 'SunHi_2', 'Surya', 'Suvi', 'Svetlana', 'Swara', 'Sylvie', 'Sylvie_2', 'Taim', 'Takumi', 'Takumi_2', 'Tamas', 'Tania', 'Tanishaa', 'Tanja', 'Taqqiq', 'Taqqiq_2', 'Tatyana', 'Teo', 'Teresa', 'Thalita', 'Thalita_2', 'Thalita_3', 'Thando', 'Themba', 'Thiago', 'Thierry', 'Thierry_2', 'Thiha', 'Thilini', 'Thomas', 'Tiana', 'Tiffany', 'Tim', 'Tina', 'Tomas', 'Tomoko', 'Tony', 'Triana', 'Tristan', 'Tristan_ES', 'Tristan_ES_2', 'Tuti', 'Tyler', 'Ubax', 'Uzma', 'Vaani', 'Valentina', 'Valerio', 'Valluvar', 'Venba', 'Vera', 'Vesna', 'Vicki', 'Vicki_2', 'Vicki_3', 'Victor', 'Viktoria', 'Vitoria', 'Vitoria_2', 'Vivienne', 'Vivienne_2', 'Vlasta', 'WanLung', 'Wayne', 'Willem', 'William', 'William_2', 'Xiaochen', 'Xiaochen_2', 'Xiaochen_3', 'Xiaochen_4', 'Xiaohan', 'Xiaohan_2', 'Xiaomeng', 'XiaoMin', 'Xiaomo', 'Xiaoqiu', 'Xiaorou', 'Xiaorui', 'Xiaoshuang', 'Xiaoshuang_2', 'Xiaoshuang_3', 'Xiaotong', 'Xiaoxiao', 'Xiaoxiao_2', 'Xiaoxiao_3', 'Xiaoxiao_4', 'Xiaoxiao_5', 'Xiaoyan', 'Xiaoyi', 'Xiaoyi_2', 'Xiaoyou', 'Xiaoyou_2', 'Xiaoyou_3', 'Xiaoyu', 'Xiaoyu_2', 'Xiaozhen', 'Ximena', 'Ximena_ES', 'Ximena_ES_2', 'Ximena_ES_3', 'Yago', 'Yan', 'Yara', 'Yashica', 'Yasmin', 'Yesui', 'Yolanda', 'YuJin', 'Yundeng', 'Yunfan', 'Yunfan_2', 'Yunfeng', 'Yunhan', 'Yunhao', 'YunJhe', 'Yunjian', 'Yunjie', 'YunSong', 'Yunxi', 'Yunxi_2', 'Yunxia', 'Yunxia_2', 'Yunxiang', 'Yunxiao', 'Yunxiao_2', 'Yunyang', 'Yunye', 'Yunye_2', 'Yunyi', 'Yunyi_2', 'Yunze', 'Yunzhe', 'Yves', 'Yvette', 'Zariyah', 'Zayd', 'Zeina', 'Zhiyu', 'Zhiyu_2', 'Zofia', 'Zuri'] | Annotated[str, Strict(strict=True)],
) → SayMessageDict[source]

A text-to-speech (TTS) message item using Speech Synthesis Markup Language for advanced text-to-speech control. The platform synthesizes the provided SSML document into speech and plays it on the call.

Parameters:
  • ssml (str) – A valid SSML document (<speak>...</speak>) to be synthesized into speech, at most 600 characters.

  • voice_name (Union[VoiceNameEnum, VoiceName]) – The name of the voice to use for text-to-speech synthesis. Use VoiceNameEnum to browse voices with their language, gender and pricing, or VoiceNameByLanguageEnum to browse them grouped by language.

Returns:

The SAY message, in SSML format.

Return type:

SayMessageDict

static play(
url: str,
) → PlayMessageDict[source]

An audio file playback message item. The platform fetches and plays the audio file at the provided URL on the call.

Parameters:

url (str) – URL of the media to play.

Returns:

The PLAY message.

Return type:

PlayMessageDict

static start(
message: SayMessageDict | PlayMessageDict,
*messages: SayMessageDict | PlayMessageDict,
name: str | Unset = <sinch.core.sentinel.Unset object>,
on_finish: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
) → MessagesCommandDict[source]

Plays one or more messages on the call. Multiple messages are played sequentially in order.

This is a non-blocking command — the next command in the sequence executes immediately while messages play in parallel. The on_finish event can be used to run a command after all messages complete.

Parameters:
  • message (MessageDict) – First message to play, built with text(), ssml() or play().

  • messages (MessageDict) – Further messages to play in order, up to 10 messages in total.

  • name (UnsetOr[str]) – Name of the message sequence, between 1 and 32 characters, matching ^\S+$. Must be unique within the current call session. Can be referenced by stop() to control this specific message sequence.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – SVAML commands to execute when all messages in the sequence have finished playing.

Returns:

The messages command.

Return type:

MessagesCommandDict

static stop(
name: str,
) → StopMessagesCommandDict[source]

Stops a message sequence started by start(). It also cancels any messages with the same name that appear in the call session in the future.

This is a non-blocking command.

Parameters:

name (str) – Name of the message sequence to stop, as set by name in start(). Between 1 and 32 characters, matching ^\S+$.

Returns:

The stopMessages command.

Return type:

StopMessagesCommandDict

class sinch.domains.voice.helpers.v2.svaml.Recording[source]

Bases: object

Helpers to build the call recording SVAML commands.

static options(destination: ~typing.Literal['AWS', 'GCP', 'AZURE'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)], url: str, credentials: str, *, format: ~typing.Literal['MP3', 'WAV'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, recording_type: ~typing.Literal['COMBINED', 'INBOUND', 'OUTBOUND'] | ~typing.Annotated[str, ~pydantic.types.Strict(strict=True)] | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>, transcription_options: ~sinch.domains.voice.models.v2.svaml.types.transcription_options_dict.TranscriptionOptionsDict | ~sinch.core.sentinel.Unset = <sinch.core.sentinel.Unset object>) → RecordingOptionsDict[source]

Recording options to store recordings in a third party storage.

Parameters:
  • destination (RecordingDestinationType) –

    Third party storage to deliver the recording to.

    • AWS: Amazon Web Services S3 bucket.

    • GCP: Google Cloud Platform Storage.

    • AZURE: Microsoft Azure Blob Storage.

  • url (str) – Destination URL for the recording. Use s3, gs or azure as schema for the URL, depending on the destination.

  • credentials (str) – Credentials to third party storage.

  • format (UnsetOr[RecordingFormatType]) –

    Audio format for this recording. Defaults to MP3.

    • MP3: MPEG Audio Layer III compressed audio format.

    • WAV: Waveform Audio File Format, uncompressed audio.

  • recording_type (UnsetOr[RecordingType]) –

    The type of recording to perform. Defaults to COMBINED.

    • COMBINED: Record inbound and outbound voice streams.

    • INBOUND: Record inbound voice stream only.

    • OUTBOUND: Record outbound voice stream only.

  • transcription_options (UnsetOr[TranscriptionOptionsDict]) – Configuration for automatic speech-to-text transcription of the recording: is_enabled (if true, the recording will be transcribed to text) and locale (language code in BCP-47 format, defaults to en-US).

Returns:

The recording options.

Return type:

RecordingOptionsDict

static start(
options: RecordingOptionsDict,
*,
name: str | Unset = <sinch.core.sentinel.Unset object>,
on_finish: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
on_failure: AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict | Sequence[AmdCommandDict | DialCommandDict | MessagesCommandDict | StopMessagesCommandDict | CustomEventCommandDict | HangupCommandDict | AnswerCommandDict | PauseCommandDict | StartRecordingCommandDict | StopRecordingCommandDict | BridgeCallCommandDict | MenuCommandDict | GotoMenuCommandDict] | Unset = <sinch.core.sentinel.Unset object>,
) → StartRecordingCommandDict[source]

Starts recording the call. This is a non-blocking command — execution continues to the next command in the sequence immediately after recording begins.

Parameters:
  • options (RecordingOptionsDict) – Recording options for this recording, built with options().

  • name (UnsetOr[str]) – Identifier for this recording within the session, between 1 and 32 characters, matching ^\S+$. Must be unique across active recordings in the session. Setting the recording name is useful for stopping the recording with stop(). If name is not set, recording can only be stopped when the call is disconnected.

  • on_finish (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – Commands to execute when the recording is successfully stopped. Note that this does not mean that the file is delivered to the configured destination yet.

  • on_failure (UnsetOr[Union[SvamlCommandDict, Sequence[SvamlCommandDict]]]) – Commands to execute if the recording fails to start. If omitted, failures are silently ignored and the call flow continues.

Returns:

The startRecording command.

Return type:

StartRecordingCommandDict

static stop(
name: str,
) → StopRecordingCommandDict[source]

Stops a recording previously started by start(). This is a non-blocking command — execution continues to the next command in the sequence immediately after the stop is initiated.

Parameters:

name (str) – Name of the recording to stop, as set by name in start(). Between 1 and 32 characters, matching ^\S+$.

Returns:

The stopRecording command.

Return type:

StopRecordingCommandDict