ondewo/sip/sip.proto

Top

Services

Sip

ONDEWO-SIP API available at GitHub

SIP LifeCycle is explained at here

Service Methods

SipStartSession

rpc SipStartSession (SipStartSessionRequest) returns (SipStatus)

Starts a new SIP session for an account registered at a SIP server. RegisterAccount need to be called before.

Not idempotent (no idempotency_level): (re)creates the SIP session and registration.

SipEndSession

rpc SipEndSession (.google.protobuf.Empty) returns (SipStatus)

Ends a SIP session for an account registered at a SIP server

Not idempotent (no idempotency_level): tears down the session; a repeat records a new status.

SipStartCall

rpc SipStartCall (SipStartCallRequest) returns (SipStatus)

Starts a call in an active SIP session for an account registered at a SIP server

Not idempotent (no idempotency_level): a repeat dials a second call.

SipEndCall

rpc SipEndCall (SipEndCallRequest) returns (SipStatus)

Ends a call in an active SIP session for an account registered at a SIP server

Not idempotent (no idempotency_level): a repeat without a call appends its refusal to the history and ends a one-shot caller container; unscoped it can end the next call.

SipTransferCall

rpc SipTransferCall (SipTransferCallRequest) returns (SipStatus)

Transfers a call in an active SIP session for an account registered at a SIP server to another SIP account or phone number specified by transfer_id

Call scoping: when the gRPC metadatum x-ondewo-expected-call-id is present it must equal SipStatus.call_id of the ongoing call, otherwise the request is refused with exception_name=CallScopeMismatch and nothing is assigned to the status. When it is absent the request is accepted for backward compatibility (unless the server requires call scoping).

With outcome_timeout_ms = 0 the call is transferred as before (REFER, then an immediate hangup). With outcome_timeout_ms > 0 see SipTransferCallRequest.outcome_timeout_ms.

Refused while invited participants are present (see SipSetCallMediaControlRequest.participants_present): a REFER into a conference bridge transfers every party in it, the invited participant included. The refusal is RETURNED as TRANSFER_CALL_FAILED with exception_name=ParticipantsPresent and description = reason=participants-present; nothing is sent and the call is kept.

Transfer delegation (see SipTransferDelegation): in a container started with SIP_TRANSFER_DELEGATION_ACTIVE=True a transfer that the in-container speech-to-speech pipeline asks for on a connected call is not sent. It is parked in SipStatus.delegated_transfer and RETURNED as TRANSFER_CALL_FAILED with exception_name=TransferDelegated and description = reason=delegated-to-vtsi; the call is kept. A client (ONDEWO VTSI) then claims it with delegation and delegated_request_id. A second transfer of the pipeline while one is parked is refused with exception_name=TransferInProgress. Without that environment variable, and for every request with delegation = SIP_TRANSFER_DELEGATION_UNSPECIFIED from any other peer, the transfer is sent as before.

Not idempotent (no idempotency_level): a repeat sends another REFER.

SipRegisterAccount

rpc SipRegisterAccount (SipRegisterAccountRequest) returns (SipStatus)

Registers s SIP account at a SIP server

Not idempotent (no idempotency_level): re-registers the account at the SIP server.

SipGetSipStatus

rpc SipGetSipStatus (.google.protobuf.Empty) returns (SipStatus)

Gets the current SIP status

SipGetSipStatusHistory

rpc SipGetSipStatusHistory (.google.protobuf.Empty) returns (SipStatusHistoryResponse)

Gets the history of SIP status

SipPlayWavFiles

rpc SipPlayWavFiles (SipPlayWavFilesRequest) returns (SipStatus)

Plays wav files during an ongoing call of an active SIP session

Call scoping as for SipTransferCall: a present x-ondewo-expected-call-id metadatum must match SipStatus.call_id.

Not idempotent (no idempotency_level): a repeat plays the files again.

SipMute

rpc SipMute (.google.protobuf.Empty) returns (SipStatus)

Mutes the microphone in an ongoing call of an active SIP session

Call scoping as for SipTransferCall. Sent by the in-container speech-to-speech pipeline it mutes only the bot's own mixer slot; sent by a remote client it sets the operator mute of SipSetCallMediaControl, which the pipeline cannot undo.

Not idempotent (no idempotency_level): without a call it assigns NO_ONGOING_CALL and appends to the history.

SipUnMute

rpc SipUnMute (.google.protobuf.Empty) returns (SipStatus)

Un-mutes the microphone in an ongoing call of an active SIP session

Call scoping and the split between the pipeline's own mute and the operator mute as for SipMute.

Not idempotent (no idempotency_level): without a call it assigns NO_ONGOING_CALL and appends to the history.

SipReportAnsweringMachineDetected

rpc SipReportAnsweringMachineDetected (SipReportAnsweringMachineDetectedRequest) returns (SipStatus)

Reports that answering machine detection reached a verdict on the ongoing outgoing call. Sets the status OUTGOING_CALL_ANSWERING_MACHINE_DETECTED carrying amd_result; the call stays up.

Called by the speech-to-speech pipeline (ONDEWO-CSI) inside the same container, i.e. over loopback only. Refused, and the current status left untouched, when no outgoing call is connected: the returned SipStatus then carries the refusal in exception_name and description

Not idempotent (no idempotency_level): assigns a status and records answering machine detection telemetry.

SipSetCallMediaControl

rpc SipSetCallMediaControl (SipSetCallMediaControlRequest) returns (SipStatus)

Call-scoped operator media control of the ongoing call: mute the bot and/or pause its listening.

Metadata REQUIRED: x-ondewo-expected-call-id (must equal SipStatus.call_id of the ongoing call) and x-ondewo-sip-call-control-token (the per-container call-control token).

Every request sets a desired level per owner and never toggles; a repeat leaves the level unchanged. The bot is muted while ANY owner holds a mute, and its listening is paused while ANY owner holds a pause.

Returns the live status with call_id, bot_muted, listening_paused and call_audio_streams filled. Refusals are RETURNED in exception_name / description (CallScopeMismatch, CallControlUnauthenticated, NoOngoingCall, AmdInProgress, CsiMediaControlFailed) and never assigned to the shared status. When the pipeline refuses or fails, a requested pause is rolled back and a requested mute is kept (the safe direction); the returned fields carry the actual level.

A request may carry a warm_transfer_outcome notice (participant owner only, refused otherwise with exception_name=InvalidWarmTransferOutcomeNotice). The notice is handed to the speech-to-speech pipeline whether or not the level changed, and the answer of the pipeline is returned in SipStatus.warm_transfer_outcome_notice_status.

Deliberately unmarked although a repeat leaves the level unchanged: a retried attempt can land after a newer request of the same owner and restore a stale mute or pause.

SipStreamCallAudio

rpc SipStreamCallAudio (stream SipCallAudioRequest) returns (stream SipCallAudioResponse)

Bidirectional live audio of the ongoing call.

The first request MUST be config and must arrive within 2 seconds. Metadata as for SipSetCallMediaControl.

LISTEN receives the caller (plus any conference participants) mixed with the bot. TALK sends the agent's audio to the caller; it REQUIRES take_over, i.e. the bot is muted and does not listen while the stream is connected, and in TALK the agent hears the caller only. Audio is LINEAR16 little-endian mono in 20 ms frames.

gRPC status codes: UNAUTHENTICATED (token), FAILED_PRECONDITION (call id mismatch, no connected call, answering machine detection in progress, bot still speaking at TALK start), INVALID_ARGUMENT (missing or invalid config, wrong frame size), RESOURCE_EXHAUSTED (stream cap reached, a second TALK). A normal end sends one ended message and then OK.

Not idempotent (no idempotency_level): a stream takes a slot and, in TALK, takes over the call.

SipSendDtmf

rpc SipSendDtmf (SipSendDtmfRequest) returns (SipStatus)

Send DTMF keys into the ongoing connected call, as RFC 4733 telephone-events (e.g. to navigate an IVR the bot called, or for an operator).

Metadata as for SipSetCallMediaControl: x-ondewo-expected-call-id must equal SipStatus.call_id of the ongoing call; a peer outside the container presents x-ondewo-sip-call-control-token when the container has one.

Returns the live status. Refusals are RETURNED in exception_name / description (CallScopeMismatch, CallControlUnauthenticated, NoOngoingCall, AmdInProgress, InvalidDtmf) and never assigned to the shared status. The keys are never logged in clear.

Not idempotent (no idempotency_level): a retried attempt sends the keys again.

Methods with idempotency_level option

Method Name Option
SipGetSipStatus

NO_SIDE_EFFECTS

SipGetSipStatusHistory

NO_SIDE_EFFECTS

Messages

AnsweringMachineDetectionResult

Result of the answering machine detection (AMD) of an outbound call

Carries identifiers from closed vocabularies only: never audio, transcript text or a phone number

FieldTypeLabelDescription
verdict AnsweringMachineDetectionResult.Verdict

Who or what answered the call

cause AnsweringMachineDetectionResult.Cause

Evidence that led to the verdict

confidence float

Confidence of the verdict, between 0.0 and 1.0

decision_ms int32

Time in milliseconds from the call being connected until the verdict was reached

rule_id string

Identifier of the detection rule that produced the verdict

matched_cue_ids string repeated

Identifiers of the cues that matched, e.g. keyword or tone identifiers. Identifiers only, never transcript text

action_taken AnsweringMachineDetectionResult.ActionTaken

What was done because of the verdict

call_id string

Identifier of the call the result belongs to, i.e. the value of the X-ondewo-vtsi-caller-call-id header of the call. Used to match a result to its call by identity rather than by recency

SipCallAudioConfig

Configuration of a SipStreamCallAudio stream. Must be the first request of the stream

FieldTypeLabelDescription
mode SipCallAudioMode

Mode of the stream. Unspecified means LISTEN

sample_rate_hz int32

Sample rate in Hz of the audio in both directions: 8000 or 16000. 0 means 16000

frame_ms int32

Frame length in milliseconds. Only 20 is supported; 0 means 20

take_over bool

REQUIRED for TALK: the bot is muted and does not listen while the stream is connected. Released when the stream ends

stream_id string

Identifier of the stream for logs and audit correlation, minted by the client (a UUID)

max_duration_s int32

Maximum duration of the stream in seconds. 0 means the server default (3600)

SipCallAudioEnded

Sent once when a SipStreamCallAudio stream ends normally

FieldTypeLabelDescription
reason SipCallAudioEndReason

Why the stream ended

detail string

Optional detail, a stable token

SipCallAudioFrame

One frame of call audio

FieldTypeLabelDescription
pcm_s16le bytes

LINEAR16 little-endian mono samples of one frame, i.e. sample_rate_hz * frame_ms / 1000 * 2 bytes

sequence uint64

Monotonic sequence number of the frame within its direction of the stream

SipCallAudioRequest

Request of SipStreamCallAudio

FieldTypeLabelDescription
config SipCallAudioConfig

Configuration; must be the first request and is accepted only once

audio SipCallAudioFrame

Agent audio to send to the caller (TALK only)

agent_muted bool

true: the agent's audio is not sent to the caller (silence instead) until set to false

SipCallAudioResponse

Response of SipStreamCallAudio

FieldTypeLabelDescription
started SipCallAudioStarted

The stream is connected

audio SipCallAudioFrame

Call audio

stats SipCallAudioStats

Stream counters

ended SipCallAudioEnded

The stream ended

SipCallAudioStarted

Sent once when a SipStreamCallAudio stream is connected

FieldTypeLabelDescription
stream_id string

Identifier of the stream

sample_rate_hz int32

Sample rate in Hz of the audio in both directions

frame_ms int32

Frame length in milliseconds

mode SipCallAudioMode

Mode of the stream

SipCallAudioStats

Counters of a SipStreamCallAudio stream, sent periodically

FieldTypeLabelDescription
frames_sent uint64

Frames sent to the client

frames_dropped uint64

Frames to the client dropped because the client read too slowly

frames_received uint64

Frames received from the client

underruns uint64

Playback underruns of the agent audio (silence was played)

frames_discarded uint64

Frames from the client discarded because the playback buffer was full

SipDelegatedTransfer

A transfer that the in-container speech-to-speech pipeline asked for and the container handed to a client instead

of sending it (see SipTransferDelegation). Call-scoped: empty when no transfer is parked, when no call

is ongoing, and after the call ended.

SipGetSipStatus, SipGetSipStatusHistory and every other response report only

request_id, requested_at and target_is_phone_number. The target and the headers

are filled ONLY in the response of a SIP_TRANSFER_DELEGATION_CLAIM.

FieldTypeLabelDescription
request_id string

Identifier of the parked transfer, a UUID minted by ONDEWO SIP. Sent back as SipTransferCallRequest.delegated_request_id. Empty when no transfer is parked

requested_at google.protobuf.Timestamp

When the pipeline asked for the transfer

target_is_phone_number bool

true when the target is a phone number by the transfer target policy of ONDEWO SIP (a leading + followed by digits, or a trunk-routed number), false for an account name such as a softphone

transfer_id string

The target the pipeline asked for, already checked by the transfer target policy. Only in the response of a SIP_TRANSFER_DELEGATION_CLAIM, empty everywhere else

headers SipDelegatedTransfer.HeadersEntry repeated

The headers the pipeline sent with the transfer. Only in the response of a SIP_TRANSFER_DELEGATION_CLAIM, empty everywhere else

SipDelegatedTransfer.HeadersEntry

FieldTypeLabelDescription
key string

value string

SipEndCallRequest

Ends an ongoing call of the active SIP session of the active SIP account

FieldTypeLabelDescription
hard_hangup bool

Set to True to forcefully hang up the call

end_reason SipEndCallRequest.EndCallReason

Optional: reason for ending the call. Leave unset for an ordinary hangup

amd_result AnsweringMachineDetectionResult

Optional: result of the answering machine detection that decided to end the call. Only meaningful together with end_reason = ANSWERING_MACHINE or end_reason = ANSWERING_MACHINE_VOICE_MESSAGE_LEFT; it is carried into SipStatus.amd_result of the terminal status of the call

SipPlayWavFilesRequest

Plays a list of wav files

FieldTypeLabelDescription
wav_files bytes repeated

Wav files as bytes in a list that will be played

SipRegisterAccountRequest

Request for registering a SIP account at a SIP server

FieldTypeLabelDescription
account_name string

Account name of the sip user. Usually something like sip-user-1@mydomain.com or sip-user-1@192.168.123.123 which uses the default SIP port 5060. Also a non-default SIP port can be specified via sip-user-1@mydomain.com:5099 to connect to a SIP server running on port 5099

password string

Password of the account

auth_username string

Optional: authentication user name

outbound_proxy string

Optional: outbound proxy address, e.g. my.outbound.proxy.com

SipReportAnsweringMachineDetectedRequest

Reports the verdict of the answering machine detection of the ongoing outgoing call

FieldTypeLabelDescription
amd_result AnsweringMachineDetectionResult

Result of the answering machine detection. Written to SipStatus.amd_result of the OUTGOING_CALL_ANSWERING_MACHINE_DETECTED status of the call

SipSendDtmfRequest

Request of SipSendDtmf

FieldTypeLabelDescription
digits string

The keys to send, in order: 0-9, *, #, A-D; at most 64. Any other character refuses the request (InvalidDtmf) and sends nothing

SipSetCallMediaControlRequest

Request of SipSetCallMediaControl

FieldTypeLabelDescription
bot_voice MediaControlSetting

MEDIA_CONTROL_SETTING_ON: the bot speaks. MEDIA_CONTROL_SETTING_OFF: the bot is muted

bot_listening MediaControlSetting

MEDIA_CONTROL_SETTING_ON: caller audio reaches speech-to-text. MEDIA_CONTROL_SETTING_OFF: listening is paused

owner MediaControlOwner

Owner whose hold is set

participants_present bool

Only for MEDIA_CONTROL_OWNER_PARTICIPANT, ignored for every other owner: whether at least one invited participant is ringing or joined. Every participant request carries the full value, so the request that reports the last participant gone sends false.

While participants are present (this flag, or a mute or pause held by the participant owner) SipTransferCall is refused with exception_name=ParticipantsPresent, because a REFER into a conference bridge transfers every party in it. A request that would mark participants present while a transfer of the call is in flight is refused with exception_name=TransferInProgress and changes nothing. Cleared when the call ends

warm_transfer_outcome SipWarmTransferOutcomeNotice

Optional, only with MEDIA_CONTROL_OWNER_PARTICIPANT (any other owner, an outcome other than SIP_WARM_TRANSFER_OUTCOME_DECLINED / SIP_WARM_TRANSFER_OUTCOME_UNREACHABLE, or an empty request_id is refused with exception_name=InvalidWarmTransferOutcomeNotice and changes nothing). The outcome of a warm transfer that the bot must tell the caller, sent with the request that releases the participant hold, so the bot speaks only once it can.

Handed to the speech-to-speech pipeline after the level, also when the level did not change; the answer is returned in SipStatus.warm_transfer_outcome_notice_status. A notice the pipeline did not answer is kept and handed over again until it answers, and dropped when the call ends. Unset (default): no notice, exactly as before this field existed.

SipStartCallRequest

Request to start the call with the active SIP session of the active SIP account

FieldTypeLabelDescription
callee_id string

SIP account name

headers SipStartCallRequest.HeadersEntry repeated

Headers to include when starting the call

SipStartCallRequest.HeadersEntry

FieldTypeLabelDescription
key string

value string

SipStartSessionRequest

Request for starting a new SIP session for a specified account

FieldTypeLabelDescription
account_name string

Account name of the sip user. Usually something like sip-user-1@mydomain.com or sip-user-1@192.168.123.123 which uses the default SIP port 5060. Also a non-default SIP port can be specified via sip-user-1@mydomain.com:5099 to connect to a SIP server running on port 5099

auto_answer_interval int32

Auto-answer interval in seconds. The call will be automatically answered after this interval

SipStatus

Status information for a SIP account, session, or call

FieldTypeLabelDescription
account_name string

Account name of the sip user. Usually something like sip-user-1@mydomain.com or sip-user-1@192.168.123.123 which uses the default SIP port 5060. Also a non-default SIP port can be specified via sip-user-1@mydomain.com:5099 to connect to a SIP server running on port 5099

timestamp google.protobuf.Timestamp

Timestamp of the status

status_type SipStatus.StatusType

Status type

callee_id string

SIP account name

transfer_call_id string

SIP account of the transfer

headers SipStatus.HeadersEntry repeated

Headers to include when calling outbound or transfer

description string

More detailed description of the status

exception_name string

Name of the exception

exception_traceback string

Traceback of the exception

nlu_session_name string

session name of the NLU session

amd_result AnsweringMachineDetectionResult

Result of the answering machine detection of the call. Set on OUTGOING_CALL_ANSWERING_MACHINE_DETECTED and on the terminal status of every call on which answering machine detection ran, including a HUMAN verdict; unset otherwise

call_id string

Identifier of the ongoing call, minted per call: the value of the X-ondewo-vtsi-caller-call-id header of an outgoing call when present, otherwise a random UUID. Empty when no call is ongoing. Set on every status of the call, including the entries of SipGetSipStatusHistory. Clients send it back as the x-ondewo-expected-call-id metadatum to scope a request to this call

bot_muted bool

true while the bot is muted by an operator, a conference participant policy or a TALK take-over of SipSetCallMediaControl / SipStreamCallAudio. Not the bot's own pipeline mute (MICROPHONE_MUTED). Cleared when the call ends

listening_paused bool

true while the bot does not listen to the caller (see bot_muted for who sets it). Cleared when the call ends

call_audio_streams int32

Number of connected SipStreamCallAudio streams of the ongoing call

sip_response_code int32

SIP response code of the last transfer attempt of the ongoing call (202 when accepted, the refusal code otherwise, 0 when unknown). Call-scoped

delegated_transfer SipDelegatedTransfer

The transfer parked for a client to claim (see SipTransferDelegation). Unset (empty) when no transfer is parked, which is always the case in a container started without SIP_TRANSFER_DELEGATION_ACTIVE=True. Call-scoped

capabilities string repeated

Optional features this container supports, as stable tokens. Fixed for the life of the container, so it is the same on every status. Empty (default): none of them, as for a container built before this field existed. Clients ignore tokens they do not know.

  • warm-transfer-outcome-notice: SipSetCallMediaControlRequest.warm_transfer_outcome is handed to the speech-to-speech pipeline, and the pipeline tells the caller.

warm_transfer_outcome_notice_status SipWarmTransferOutcomeNoticeStatus

Answer of the speech-to-speech pipeline to the warm_transfer_outcome notice of a SipSetCallMediaControl request. Only in the response of that request; SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_UNSPECIFIED everywhere else and when the request carried no notice

SipStatus.HeadersEntry

FieldTypeLabelDescription
key string

value string

SipStatusHistoryResponse

History of SIP status

FieldTypeLabelDescription
status_history SipStatus repeated

History of SIP status

SipTransferCallRequest

Request for transferring a call with or without headers

FieldTypeLabelDescription
transfer_id string

The account name or phone number to transfer the call to

headers SipTransferCallRequest.HeadersEntry repeated

The headers to include when transferring the call. They are sent on the REFER. Note that Asterisk (res_pjsip, measured on 18.6 and 22) does NOT forward headers of a REFER to the transfer target: the target receives the headers of the transferred caller's original INVITE. Hand headers to the target through the dialplan instead

outcome_timeout_ms uint32

Optional. How long to wait, in milliseconds, for the SIP server's answer to the REFER before reporting the outcome. Clamped to 10000.

0 (default): legacy behaviour, unchanged: REFER, then an immediate hangup.

> 0: the call is kept until the outcome is known:

  • REFER accepted (202): the hangup is held for a short grace in which a terminal NOTIFY with a 404 sipfrag (unknown target) still counts as a refusal; any other sipfrag, or none, means accepted. The bot then hangs up and TRANSFER_CALL_INITIATED is returned with sip_response_code = 202. The call ends as *_CALL_FINISHED with the description Call transferred.
  • REFER refused (a final response >= 400, or the 404 sipfrag above): the call is KEPT with the bot, nothing is assigned to the shared status, and TRANSFER_CALL_FAILED is returned with description = reason=refer-rejected and sip_response_code (0 when the SIP stack did not report the code, e.g. a declined REFER).
  • No answer within the timeout: the call is KEPT and TRANSFER_CALL_FAILED is returned with description = reason=refer-timeout. A late acceptance still ends the bot's leg.
  • The call ended while waiting: NO_ONGOING_CALL is returned.

A 202 does not mean the target answered: when the dialplan's dial to the target then fails (busy, no answer, unreachable) the caller is lost. Validate targets up front, or use a WARM transfer.

delegation SipTransferDelegation

Optional. Claims the transfer parked in SipStatus.delegated_transfer (see SipTransferDelegation). SIP_TRANSFER_DELEGATION_UNSPECIFIED (default): an ordinary transfer, exactly as before this field existed.

delegated_request_id string

Required with every delegation other than SIP_TRANSFER_DELEGATION_UNSPECIFIED, ignored otherwise: must equal SipStatus.delegated_transfer.request_id of the parked transfer, otherwise the request is refused with exception_name=DelegatedRequestMismatch and nothing is sent. Empty (default): no delegated transfer is claimed.

SipTransferCallRequest.HeadersEntry

FieldTypeLabelDescription
key string

value string

SipWarmTransferOutcomeNotice

One-shot notice of a warm-transfer outcome for the bot. The pipeline tells the caller at most once per

request_id and call. Carries no reason text the target gave

FieldTypeLabelDescription
request_id string

Identifier of the transfer request of the client (ONDEWO VTSI). Required; the notice is delivered at most once per call for one identifier

outcome SipWarmTransferOutcome

The outcome

intro_session string

Optional: NLU session name of the session in which the transfer target was introduced, so the pipeline can relay what the target said. Empty when there was no intro

callee_display_name string

Optional: display name of the transfer target, at most 128 characters

cause string

Optional: a stable token naming why the transfer did not complete, e.g. target-hung-up, target-refused, voicemail-suspected. Never free text

fallback_text string

Optional: the sentence the pipeline speaks itself when it cannot have the NLU phrase the outcome, rendered by the client. Never contains a reason the target gave. Empty: the pipeline has no sentence of its own to fall back on

Enums

AnsweringMachineDetectionResult.ActionTaken

What was done because of the verdict

NameNumberDescription
ACTION_TAKEN_UNSPECIFIED 0

No action recorded

HUNG_UP 1

The call was hung up

CONTINUED 2

The call continued as normal

DETECT_ONLY 3

Detection only: the verdict was recorded, but the call was not influenced by it

LEFT_VOICE_MESSAGE 4

A voice message was left on the answering machine, and the call was hung up afterwards

AnsweringMachineDetectionResult.Cause

Evidence that led to the verdict

NameNumberDescription
CAUSE_UNSPECIFIED 0

No cause available

CADENCE 1

The speech cadence, e.g. a long uninterrupted greeting

KEYWORD 2

A keyword or phrase typical of the verdict

BEEP 3

A voicemail beep

TONE 4

A tone, e.g. a fax or special information tone

CADENCE_AND_KEYWORD 5

Both the speech cadence and a keyword

CADENCE_AND_BEEP 6

Both the speech cadence and a voicemail beep

TIMEOUT 7

The detection window ended before any other evidence decided

SILENCE 8

Silence throughout the detection window

AnsweringMachineDetectionResult.Verdict

Who or what answered the call

NameNumberDescription
VERDICT_UNSPECIFIED 0

No verdict available

HUMAN 1

A person answered the call

MACHINE 2

An answering machine or voicemail answered the call

IVR 3

An interactive voice response system (IVR) answered the call

FAX 4

A fax machine answered the call

NETWORK_ANNOUNCEMENT 5

A network announcement answered the call, e.g. "the number you have dialed is not available"

CALL_SCREENING 6

A call screening service answered the call, e.g. asking the caller to state their name

NO_SPEECH 7

Nothing was said within the detection window

UNKNOWN 8

The detection could not decide

MediaControlOwner

Owner of a media control hold. Each owner holds its own mute and pause; releasing one owner's hold never releases

another owner's

NameNumberDescription
MEDIA_CONTROL_OWNER_UNSPECIFIED 0

Same as MEDIA_CONTROL_OWNER_OPERATOR

MEDIA_CONTROL_OWNER_OPERATOR 1

An operator, e.g. a supervisor muting the bot

MEDIA_CONTROL_OWNER_PARTICIPANT 2

The bot policy of invited conference participants, set while at least one participant is ringing or joined. Its hold mutes or pauses the bot only when a participant's bot policy asks for it; it also carries SipSetCallMediaControlRequest.participants_present

MediaControlSetting

Desired setting of one media control flag

NameNumberDescription
MEDIA_CONTROL_SETTING_UNCHANGED 0

Leave the flag as it is for this owner

MEDIA_CONTROL_SETTING_ON 1

The flag is on: the bot speaks (bot_voice) or the bot listens (bot_listening)

MEDIA_CONTROL_SETTING_OFF 2

The flag is off: the bot is muted (bot_voice) or the bot's listening is paused (bot_listening)

SipCallAudioEndReason

Why a SipStreamCallAudio stream ended

NameNumberDescription
SIP_CALL_AUDIO_END_REASON_UNSPECIFIED 0

No reason recorded

SIP_CALL_AUDIO_END_REASON_CLIENT_CLOSED 1

The client cancelled or half-closed the stream

SIP_CALL_AUDIO_END_REASON_CALL_ENDED 2

The call ended

SIP_CALL_AUDIO_END_REASON_CALL_TRANSFERRED 3

The call was transferred

SIP_CALL_AUDIO_END_REASON_MAX_DURATION 4

max_duration_s was reached

SIP_CALL_AUDIO_END_REASON_STALLED 5

The client did not read the audio in time

SIP_CALL_AUDIO_END_REASON_INTERNAL 6

An internal error ended the stream

SipCallAudioMode

Mode of a SipStreamCallAudio stream

NameNumberDescription
SIP_CALL_AUDIO_MODE_UNSPECIFIED 0

Same as SIP_CALL_AUDIO_MODE_LISTEN

SIP_CALL_AUDIO_MODE_LISTEN 1

Receive the call audio only

SIP_CALL_AUDIO_MODE_TALK 2

Receive the caller's audio and send audio to the caller. Requires take_over

SipEndCallRequest.EndCallReason

Why the call is being ended

NameNumberDescription
END_CALL_REASON_UNSPECIFIED 0

No specific reason given. The call ends as an ordinary hangup, exactly as before this field existed

ANSWERING_MACHINE 1

Answering machine detection decided the callee is not a person to talk to (answering machine, fax, network announcement, ...) and the call is hung up WITHOUT leaving a voice message. The terminal status of the call is OUTGOING_CALL_FINISHED with the description Answering machine detected with hang up

ANSWERING_MACHINE_VOICE_MESSAGE_LEFT 2

Answering machine detection decided the callee is an answering machine, a voice message was left on it, and the call is hung up afterwards (or when the voice message timeout expired). The terminal status of the call is OUTGOING_CALL_FINISHED with the description Answering machine detected with left voice message and hang up

END_CALL_REASON_TRANSFERRED 3

A WARM transfer completed: the transfer target joined the call and the bot leaves it. The terminal status of the call is *_CALL_FINISHED with the description Call transferred and transfer_call_id set to the transfer target

SipStatus.StatusType

Types of status

NameNumberDescription
NO_SESSION 0

No session is currently active

REGISTERED 1

SIP account is registered at a SIP server

READY 2

SIP account is ready to call

INCOMING_CALL_INITIATED 3

SIP account is being called, i.e. inbound/incoming call

OUTGOING_CALL_INITIATED 4

SIP account starts calling, i.e. outbound/outgoing call

OUTGOING_CALL_CONNECTED 5

SIP account outbound call is connected

INCOMING_CALL_CONNECTED 6

SIP account incoming call is connected

TRANSFER_CALL_INITIATED 7

SIP account starts transferring the call

SOFT_HANGUP_INITIATED 8

SIP account hangs up the ongoing call

HARD_HANGUP_INITIATED 9

SIP account forcefully hangs up by terminating the SIP program

INCOMING_CALL_FAILED 10

SIP account cannot accept the incoming call

OUTGOING_CALL_FAILED 11

SIP account cannot do an outbound call

INCOMING_CALL_FINISHED 12

SIP account finished the ongoing incoming call

OUTGOING_CALL_FINISHED 13

SIP account finished the ongoing outgoing call

SESSION_REGISTRATION_FAILED 14

Registration of SIP account to SIP server failed

SESSION_STARTED 15

SIP account started a new SIP session via a SIP server

SESSION_ENDED 16

SIP account ended active sip session with SIP server

TRANSFER_CALL_FAILED 17

SIP account cannot transfer the call

MICROPHONE_MUTED 18

Microphone is muted

MICROPHONE_UNMUTED 19

Microphone is unmuted

MICROPHONE_WAV_FILES_PLAYED 20

Microphone has played wav files

NO_ONGOING_CALL 21

No ongoing call

OUTGOING_CALL_ANSWERING_MACHINE_DETECTED 22

Answering machine detection decided the callee of the ongoing outgoing call is not a person to talk to. NOT terminal: the call is still up when this status is set. amd_result.verdict tells an answering machine, a fax, a network announcement, ... apart. The call then ends as OUTGOING_CALL_FINISHED carrying amd_result and exactly one of the descriptions Answering machine detected with hang up, Answering machine detected with left voice message and hang up, Answering machine detected, call ended by the answering machine or Answering machine detected, call ended by the answering machine after leaving a voice message

SipTransferDelegation

How a SipTransferCall handles a transfer that the container parked in

SipStatus.delegated_transfer instead of sending it.

Every value other than SIP_TRANSFER_DELEGATION_UNSPECIFIED requires the

x-ondewo-sip-call-control-token metadatum (otherwise CallControlUnauthenticated) and the

x-ondewo-expected-call-id metadatum naming the ongoing call (missing or different:

CallScopeMismatch), plus delegated_request_id (otherwise

DelegatedRequestMismatch). Refusals are RETURNED in exception_name /

description and never assigned to the shared status.

A parked transfer that is neither claimed nor ended within SIP_TRANSFER_DELEGATION_CLAIM_TIMEOUT_S is

dropped WITHOUT a REFER, and the pipeline is told with SIP_WARM_TRANSFER_OUTCOME_DELEGATION_EXPIRED. A

claimed transfer never expires.

NameNumberDescription
SIP_TRANSFER_DELEGATION_UNSPECIFIED 0

No delegated transfer is claimed: the request is an ordinary transfer, exactly as before this field existed

SIP_TRANSFER_DELEGATION_CLAIM 1

Claim the parked transfer and send nothing. The response carries the full target and headers in SipStatus.delegated_transfer.transfer_id / headers, and the parked transfer no longer expires. It stays parked until SIP_TRANSFER_DELEGATION_EXECUTE, SIP_TRANSFER_DELEGATION_DISCARD or the end of the call. A repeated claim answers the same

SIP_TRANSFER_DELEGATION_EXECUTE 2

End the delegation and send the transfer of THIS request (transfer_id, headers, outcome_timeout_ms) as an ordinary SipTransferCall, with the same outcomes and refusals

SIP_TRANSFER_DELEGATION_DISCARD 3

End the delegation and send nothing; the call stays with the bot, e.g. because the client handles the transfer itself (a warm transfer with an intro)

SipWarmTransferOutcome

Outcome of a warm transfer that the bot tells the caller

NameNumberDescription
SIP_WARM_TRANSFER_OUTCOME_UNSPECIFIED 0

No outcome

SIP_WARM_TRANSFER_OUTCOME_DECLINED 1

The transfer target declined the call; the caller stays with the bot

SIP_WARM_TRANSFER_OUTCOME_UNREACHABLE 2

The transfer target could not be reached: busy, no answer, no decision, or no intro possible; the caller stays with the bot

SIP_WARM_TRANSFER_OUTCOME_DELEGATION_EXPIRED 3

A transfer parked in SipStatus.delegated_transfer was not claimed in time and was dropped without a REFER. Set by ONDEWO SIP itself towards the pipeline, never accepted from a client

SipWarmTransferOutcomeNoticeStatus

Answer of the speech-to-speech pipeline to a SipWarmTransferOutcomeNotice

NameNumberDescription
SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_UNSPECIFIED 0

No notice was carried

SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_QUEUED 1

The pipeline accepted the notice and will tell the caller, unless the call ends first

SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_DUPLICATE 2

The pipeline already has a notice with this request_id on this call; nothing new is told

SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_DISABLED 3

The pipeline does not tell the caller about warm-transfer outcomes (switched off); the notice is dropped

SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_INVALID 4

The pipeline refused the notice as malformed; the notice is dropped

SIP_WARM_TRANSFER_OUTCOME_NOTICE_STATUS_PENDING 5

The pipeline did not answer (unreachable, or an older pipeline without the notice). The notice is kept and handed over again until it answers or the call ends

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
double double double float float64 double float Float
float float float float float32 float float Float
int32 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. int32 int int int32 int integer Bignum or Fixnum (as required)
int64 Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. int64 long int/long int64 long integer/string Bignum
uint32 Uses variable-length encoding. uint32 int int/long uint32 uint integer Bignum or Fixnum (as required)
uint64 Uses variable-length encoding. uint64 long int/long uint64 ulong integer/string Bignum or Fixnum (as required)
sint32 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. int32 int int int32 int integer Bignum or Fixnum (as required)
sint64 Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. int64 long int/long int64 long integer/string Bignum
fixed32 Always four bytes. More efficient than uint32 if values are often greater than 2^28. uint32 int int uint32 uint integer Bignum or Fixnum (as required)
fixed64 Always eight bytes. More efficient than uint64 if values are often greater than 2^56. uint64 long int/long uint64 ulong integer/string Bignum
sfixed32 Always four bytes. int32 int int int32 int integer Bignum or Fixnum (as required)
sfixed64 Always eight bytes. int64 long int/long int64 long integer/string Bignum
bool bool boolean boolean bool bool boolean TrueClass/FalseClass
string A string must always contain UTF-8 encoded or 7-bit ASCII text. string String str/unicode string string string String (UTF-8)
bytes May contain any arbitrary sequence of bytes. string ByteString str []byte ByteString string String (ASCII-8BIT)