libsip 0.2.6

SIP protocol Implementation, with a focus towords softphone clients.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::{SipMessage, SipMessageExt};

pub trait RegisterRequestExt {
    /// Returns one of:
    /// * "expires" of "Contact"
    /// * "Expires"
    ///
    /// [RFC3261, Page 65](https://tools.ietf.org/html/rfc3261#page-65) defines this behavior
    fn expires(&self) -> Option<u32>;
}

impl RegisterRequestExt for SipMessage {
    fn expires(&self) -> Option<u32> {
        self.contact_header_expires().or(self.expires_header())
    }
}