pub mod client;
pub mod consts;
pub mod frame;
pub mod g711;
pub mod ie;
pub mod jitter;
#[cfg(feature = "dsp")]
pub mod resample;
#[cfg(feature = "audio")]
pub mod audio;
pub use client::{Command, Config, Event, PbxClient};
pub use frame::{FullFrame, MiniFrame};
pub use ie::Ie;
pub use jitter::{JitterBuffer, Pull};
pub fn md5_response(challenge: &str, secret: &str) -> String {
let mut input = String::with_capacity(challenge.len() + secret.len());
input.push_str(challenge);
input.push_str(secret);
format!("{:x}", md5::compute(input.as_bytes()))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn md5_known_vector() {
let r = md5_response("abc", "secret");
assert_eq!(r.len(), 32);
assert!(r.chars().all(|c| c.is_ascii_hexdigit() && !c.is_ascii_uppercase()));
}
}