Skip to content

Commit

Permalink
Changed i128 to u32 for sleep duration, as negative values aren't exp…
Browse files Browse the repository at this point in the history
…ected, and u32 provides sufficient capacity (#4)
  • Loading branch information
KaranGauswami authored Sep 5, 2023
1 parent 14dba13 commit 48ed6ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dp_tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ impl EslConnection {
pub async fn playback(&self, file_path: &str) -> Result<Event, EslError> {
self.execute(PLAYBACK_APP, file_path).await
}

/// record_session during outbound mode
pub async fn record_session(&self, file_path: &str) -> Result<Event, EslError> {
self.execute("record_session", file_path).await
}

/// send dtmf during outbound mode
pub async fn send_dtmf(&self, dtmf_str: &str) -> Result<Event, EslError> {
self.execute("send_dtmf", dtmf_str).await
Expand All @@ -29,22 +29,21 @@ impl EslConnection {
}

/// sleep for specified milliseconds in outbound mode
pub async fn sleep(&self, millis: i128) -> Result<Event, EslError> {
pub async fn sleep(&self, millis: u32) -> Result<Event, EslError> {
self.execute("sleep", &millis.to_string()).await
}

///set a channel variable
///set a channel variable
pub async fn set_variable(&self, var: &str, value: &str) -> Result<Event, EslError> {
let args = format!("{}={}", var, value);
self.execute("set", &args).await
}

///add a freeswitch log
pub async fn fs_log(&self, loglevel: &str, msg: &str) -> Result<Event, EslError> {
let args = format!("{} {}", loglevel, msg);
self.execute("log", &args).await
}


#[allow(clippy::too_many_arguments)]
/// Used for mod_play_and_get_digits
Expand Down

0 comments on commit 48ed6ad

Please sign in to comment.