MCPcopy Create free account
hub / github.com/619dev/minghe / extract_cseq_method

Function extract_cseq_method

src/sip/parser.rs:467–481  ·  view source on GitHub ↗

提取 CSeq 头部中的方法名

(msg: &str)

Source from the content-addressed store, hash-verified

465
466/// 提取 CSeq 头部中的方法名
467pub 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 头部值
484pub fn extract_expires(msg: &str) -> Option<u64> {

Callers 1

process_sip_messageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected