Description

The sip_str_ptr parameter points to the start of the returned value and
sip_str_len supplies the length of the returned value.

For example, given the following request line in a SIP message sip_msg
that is input to sip_get_request_uri_str():

FROM : <Alice sip:alice@atlanta.com>;tag=1928301774

the return is a pointer to sip_str_t with the sip_str_ptr member pointing
to “A” of Alice and sip_str_len being set to 5, the length
of Alice.

Access functions for headers that can have multiple values take the value
as the input, while those that can have only one value take
the SIP message sip_msg as the input.

The sip_get_contact_display_name(), sip_get_from_display_name(), and sip_get_to_display_name() functions will return the display name, if
present, from the CONTACT header value, FROM and TO header respectively.

The sip_get_contact_uri_str(), sip_get_from_uri_str(), and sip_get_to_uri_str() functions will return the URI string from
the CONTACT value, FROM and TO header respectively.

The sip_get_from_tag() and sip_get_to_tag() functions will return the TAG parameter value, if
present, from the FROM and TO header, respectively, in the provided SIP
message sip_msg.

The sip_get_callid() function will return the value from the CALL-ID header in
the provided SIP message sip_msg.

The sip_get_callseq_num() function will return the call sequence number from the CSEQ
header in the provided SIP message sip_msg.

The sip_get_callseq_method() function will return the method from the CSEQ header in
the provided SIP message sip_msg. The method can be one of the
following:

INVITE

ACK

OPTIONS

BYE

CANCEL

REGISTER

REFER

INFO

SUBSCRIBE

NOTIFY

PRACK

UNKNOWN

The sip_get_via_sent_by_host(), sip_get_via_sent_by_port(), sip_get_via_sent_protocol_version(), sip_get_via_sent_protocol_name(), and sip_get_via_sent_transport() functions will return the sent-by host,
port (if present), protocol version, protocol name and transport information from the
provided VIA header value. Example, if the VIA value is given by
SIP/2.0/UDP bobspc.biloxi.com:5060, then the sent-by host is “bobspc.biloxi.com”, protocol name is “SIP”, protocol
version is “2.0”, port is 5060 and transport is UDP.

The sip_get_maxforward() function will return the value of the MAX-FORWARDS header in
the provided SIP message sip_msg.

INVITE

ACK

OPTIONS

BYE

CANCEL

REGISTER

REFER

INFO

SUBSCRIBE

NOTIFY

PRACK

UNKNOWN

The sip_get_content_length() function will return the value of the CONTENT-LENGTH header in
the provided SIP message sip_msg. The method can return one of the
following:

The sip_get_content_type() and sip_get_content_sub_type() functions will return the value of the Type
and Sub-Type field, respectively, from the CONTENT-TYPE header in the provided SIP
message sip_msg.

The sip_get_content() function will return the message body from the provided SIP
message sip_msg. The returned string is a copy of the message body
and the caller is responsible for freeing the string after use.

The sip_get_accept_type() and sip_get_accept_sub_type() functions will return the value of the Type
and Sub-Type field, respectively, from the provided ACCEPT header value.

The sip_get_accept_enc() function will return the content-coding from the provided ACCEPT-ENCODING header
value.

The sip_get_accept_lang() function will return the language from the provided ACCEPT-LANGUAGE
header value.

The sip_get_alert_info_uri() function will return the URI string from the provided ALERT-INFO
header value.

The sip_get_allow_method() function will return the SIP method from the provided ALLOW
header value. The method can return one of the following:

INVITE

ACK

OPTIONS

BYE

CANCEL

REGISTER

REFER

INFO

SUBSCRIBE

NOTIFY

PRACK

UNKNOWN

The sip_get_min_expire() function will return the time in seconds from the MIN-EXPIRES
header in the provided SIP message sip_msg.

The sip_get_mime_version() function will return the MIME version string from the MIME-VERSION
header in the provided SIP message sip_msg.

The sip_get_org() function will return the organization string value from the ORGANIZATION
header in the provided SIP message sip_msg.

The sip_get_priority() function will return the priority string value from the PRIORITY
header in the provided SIP message sip_msg.

The sip_get_replyto_display_name() and sip_get_replyto_uri_str() functions will return the display name (if present)
and the URI string, respectively, from the REPLY-TO header in the provided
SIP message sip_msg.

The sip_get_date_time(), sip_get_date_day(), sip_get_date_month(), sip_get_date_wkday(), sip_get_date_year() and sip_get_date_timezone() functions will return the
time, day, month, week day, year and timezone value from the DATE header
in the provided SIP message sip_msg. Example, if the DATE header has
the following value:

Sat, 13 Nov 2010 23:29:00 GMT

the time is “23:29:00 ”, week day is “Sat”, day is “13”,
month is “Nov”, year is “2010”, timezone is “GMT”.

The sip_get_content_disp() function will return the content-disposition type from the CONTENT-DISPOSITION header
in the provided SIP message sip_msg.

The sip_get_content_enc() function will return the content-coding value from the CONTENT-ENCODING header
value.

The sip_get_error_info_uri() function will return the URI string from the provided ERROR-INFO
header value.

The sip_get_expires() function will return the time in seconds from the EXPIRES
header in the provided SIP message sip_msg.

The sip_get_require() function will return the option-tag value from the provided REQUIRE
header value.

The sip_get_subject() function will return the value of the SUBJECT header in
the provided SIP message sip_msg.

The sip_get_supported() function will return the extension value from the provided SUPPORTED
header value.

The sip_get_tstamp_delay() function will return the value from the TIMESTAMP header in
the provided SIP message sip_msg.

The sip_get_unsupported() function will return the extension value from the provided UNSUPPORTED
header value.

The sip_get_server() function will return the value from the SERVER header in
the provided SIP message sip_msg.

The sip_get_user_agent() function will return the value from the USER-AGENT header in
the provided SIP message sip_msg.

The sip_get_warning_code(), sip_get_warning_agent(), and sip_get_warning_text() functions will return the value of the
warn-code, warn-agent and warn-text, respectively, in the provided WARNING header value.

The sip_get_call_info_uri() function will return the URI string in the provided CALL-INFO
header value.

The sip_get_in_reply_to() function will return the Call-Id value in the provided IN-REPLY-TO
header value.

The sip_get_retry_after_time(), and sip_get_retry_after_cmts() functions return the time and comments (if any),
respectively, from the RETRY-AFTER header in the provided SIP message sip_msg.

The sip_get_passertedid_display_name() and sip_get_passertedid_uri_str() functions will return the display name (if any)
and the URI string, respectively, in the provided P-ASSERTED-IDENTITY header value.

The sip_get_ppreferredid_display_name() and sip_get_ppreferredid_uri_str() functions will return the display name (if any)
and the URI string, respectively, in the provided P-PREFERRED-IDENTITY header value.

The sip_get_rack_resp_num(), sip_get_rack_cseq_num(), and sip_get_rack_method() functions will return the response-number, the CSEQ
number and the SIP method from the RACK header in the provided SIP
message sip_msg. The method can return one of the following:

INVITE

ACK

OPTIONS

BYE

CANCEL

REGISTER

REFER

INFO

SUBSCRIBE

NOTIFY

PRACK

UNKNOWN

The sip_get_rseq_resp_num() function will return the response-number, the RSEQ header in the
provided SIP message sip_msg.

The sip_get_priv_value() function will return the priv-value in the provided PRIVACY header
value.

The sip_get_route_uri_str() and sip_get_route_display_name() functions will return the URI string, and display
name (if present) from the provided ROUTE or RECORD-ROUTE header value.

The sip_get_author_scheme() function will return the scheme from the AUTHORIZATION header in
the provided SIP message sip_msg.

The sip_get_author_param() function will return the value of the parameter specified in
name from the AUTHORIZATION header in the SIP message sip_msg.

The sip_get_authen_info() function will return the authentication information from the provided AUTHORIZATION-INFO
header value.

The sip_get_proxy_authen_scheme() function will return the scheme from the PROXY-AUTHENTICATE header in
the SIP message sip_msg.

The sip_get_proxy_authen_param() function will return the value of the parameter in name
from the PROXY-AUTHENTICATE header in the SIP message sip_msg.

The sip_get_proxy_author_scheme() function will return the value of the scheme from the
PROXY-AUTHORIZATION header in the SIP message sip_msg.

The sip_get_proxy_author_param() function will return the value of the parameter specified in
name from the PROXY-AUTHORIZATION header in the SIP message sip_msg.

The sip_get_proxy_require() function will return the option-tag from the provided PROXY-REQUIRE header
value.

The sip_get_www_authen_scheme() function will return the challenge from the WWW-AUTHENTICATE header in
the SIP message sip_msg.

The sip_get_www_authen_param() function will return the value of the parameter specified in
name from the WWW-AUTHENTICATE header in the SIP message sip_msg.

The sip_get_allow_events() function returns the value of the allowed event from the
provided ALLOW-EVENTS header value.

The sip_get_event() function returns the event in the EVENT header in the
SIP message sip_msg.

The sip_get_substate() function the subscription state from the SUBSCRIPTION-STATE header in the
provided SIP message sip_msg.

The sip_get_content_lang() function will return the language from the provided CONTENT-LANGUAGE value.

The sip_get_tstamp_value() function will return the timestamp value from the TIMESTAMP header
in the SIP message sip_msg.

Return Values

For functions that return a pointer to sip_str_t, the return value is
the specified value on success or NULL in case of error. For
functions that return an integer, the return value is the specified value
on success and -1 on error.

The value of errno is not changed by these calls in the
event of an error.

Errors

These functions take a pointer to an integer error as an argument.
If the error is non-null, one of the following values is set:

EINVAL

The input SIP message sip_msg or the header value is null; or the specified header/header value is deleted.

EPROTO

The header value is not present or invalid. The parser could not parse it correctly.

ENOMEM

There is an error allocating memory for the return value.

On success, the value of the location pointed to by error is
set to 0.