summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_transaction.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2005-11-13 19:40:44 +0000
committerBenny Prijono <bennylp@teluu.com>2005-11-13 19:40:44 +0000
commita08b589d09d5197f9a76d549a189e4686bd2ca8c (patch)
tree549904e7680dfab96b3ce579b1843c5d58107100 /pjsip/include/pjsip/sip_transaction.h
parent8df70c6d5fef443506618bf31b686d53fef3f259 (diff)
Applying license to pjproject
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@49 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip/sip_transaction.h')
-rw-r--r--pjsip/include/pjsip/sip_transaction.h354
1 files changed, 188 insertions, 166 deletions
diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h
index cdb11235..2b7c3646 100644
--- a/pjsip/include/pjsip/sip_transaction.h
+++ b/pjsip/include/pjsip/sip_transaction.h
@@ -1,63 +1,85 @@
-/* $Id$
- */
-#ifndef __PJSIP_SIP_TRANSACTION_H__
-#define __PJSIP_SIP_TRANSACTION_H__
-
-/**
- * @file sip_transaction.h
- * @brief SIP Transaction
- */
-
-#include <pjsip/sip_msg.h>
-#include <pjsip/sip_resolve.h>
-#include <pj/timer.h>
-
-PJ_BEGIN_DECL
-
-/**
- * @defgroup PJSIP_TRANSACT SIP Transaction
- * @ingroup PJSIP
- * @{
- */
-
-/* Forward decl. */
-struct pjsip_transaction;
-
-
-/**
- * Transaction state.
- */
-typedef enum pjsip_tsx_state_e
-{
- PJSIP_TSX_STATE_NULL,
- PJSIP_TSX_STATE_CALLING,
- PJSIP_TSX_STATE_TRYING,
- PJSIP_TSX_STATE_PROCEEDING,
- PJSIP_TSX_STATE_COMPLETED,
- PJSIP_TSX_STATE_CONFIRMED,
- PJSIP_TSX_STATE_TERMINATED,
- PJSIP_TSX_STATE_DESTROYED,
- PJSIP_TSX_STATE_MAX,
-} pjsip_tsx_state_e;
-
-
-/**
- * State of the transport in the transaction.
- * The transport is progressing independently of the transaction.
- */
-typedef enum pjsip_tsx_transport_state_e
-{
- PJSIP_TSX_TRANSPORT_STATE_NULL,
- PJSIP_TSX_TRANSPORT_STATE_RESOLVING,
- PJSIP_TSX_TRANSPORT_STATE_CONNECTING,
- PJSIP_TSX_TRANSPORT_STATE_FINAL,
-} pjsip_tsx_transport_state_e;
-
-
-/**
- * Transaction state.
- */
-struct pjsip_transaction
+/* $Id$
+ */
+/*
+ * PJSIP - SIP Stack
+ * (C)2003-2005 Benny Prijono <bennylp@bulukucing.org>
+ *
+ * Author:
+ * Benny Prijono <bennylp@bulukucing.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+#ifndef __PJSIP_SIP_TRANSACTION_H__
+#define __PJSIP_SIP_TRANSACTION_H__
+
+/**
+ * @file sip_transaction.h
+ * @brief SIP Transaction
+ */
+
+#include <pjsip/sip_msg.h>
+#include <pjsip/sip_resolve.h>
+#include <pj/timer.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJSIP_TRANSACT SIP Transaction
+ * @ingroup PJSIP
+ * @{
+ */
+
+/* Forward decl. */
+struct pjsip_transaction;
+
+
+/**
+ * Transaction state.
+ */
+typedef enum pjsip_tsx_state_e
+{
+ PJSIP_TSX_STATE_NULL,
+ PJSIP_TSX_STATE_CALLING,
+ PJSIP_TSX_STATE_TRYING,
+ PJSIP_TSX_STATE_PROCEEDING,
+ PJSIP_TSX_STATE_COMPLETED,
+ PJSIP_TSX_STATE_CONFIRMED,
+ PJSIP_TSX_STATE_TERMINATED,
+ PJSIP_TSX_STATE_DESTROYED,
+ PJSIP_TSX_STATE_MAX,
+} pjsip_tsx_state_e;
+
+
+/**
+ * State of the transport in the transaction.
+ * The transport is progressing independently of the transaction.
+ */
+typedef enum pjsip_tsx_transport_state_e
+{
+ PJSIP_TSX_TRANSPORT_STATE_NULL,
+ PJSIP_TSX_TRANSPORT_STATE_RESOLVING,
+ PJSIP_TSX_TRANSPORT_STATE_CONNECTING,
+ PJSIP_TSX_TRANSPORT_STATE_FINAL,
+} pjsip_tsx_transport_state_e;
+
+
+/**
+ * Transaction state.
+ */
+struct pjsip_transaction
{
/*
* Administrivia
@@ -85,17 +107,17 @@ struct pjsip_transaction
int handle_ack; /**< Should we handle ACK? */
/** Handler according to current state. */
- pj_status_t (*state_handler)(struct pjsip_transaction *, pjsip_event *);
+ pj_status_t (*state_handler)(struct pjsip_transaction *, pjsip_event *);
/*
* Transport.
- */
+ */
pjsip_tsx_transport_state_e transport_state;/**< Transport's state. */
pjsip_host_port dest_name; /**< Destination address. */
pjsip_server_addresses remote_addr; /**< Addresses resolved. */
int current_addr; /**< Address currently used. */
- pjsip_transport_t *transport; /**< Transport to use. */
+ pjsip_transport_t *transport; /**< Transport to use. */
/*
* Messages and timer.
@@ -104,16 +126,16 @@ struct pjsip_transaction
int has_unsent_msg; /**< Non-zero if tsx need to
transmit msg once resolver
completes. */
- int retransmit_count;/**< Retransmission count. */
+ int retransmit_count;/**< Retransmission count. */
pj_timer_entry retransmit_timer;/**< Retransmit timer. */
pj_timer_entry timeout_timer; /**< Timeout timer. */
- /** Module specific data. */
- void *module_data[PJSIP_MAX_MODULE];
-};
-
-
-/**
+ /** Module specific data. */
+ void *module_data[PJSIP_MAX_MODULE];
+};
+
+
+/**
* Init transaction as UAC from the specified transmit data (\c tdata).
* The transmit data must have a valid \c Request-Line and \c CSeq header.
* If \c Route headers are present, it will be used to calculate remote
@@ -129,110 +151,110 @@ struct pjsip_transaction
* At the end of the function, the transaction will start resolving the
* addresses of remote server to contact. Transport will be acquired as soon
* as the resolving job completes.
- *
- * @param tsx The transaction.
+ *
+ * @param tsx The transaction.
* @param tdata The transmit data.
- *
- * @return PJ_SUCCESS if successfull.
- */
-PJ_DECL(pj_status_t) pjsip_tsx_init_uac( pjsip_transaction *tsx,
- pjsip_tx_data *tdata);
-
-/**
+ *
+ * @return PJ_SUCCESS if successfull.
+ */
+PJ_DECL(pj_status_t) pjsip_tsx_init_uac( pjsip_transaction *tsx,
+ pjsip_tx_data *tdata);
+
+/**
* Init transaction as UAS.
- *
- * @param tsx The transaction to be initialized.
+ *
+ * @param tsx The transaction to be initialized.
* @param rdata The received incoming request.
- *
- * @return PJ_SUCCESS if successfull.
- */
-PJ_DECL(pj_status_t) pjsip_tsx_init_uas( pjsip_transaction *tsx,
- pjsip_rx_data *rdata);
-
-/**
+ *
+ * @return PJ_SUCCESS if successfull.
+ */
+PJ_DECL(pj_status_t) pjsip_tsx_init_uas( pjsip_transaction *tsx,
+ pjsip_rx_data *rdata);
+
+/**
* Process incoming message for this transaction.
- *
- * @param tsx The transaction.
- * @param rdata The incoming message.
- */
-PJ_DECL(void) pjsip_tsx_on_rx_msg( pjsip_transaction *tsx,
- pjsip_rx_data *rdata);
-
-/**
+ *
+ * @param tsx The transaction.
+ * @param rdata The incoming message.
+ */
+PJ_DECL(void) pjsip_tsx_on_rx_msg( pjsip_transaction *tsx,
+ pjsip_rx_data *rdata);
+
+/**
* Transmit message with this transaction.
- *
- * @param tsx The transaction.
- * @param tdata The outgoing message.
- */
-PJ_DECL(void) pjsip_tsx_on_tx_msg( pjsip_transaction *tsx,
- pjsip_tx_data *tdata);
-
-
-/**
- * Transmit ACK message for 2xx/INVITE with this transaction. The ACK for
- * non-2xx/INVITE is automatically sent by the transaction.
- * This operation is only valid if the transaction is configured to handle ACK
- * (tsx->handle_ack is non-zero). If this attribute is not set, then the
- * transaction will comply with RFC-3261, i.e. it will set itself to
+ *
+ * @param tsx The transaction.
+ * @param tdata The outgoing message.
+ */
+PJ_DECL(void) pjsip_tsx_on_tx_msg( pjsip_transaction *tsx,
+ pjsip_tx_data *tdata);
+
+
+/**
+ * Transmit ACK message for 2xx/INVITE with this transaction. The ACK for
+ * non-2xx/INVITE is automatically sent by the transaction.
+ * This operation is only valid if the transaction is configured to handle ACK
+ * (tsx->handle_ack is non-zero). If this attribute is not set, then the
+ * transaction will comply with RFC-3261, i.e. it will set itself to
* TERMINATED state when it receives 2xx/INVITE.
- *
- * @param tsx The transaction.
- * @param tdata The ACK request.
- */
-PJ_DECL(void) pjsip_tsx_on_tx_ack( pjsip_transaction *tsx,
- pjsip_tx_data *tdata);
-
-/**
+ *
+ * @param tsx The transaction.
+ * @param tdata The ACK request.
+ */
+PJ_DECL(void) pjsip_tsx_on_tx_ack( pjsip_transaction *tsx,
+ pjsip_tx_data *tdata);
+
+/**
* Force terminate transaction.
- *
- * @param tsx The transaction.
- * @param code The status code to report.
- */
-PJ_DECL(void) pjsip_tsx_terminate( pjsip_transaction *tsx,
- int code );
-
-/**
- * Create transaction key, which is used to match incoming requests
+ *
+ * @param tsx The transaction.
+ * @param code The status code to report.
+ */
+PJ_DECL(void) pjsip_tsx_terminate( pjsip_transaction *tsx,
+ int code );
+
+/**
+ * Create transaction key, which is used to match incoming requests
* or response (retransmissions) against transactions.
- *
- * @param pool The pool
- * @param key Output key.
- * @param role The role of the transaction.
- * @param method The method to be put as a key.
+ *
+ * @param pool The pool
+ * @param key Output key.
+ * @param role The role of the transaction.
+ * @param method The method to be put as a key.
* @param rdata The received data to calculate.
*
* @return PJ_SUCCESS or the appropriate error code.
- */
-PJ_DECL(pj_status_t) pjsip_tsx_create_key( pj_pool_t *pool,
- pj_str_t *key,
- pjsip_role_e role,
- const pjsip_method *method,
- const pjsip_rx_data *rdata );
-
-
-/**
- * @}
- */
-
-/*
- * Internal.
- */
-
-/*
- * Get the string name for the state.
- */
-PJ_DECL(const char *) pjsip_tsx_state_str(pjsip_tsx_state_e state);
-
-/*
- * Get the role name.
- */
-PJ_DECL(const char *) pjsip_role_name(pjsip_role_e role);
-
-
-/* Thread Local Storage ID for transaction lock (initialized by endpoint) */
-extern long pjsip_tsx_lock_tls_id;
-
-PJ_END_DECL
-
-#endif /* __PJSIP_TRANSACT_H__ */
-
+ */
+PJ_DECL(pj_status_t) pjsip_tsx_create_key( pj_pool_t *pool,
+ pj_str_t *key,
+ pjsip_role_e role,
+ const pjsip_method *method,
+ const pjsip_rx_data *rdata );
+
+
+/**
+ * @}
+ */
+
+/*
+ * Internal.
+ */
+
+/*
+ * Get the string name for the state.
+ */
+PJ_DECL(const char *) pjsip_tsx_state_str(pjsip_tsx_state_e state);
+
+/*
+ * Get the role name.
+ */
+PJ_DECL(const char *) pjsip_role_name(pjsip_role_e role);
+
+
+/* Thread Local Storage ID for transaction lock (initialized by endpoint) */
+extern long pjsip_tsx_lock_tls_id;
+
+PJ_END_DECL
+
+#endif /* __PJSIP_TRANSACT_H__ */
+