use crate::errors::Result;
use crate::models::playbacks::Playback;
use async_trait::async_trait;
#[async_trait]
pub trait ChannelsAPI {
async fn answer(&self, channel_id: &str) -> Result<()>;
async fn play(
&self,
channel_id: &str,
media: &str,
_playback_id: Option<String>,
_lang: Option<String>,
_offsetms: Option<usize>,
_skipms: Option<usize>,
) -> Result<Playback>;
async fn stop_play(&self, playback_id: &str) -> Result<()>;
async fn get_variable(&self, channel_id: &str, var_name: &str) -> Result<String>;
async fn set_variable(&self, channel_id: &str, var_name: &str, var_value: &str) -> Result<()>;
async fn hangup(&self, channel_id: &str) -> Result<()>;
async fn continue_in_dialplan(&self, channel_id: &str) -> Result<()>;
#[allow(clippy::too_many_arguments)]
async fn record(
&self,
channel_id: &str,
filepath: Option<&str>,
audio_format: Option<&str>,
terminate_on: Option<&str>,
max_duration: Option<usize>,
max_silence: Option<usize>,
if_exists: Option<&str>,
beep: Option<bool>,
) -> Result<()>;
}