pub enum Command {
Show 21 variants
Invite {
option: CallOption,
},
Accept {
option: CallOption,
},
Reject {
reason: String,
code: Option<u32>,
},
Ringing {
recorder: Option<RecorderOption>,
early_media: Option<bool>,
ringtone: Option<String>,
},
Tts {
text: String,
speaker: Option<String>,
play_id: Option<String>,
auto_hangup: Option<bool>,
streaming: Option<bool>,
end_of_stream: Option<bool>,
option: Option<SynthesisOption>,
wait_input_timeout: Option<u32>,
base64: Option<bool>,
cache_key: Option<String>,
},
Play {
url: String,
play_id: Option<String>,
auto_hangup: Option<bool>,
wait_input_timeout: Option<u32>,
offset_ms: Option<u32>,
},
Dtmf {
digit: char,
duration_ms: Option<u32>,
play_id: Option<String>,
},
Interrupt {
graceful: Option<bool>,
fade_out_ms: Option<u32>,
},
Pause {},
Resume {},
Hangup {
reason: Option<String>,
initiator: Option<String>,
headers: Option<HashMap<String, String>>,
refer: Option<bool>,
},
Refer {
caller: String,
callee: String,
options: Option<ReferOption>,
},
Message {
body: String,
content_type: Option<String>,
headers: Option<HashMap<String, String>>,
refer: Option<bool>,
},
Bridge {
target_session_id: String,
},
Unbridge {
target_session_id: String,
},
Mute {
track_id: Option<String>,
},
Unmute {
track_id: Option<String>,
},
History {
speaker: String,
text: String,
},
Custom {
sender: Option<String>,
data: Value,
},
AddIceCandidate {
candidate: String,
sdp_mid: Option<String>,
sdp_mline_index: Option<u32>,
},
Renegotiate {
offer: String,
},
}Variants§
Invite
Fields
option: CallOptionAccept
Fields
option: CallOptionReject
Ringing
Tts
Fields
auto_hangup: Option<bool>If auto_hangup is true, it means the call will be hung up automatically after the TTS playback is finished
streaming: Option<bool>If streaming is true, it means the input text is streaming text, and end_of_stream needs to be used to determine if it’s finished, equivalent to LLM’s streaming output to TTS synthesis
option: Option<SynthesisOption>Play
Fields
Dtmf
Send one DTMF digit (0-9, *, #, A-D) to the remote party. RTP legs emit an RFC 4733 telephone-event on the negotiated payload type; outgoing audio is muted while the digit is on the wire. Runs on its own track, so it neither interrupts playback nor is interrupted by it.
Fields
Interrupt
Pause
Resume
Hangup
Fields
Refer
Fields
options: Option<ReferOption>Message
Fields
Bridge
Bridge audio with another established call. This creates separate bridge tracks for the two sessions and patches audio bidirectionally. It does not replace the server-side track and does not control hangup; each call keeps its own session/event flow.
Unbridge
Remove audio bridge tracks with another established call.
Mute
Unmute
History
Custom
AddIceCandidate
Trickle ICE: feed a remote candidate into an already-established session.
Renegotiate
Apply a new remote offer to the already-established WebRTC track
(e.g. an ICE restart after the caller’s network changed). The new
answer is delivered as an answer event.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more