pub struct SipPassthroughHeader { /* private fields */ }Expand description
A FreeSWITCH SIP passthrough header variable name.
Combines a SipHeaderPrefix (direction/method) with a SIP header name
to produce the channel variable name used on the wire. Use with
HeaderLookup::variable() for lookups,
or insert into Variables for originate commands.
§Typed constructors (known SIP headers)
use freeswitch_types::variables::{SipPassthroughHeader, SipHeaderPrefix};
use sip_header::SipHeader;
let h = SipPassthroughHeader::request(SipHeader::CallInfo);
assert_eq!(h.as_str(), "sip_h_Call-Info");
let h = SipPassthroughHeader::invite(SipHeader::CallInfo);
assert_eq!(h.as_str(), "sip_i_call_info");§Raw constructors (custom headers)
use freeswitch_types::variables::SipPassthroughHeader;
let h = SipPassthroughHeader::request_raw("X-Tenant").unwrap();
assert_eq!(h.as_str(), "sip_h_X-Tenant");Implementations§
Source§impl SipPassthroughHeader
impl SipPassthroughHeader
Sourcepub fn new(prefix: SipHeaderPrefix, header: SipHeader) -> Self
pub fn new(prefix: SipHeaderPrefix, header: SipHeader) -> Self
Create from a prefix and a known SipHeader.
Sourcepub fn new_raw(
prefix: SipHeaderPrefix,
name: impl Into<String>,
) -> Result<Self, InvalidHeaderName>
pub fn new_raw( prefix: SipHeaderPrefix, name: impl Into<String>, ) -> Result<Self, InvalidHeaderName>
Create from a prefix and an arbitrary header name.
Returns Err if the name contains \n or \r (wire injection risk).
Sourcepub fn invite_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
pub fn invite_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
Incoming INVITE header from raw name.
Sourcepub fn request_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
pub fn request_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
Outgoing request header from raw name.
Sourcepub fn response_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
pub fn response_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
Outgoing response header from raw name.
Sourcepub fn provisional(header: SipHeader) -> Self
pub fn provisional(header: SipHeader) -> Self
Provisional response header (sip_ph_*).
Sourcepub fn provisional_raw(
name: impl Into<String>,
) -> Result<Self, InvalidHeaderName>
pub fn provisional_raw( name: impl Into<String>, ) -> Result<Self, InvalidHeaderName>
Provisional response header from raw name.
Sourcepub fn bye_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
pub fn bye_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
BYE request header from raw name.
Sourcepub fn no_bye_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
pub fn no_bye_raw(name: impl Into<String>) -> Result<Self, InvalidHeaderName>
Suppress header on BYE from raw name.
Sourcepub fn prefix(&self) -> SipHeaderPrefix
pub fn prefix(&self) -> SipHeaderPrefix
The prefix (direction/method) of this variable.
Sourcepub fn canonical_name(&self) -> &str
pub fn canonical_name(&self) -> &str
The canonical SIP header name (e.g. "Call-Info", "X-Tenant").
Sourcepub fn extract_from(&self, message: &str) -> Option<String>
pub fn extract_from(&self, message: &str) -> Option<String>
Extract this header’s value from a raw SIP message.
Delegates to sip_header::extract_header() using the canonical name.
Sourcepub fn is_array_header(&self) -> bool
pub fn is_array_header(&self) -> bool
Whether this header may contain ARRAY-encoded values when read from FreeSWITCH.
Only meaningful for the Invite prefix — FreeSWITCH stores multi-valued
incoming SIP headers in ARRAY::val1|:val2 format. For other prefixes
(which are write-only), this always returns false.
Trait Implementations§
Source§impl AsRef<str> for SipPassthroughHeader
impl AsRef<str> for SipPassthroughHeader
Source§impl Clone for SipPassthroughHeader
impl Clone for SipPassthroughHeader
Source§fn clone(&self) -> SipPassthroughHeader
fn clone(&self) -> SipPassthroughHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SipPassthroughHeader
impl Debug for SipPassthroughHeader
Source§impl Display for SipPassthroughHeader
impl Display for SipPassthroughHeader
Source§impl From<SipPassthroughHeader> for String
impl From<SipPassthroughHeader> for String
Source§fn from(h: SipPassthroughHeader) -> Self
fn from(h: SipPassthroughHeader) -> Self
Source§impl FromStr for SipPassthroughHeader
impl FromStr for SipPassthroughHeader
Source§impl Hash for SipPassthroughHeader
impl Hash for SipPassthroughHeader
Source§impl PartialEq for SipPassthroughHeader
impl PartialEq for SipPassthroughHeader
Source§impl VariableName for SipPassthroughHeader
impl VariableName for SipPassthroughHeader
impl Eq for SipPassthroughHeader
impl StructuralPartialEq for SipPassthroughHeader
Auto Trait Implementations§
impl Freeze for SipPassthroughHeader
impl RefUnwindSafe for SipPassthroughHeader
impl Send for SipPassthroughHeader
impl Sync for SipPassthroughHeader
impl Unpin for SipPassthroughHeader
impl UnsafeUnpin for SipPassthroughHeader
impl UnwindSafe for SipPassthroughHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.