xref: /titanic_41/usr/src/man/man3sip/sip_get_dialog_state.3sip (revision d583b39bfb4e2571d3e41097c5c357ffe353ad45)
te
Copyright (c) 2008, 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]
SIP_GET_DIALOG_STATE 3SIP "Jan 11, 2008"
NAME
sip_get_dialog_state, sip_get_dialog_callid, sip_get_dialog_local_tag, sip_get_dialog_remote_tag, sip_get_dialog_local_uri, sip_get_dialog_remote_uri, sip_get_dialog_local_contact_uri, sip_get_dialog_remote_target_uri, sip_get_dialog_route_set, sip_get_dialog_local_cseq, sip_get_dialog_remote_cseq, sip_get_dialog_type, sip_get_dialog_method, sip_is_dialog_secure, sip_get_dialog_msgcnt - get dialog attributes
SYNOPSIS

cc [ flag ... ] file ... -lsip [ library ... ]
#include <sip.h>

int sip_get_dialog_state(sip_dialog_t dialog, int *error);

const sip_str_t *sip_get_dialog_callid(sip_dialog_t dialog,
 int *error);

const sip_str_t *sip_get_dialog_local_tag(sip_dialog_t dialog,
 int *error);

const sip_str_t *sip_get_dialog_remote_tag(sip_dialog_t dialog,
 int *error);

const struct sip_uri *sip_get_dialog_local_uri(sip_dialog_t dialog,
 int *error);

const struct sip_uri *sip_get_dialog_remote_uri(sip_dialog_t dialog,
 int *error);

const struct sip_uri *sip_get_dialog_local_contact_uri(
 sip_dialog_t dialog, int *error);

const struct sip_uri *sip_get_dialog_remote_target_uri(
 sip_dialog_t dialog, int *error);

const sip_str_t *sip_get_dialog_route_set(sip_dialog_t dialog,
 int *error);

boolean_t sip_is_dialog_secure(sip_dialog_t dialog,
 int *error);

uint32_t sip_get_dialog_local_cseq(sip_dialog_t dialog,
 int *error);

uint32_t sip_get_dialog_remote_cseq(sip_dialog_t dialog,
 int *error);

int sip_get_dialog_type(sip_dialog_t dialog,int *error);

int sip_get_dialog_method(sip_dialog_t dialog,int *error);

int sip_get_dialog_msgcnt(sip_dialog_t dialog,int *error);
DESCRIPTION

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.

The sip_get_dialog_state() returns the state of the dialog. A dialog can be in one of the following states:

SIP_DLG_NEW

SIP_DLG_EARLY

SIP_DLG_CONFIRMED

SIP_DLG_DESTROYED

The sip_get_dialog_callid() function returns the call ID value maintained in the dialog.

The sip_get_dialog_local_tag() and sip_get_dialog_remote_tag() functions return the local and remote tag values, maintained in the dialog.

The sip_get_dialog_local_uri(), sip_get_dialog_remote_uri(), sip_get_dialog_local_contact_uri(), and sip_get_dialog_remote_target_uri() functions return the local, remote, local contract, and the remote target URIs, maintained in the dialog.

The sip_get_dialog_route_set() function returns the route set, if any, maintained in the dialog.

The sip_get_dialog_local_cseq() and sip_get_dialog_remote_cseq() functions return the local and remote CSEQ numbers maintained in the dialog.

The sip_get_dialog_type() function returns one of the following dialog types, depending on whether it is created by the client or the server. SIP_UAC_DIALOG

created by client

SIP_UAS_DIALOG

created by server

The sip_get_dialog_method() function returns the SIP method, INVITE or SUBSCRIBE, of the request that created the dialog.

The sip_is_dialog_secure() function returns B_TRUE if the dialog is secure and B_FALSE otherwise.

The sip_get_dialog_msgcnt() function returns the number of SIP messages (requests and responses) that were sent and received within the context of the given dialog.

RETURN VALUES

The sip_get_dialog_state(), sip_get_dialog_local_cseq(), sip_get_dialog_remote_cseq(), sip_get_dialog_type(), sip_get_dialog_method(), and sip_get_dialog_msgcnt() functions return the required value on success and -1 on failure.

The sip_get_dialog_callid(), sip_get_dialog_local_tag(), sip_get_dialog_remote_tag(), sip_get_dialog_local_uri(), sip_get_dialog_remote_uri(), sip_get_dialog_local_contact_uri(), sip_get_dialog_remote_target_uri(), and sip_get_dialog_route_set() functions return the required value on success and NULL on failure.

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

ERRORS

These functions take an error argument.

If the error is non-null, one of the following values is set: EINVAL

The dialog is NULL or the stack is not configured to manage dialogs.

ENOTSUP

The input SIP message cannot be modified.

ENOMEM

The memory allocation fails when the request/response line or the headers in the ACK request are created.

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

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE ATTRIBUTE VALUE
Interface Stability Committed
MT-Level MT-Safe
SEE ALSO

libsip(3LIB)