Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
cc [ flag ... ] file ... -lsip [ library ... ] #include <sip.h> const sip_str_t *sip_get_contact_display_name(sip_header_value_t value, int *error);
const sip_str_t *sip_get_from_display_name(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_to_display_name(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_contact_uri_str(sip_header_value_t value, int *error);
const sip_str_t *sip_get_from_uri_str(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_to_uri_str(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_from_tag(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_to_tag(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_callid(sip_msg_t sip_msg, int *error);
int sip_get_callseq_num(sip_msg_t sip_msg, int *error);
sip_method_t sip_get_callseq_method(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_via_sent_by_host(sip_header_value_t value, int *error);
int sip_get_via_sent_by_port (sip_header_value_t value, int *error);
const sip_str_t *sip_get_via_sent_protocol_version (sip_header_value_t value, int *error);
const sip_str_t *sip_get_via_sent_transport(sip_header_value_t value, int *error);
int sip_get_maxforward(sip_msg_t sip_msg, int *error);
int sip_get_content_length(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_content_type(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_content_sub_type(sip_msg_t sip_msg, int *error);
char *sip_get_content(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_accept_type(sip_header_value_t value, int *error);
const sip_str_t *sip_get_accept_sub_type(sip_header_value_t value, int *error);
const sip_str_t *sip_get_accept_enc(sip_header_value_t value, int *error);
const sip_str_t *sip_get_accept_lang(sip_header_value_t value, int *error);
const sip_str_t *sip_get_alert_info_uri(sip_header_value_t value, int *error);
sip_method_t sip_get_allow_method(sip_header_value_t value, int *error);
int sip_get_min_expire(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_mime_version(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_org(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_priority(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_replyto_display_name(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_replyto_uri_str(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_date_time(sip_msg_t sip_msg, int *error);
int sip_get_date_day(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_date_month(sip_msg_t sip_msg, int *error);
int sip_get_date_year(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_date_wkday(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_date_timezone(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_content_disp(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_content_enc(sip_header_value_t value, int *error);
const sip_str_t *sip_get_error_info_uri(sip_header_value_t value, int *error);
int sip_get_expires(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_require(sip_header_value_t value, int *error);
const sip_str_t *sip_get_subject(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_supported(sip_header_value_t value, int *error);
const sip_str_t *sip_get_tstamp_delay(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_unsupported(sip_header_value_t value, int *error);
const sip_str_t *sip_get_server(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_user_agent(sip_msg_t sip_msg, int *error);
int sip_get_warning_code(sip_header_value_t value, int *error);
const sip_str_t *sip_get_warning_agent(sip_header_value_t value, int *error);
const sip_str_t *sip_get_warning_text(sip_header_value_t value, int *error);
const sip_str_t *sip_get_call_info_uri(sip_header_value_t value, int *error);
const sip_str_t *sip_get_in_reply_to(sip_header_value_t value, int *error);
int sip_get_retry_after_time(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_retry_after_cmts(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_passertedid_display_name (sip_header_value_t value, int *error);
const sip_str_t *sip_get_passertedid_uri_str (sip_header_value_t value, int *error);
int sip_get_rack_resp_num(sip_msg_t sip_msg, int *error);
int sip_get_rack_cseq_num(sip_msg_t sip_msg, int *error);
sip_method_t sip_get_rack_method(sip_msg_t sip_msg, int *error);
int sip_get_rseq_resp_num(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_priv_value(sip_header_value_t value, int *error);
const sip_str_t *sip_get_author_scheme(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_author_param(sip_msg_t sip_msg, char *name, int *error);
const sip_str_t *sip_get_authen_info(sip_header_value_t value, int *error);
const sip_str_t *sip_get_proxy_authen_scheme(sip_msg_t msg, int *error);
const sip_str_t *sip_get_proxy_authen_param(sip_msg_t sip_msg, char *name, int *error);
const sip_str_t *sip_get_proxy_author_scheme(sip_msg_t msg, int *error);
const sip_str_t *sip_get_proxy_author_param(sip_msg_t sip_msg, char *name, int *error);
const sip_str_t *sip_get_proxy_require(sip_header_value_t value, int *error);
const sip_str_t *sip_get_www_authen_scheme(sip_msg_t msg, int *error);
const sip_str_t *sip_get_www_authen_param(sip_msg_t sip_msg, char *name, int *error);
const sip_str_t *sip_get_allow_events(sip_header_value_t value, int *error);
const sip_str_t *sip_get_event(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_substate(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_content_lang(sip_header_value_t value, int *error);
const sip_str_t *sip_get_tstamp_value(sip_msg_t sip_msg, int *error);
const sip_str_t *sip_get_route_uri_str(sip_header_value_t value, int *error);
const sip_str_t *sip_get_route_display_name(sip_header_value_t value, int *error);
For functions that return a pointer of type sip_str_t, sip_str_t is supplied by:
typedef struct sip_str { char *sip_str_ptr; int sip_str_len; }sip_str_t;
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.
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.
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.
The header value is not present or invalid. The parser could not parse it correctly.
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.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE ATTRIBUTE VALUE |
Interface Stability Committed |
MT-Level MT-Safe |
libsip(3LIB)