pub struct AriClient {
pub url: String,
pub user: String,
pub password: String,
/* private fields */
}Fields§
§url: String§user: String§password: StringImplementations§
Source§impl AriClient
impl AriClient
pub fn new(url: String, user: String, password: String) -> Self
pub fn set_stasis_start_sender(&mut self, sender: Option<Sender<StasisStart>>)
pub fn set_channel_dtmf_received_sender( &mut self, sender: Option<Sender<ChannelDtmfReceived>>, )
pub fn set_channel_hangup_request_sender( &mut self, sender: Option<Sender<ChannelHangupRequest>>, )
pub fn set_stasis_end_sender(&mut self, sender: Option<Sender<StasisEnd>>)
pub fn set_channel_talking_finished_sender( &mut self, sender: Option<Sender<ChannelTalkingFinished>>, )
pub fn set_channel_talking_started_sender( &mut self, sender: Option<Sender<ChannelTalkingStarted>>, )
pub fn set_channel_destroyed_sender( &mut self, sender: Option<Sender<ChannelDestroyed>>, )
pub fn set_playback_started_sender( &mut self, sender: Option<Sender<PlaybackStarted>>, )
pub fn set_playback_finished_sender( &mut self, sender: Option<Sender<PlaybackFinished>>, )
pub fn set_channel_state_change_sender( &mut self, sender: Option<Sender<ChannelStateChange>>, )
pub fn set_channel_var_set_sender( &mut self, sender: Option<Sender<ChannelVarset>>, )
pub fn set_recording_started_sender( &mut self, sender: Option<Sender<RecordingStarted>>, )
pub fn set_recording_finished_sender( &mut self, sender: Option<Sender<RecordingFinished>>, )
Trait Implementations§
Source§impl ApplicationsAPI for AriClient
impl ApplicationsAPI for AriClient
Source§fn filter<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
filter: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn filter<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
filter: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Filter application events types.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Application>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Application>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get details of an application.
Source§fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Application>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Application>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all applications.
Source§fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
event_source: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
event_source: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe an application to a event source.
Source§fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
event_source: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
application_name: &'life1 str,
event_source: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unsubscribe an application from an event source.
Source§impl ChannelsAPI for AriClient
impl ChannelsAPI for AriClient
Source§fn answer<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn answer<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Answer a channel.
Source§fn play<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
media: &'life2 str,
_playback_id: Option<String>,
_lang: Option<String>,
_offsetms: Option<usize>,
_skipms: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Playback>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn play<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
media: &'life2 str,
_playback_id: Option<String>,
_lang: Option<String>,
_offsetms: Option<usize>,
_skipms: Option<usize>,
) -> Pin<Box<dyn Future<Output = Result<Playback>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Play media to a channel
Source§fn stop_play<'life0, 'life1, 'async_trait>(
&'life0 self,
playback_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_play<'life0, 'life1, 'async_trait>(
&'life0 self,
playback_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop playing particular playback
Source§fn get_variable<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
var_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_variable<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
var_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the value of a channel variable
Source§fn set_variable<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
var_name: &'life2 str,
var_value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_variable<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
var_name: &'life2 str,
var_value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set the value of a channel variable
Source§fn hangup<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn hangup<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Hang up the channel
Source§fn continue_in_dialplan<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn continue_in_dialplan<'life0, 'life1, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Exit application; continue execution in the dialplan
Source§fn snoop<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
app: &'life2 str,
spy: Option<Direction>,
whisper: Option<Direction>,
) -> Pin<Box<dyn Future<Output = Result<Channel>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn snoop<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
app: &'life2 str,
spy: Option<Direction>,
whisper: Option<Direction>,
) -> Pin<Box<dyn Future<Output = Result<Channel>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a new channel to snoop (spy/whisper) on a specific channel
Source§fn record<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
filepath: Option<&'life2 str>,
audio_format: Option<&'life3 str>,
terminate_on: Option<&'life4 str>,
max_duration: Option<usize>,
max_silence: Option<usize>,
if_exists: Option<&'life5 str>,
beep: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn record<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
channel_id: &'life1 str,
filepath: Option<&'life2 str>,
audio_format: Option<&'life3 str>,
terminate_on: Option<&'life4 str>,
max_duration: Option<usize>,
max_silence: Option<usize>,
if_exists: Option<&'life5 str>,
beep: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Record audio from a channel. Default filepath: /var/spool/asterisk/recording/channel_id.wav
Source§impl RecordingsAPI for AriClient
impl RecordingsAPI for AriClient
Source§fn get_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a live recording file over the ari.
Source§fn stop_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stop_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stop a live recording and store it.
Source§fn pause_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pause_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Pause a live recording.
Source§fn unpause_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unpause_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unpause a live recording.
Source§fn mute_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mute_recording<'life0, 'life1, 'async_trait>(
&'life0 self,
recording_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mute a live recording.
Auto Trait Implementations§
impl Freeze for AriClient
impl RefUnwindSafe for AriClient
impl Send for AriClient
impl Sync for AriClient
impl Unpin for AriClient
impl UnwindSafe for AriClient
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
Mutably borrows from an owned value. Read more