xref: /titanic_44/usr/src/man/man3sip/sip_get_trans_method.3sip (revision d4f95bf4d6ec7ef0f01e5ddf22813ac641edf019)
te
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]
SIP_GET_TRANS_METHOD 3SIP "Feb 10, 2007"
NAME
sip_get_trans_method, sip_get_trans_state, sip_get_trans_orig_msg, sip_get_trans_conn_obj, sip_get_trans_resp_msg, sip_get_trans_branchid - get transaction attributes
SYNOPSIS

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

sip_method_t sip_get_trans_method(sip_transaction_t sip_trans,
 int *error);

int sip_get_trans_state(sip_transaction_t trans, int *error);

const struct sip_message *sip_get_trans_orig_msg
 (sip_transaction_t sip_trans, int *error);

const struct sip_message *sip_get_trans_resp_msg
 (sip_transaction_t sip_trans, int *error);

const struct sip_conn_object *sip_get_trans_conn_obj
 (sip_transaction_t sip_trans, int *error);

char *sip_get_trans_branchid(sip_transaction_t trans, int *error);
DESCRIPTION

The sip_get_trans_method() function returns the method the SIP message that created the transaction sip_trans.

The sip_get_trans_state() function returns the state of the transaction sip_trans.

A newly created transaction is in the state:

SIP_NEW_TRANSACTION

A client transaction could be in one of the following states:

SIP_CLNT_CALLING

SIP_CLNT_INV_PROCEEDING

SIP_CLNT_INV_TERMINATED

SIP_CLNT_INV_COMPLETED

SIP_CLNT_TRYING

SIP_CLNT_NONINV_PROCEEDING

SIP_CLNT_NONINV_TERMINATED

SIP_CLNT_NONINV_COMPLETED

A server transaction could be in one of the following states:

SIP_SRV_INV_PROCEEDING

SIP_SRV_INV_COMPLETED

SIP_SRV_CONFIRMED

SIP_SRV_INV_TERMINATED

SIP_SRV_TRYING

SIP_SRV_NONINV_PROCEEDING

SIP_SRV_NONINV_COMPLETED

SIP_SRV_NONINV_TERMINATED

The sip_get_trans_orig_msg() function returns the message that created the transaction sip_trans. This could be a request on the client or a response on the server.

The sip_get_trans_resp_msg() function returns the last response that was sent on the transaction sip_trans. Typically, this response is used by the transaction layer for retransmissions for unreliable transports or for responding to retransmitted requests. A response that terminates a transaction is not returned.

The sip_get_trans_conn_obj() function returns the cached connection object, if any, in the transactionsip_trans.

The sip_get_trans_branchid() function returns the branch ID for the message that created the transactionsip_trans. The caller is responsible for freeing the returned string.

RETURN VALUES

The sip_get_trans_orig_msg(), sip_get_trans_resp_msg(), sip_get_trans_conn_obj(), and sip_get_trans_branchid() functions return the required value on success or NULL on failure.

The sip_get_trans_state() and sip_get_trans_method() functions return the required value on success and -1 on failure.

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

ERRORS

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

The input transaction sip_trans is NULL.

ENOMEM

For sip_get_trans_branchid() there is an error allocating memory for the branch ID string.

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)