提取 CSeq 头部中的方法名
(msg: &str)
| 465 | |
| 466 | /// 提取 CSeq 头部中的方法名 |
| 467 | pub fn extract_cseq_method(msg: &str) -> Option<String> { |
| 468 | for line in msg.lines() { |
| 469 | let trimmed = line.trim(); |
| 470 | let lower = trimmed.to_lowercase(); |
| 471 | if lower.starts_with("cseq:") { |
| 472 | let value = trimmed[5..].trim(); |
| 473 | // CSeq 格式: <序号> <方法> |
| 474 | let parts: Vec<&str> = value.split_whitespace().collect(); |
| 475 | if parts.len() >= 2 { |
| 476 | return Some(parts[1].to_uppercase()); |
| 477 | } |
| 478 | } |
| 479 | } |
| 480 | None |
| 481 | } |
| 482 | |
| 483 | /// 提取 Expires 头部值 |
| 484 | pub fn extract_expires(msg: &str) -> Option<u64> { |
no outgoing calls
no test coverage detected