From 48ed6ad43f43717d4d7a1cced8e7b386deb0f35a Mon Sep 17 00:00:00 2001 From: Karan Gauswami Date: Tue, 5 Sep 2023 20:42:12 +0530 Subject: [PATCH] Changed i128 to u32 for sleep duration, as negative values aren't expected, and u32 provides sufficient capacity (#4) --- src/dp_tools.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/dp_tools.rs b/src/dp_tools.rs index a9ad072..06afbcd 100644 --- a/src/dp_tools.rs +++ b/src/dp_tools.rs @@ -12,12 +12,12 @@ impl EslConnection { pub async fn playback(&self, file_path: &str) -> Result { self.execute(PLAYBACK_APP, file_path).await } - + /// record_session during outbound mode pub async fn record_session(&self, file_path: &str) -> Result { self.execute("record_session", file_path).await } - + /// send dtmf during outbound mode pub async fn send_dtmf(&self, dtmf_str: &str) -> Result { self.execute("send_dtmf", dtmf_str).await @@ -29,22 +29,21 @@ impl EslConnection { } /// sleep for specified milliseconds in outbound mode - pub async fn sleep(&self, millis: i128) -> Result { + pub async fn sleep(&self, millis: u32) -> Result { 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 { 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 { let args = format!("{} {}", loglevel, msg); self.execute("log", &args).await } - #[allow(clippy::too_many_arguments)] /// Used for mod_play_and_get_digits