Ignore:
Timestamp:
Nov 11, 2005 7:01:31 PM (18 years ago)
Author:
bennylp
Message:

First clean compile of pjsip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/main/pjsip/include/pjsip/sip_transaction.h

    • Property svn:keywords set to Id
    r38 r43  
    11/* $Id$ 
    2  * 
    32 */ 
    43#ifndef __PJSIP_SIP_TRANSACTION_H__ 
     
    1211#include <pjsip/sip_msg.h> 
    1312#include <pjsip/sip_resolve.h> 
    14 //#include <pjsip/sip_config.h> 
    15 //#include <pjsip/sip_endpoint.h> 
    1613#include <pj/timer.h> 
    1714 
     
    2421 */ 
    2522 
     23/* Forward decl. */ 
    2624struct pjsip_transaction; 
    2725 
     
    6260struct pjsip_transaction 
    6361{ 
    64     pj_pool_t                  *pool; 
    65     pjsip_endpoint             *endpt; 
    66     char                        obj_name[PJ_MAX_OBJ_NAME]; 
    67     pjsip_role_e                role; 
    68     int                         status_code; 
    69     pjsip_tsx_state_e           state; 
    70     int (*state_handler)(struct pjsip_transaction *, pjsip_event *); 
    71  
    72     pj_mutex_t                 *mutex; 
    73     pjsip_method                method; 
    74     int                         cseq; 
    75     pj_str_t                    transaction_key; 
    76     pj_str_t                    branch; 
    77  
    78     pjsip_tsx_transport_state_e transport_state; 
    79     pjsip_host_port             dest_name; 
    80     int                         current_addr; 
    81     pjsip_server_addresses      remote_addr; 
    82     pjsip_transport_t          *transport; 
    83  
    84     pjsip_tx_data              *last_tx; 
    85     int                         has_unsent_msg; 
    86     int                         handle_ack; 
    87     int                         retransmit_count; 
    88  
    89     pj_timer_entry              retransmit_timer; 
    90     pj_timer_entry              timeout_timer; 
     62    /* 
     63     * Administrivia 
     64     */ 
     65    pj_pool_t                  *pool;           /**< Pool owned by the tsx. */ 
     66    pjsip_endpoint             *endpt;          /**< Endpoint instance.     */ 
     67    pj_mutex_t                 *mutex;          /**< Mutex for this tsx.    */ 
     68    char                        obj_name[PJ_MAX_OBJ_NAME];  /**< Tsx name.  */ 
     69    int                         tracing;        /**< Tracing enabled?       */ 
     70 
     71    /* 
     72     * Transaction identification. 
     73     */ 
     74    pjsip_role_e                role;           /**< Role (UAS or UAC)      */ 
     75    pjsip_method                method;         /**< The method.            */ 
     76    int                         cseq;           /**< The CSeq               */ 
     77    pj_str_t                    transaction_key;/**< hash table key.        */ 
     78    pj_str_t                    branch;         /**< The branch Id.         */ 
     79 
     80    /* 
     81     * State and status. 
     82     */ 
     83    int                         status_code;    /**< Last status code seen. */ 
     84    pjsip_tsx_state_e           state;          /**< State.                 */ 
     85    int                         handle_ack;     /**< Should we handle ACK?  */ 
     86 
     87    /** Handler according to current state. */ 
     88    pj_status_t (*state_handler)(struct pjsip_transaction *, pjsip_event *); 
     89 
     90    /* 
     91     * Transport. 
     92     */ 
     93    pjsip_tsx_transport_state_e transport_state;/**< Transport's state.     */ 
     94    pjsip_host_port             dest_name;      /**< Destination address.   */ 
     95    pjsip_server_addresses      remote_addr;    /**< Addresses resolved.    */ 
     96    int                         current_addr;   /**< Address currently used. */ 
     97 
     98    pjsip_transport_t          *transport;      /**< Transport to use.      */ 
     99 
     100    /* 
     101     * Messages and timer. 
     102     */ 
     103    pjsip_tx_data              *last_tx;        /**< Msg kept for retrans.  */ 
     104    int                         has_unsent_msg; /**< Non-zero if tsx need to  
     105                                                     transmit msg once resolver 
     106                                                     completes.             */ 
     107    int                         retransmit_count;/**< Retransmission count. */ 
     108    pj_timer_entry              retransmit_timer;/**< Retransmit timer.     */ 
     109    pj_timer_entry              timeout_timer;  /**< Timeout timer.         */ 
     110 
     111    /** Module specific data. */ 
    91112    void                       *module_data[PJSIP_MAX_MODULE]; 
    92113}; 
     
    94115 
    95116/**  
    96  * Init transaction as UAC. 
    97  * @param tsx the transaction. 
    98  * @param tdata the transmit data. 
    99  * @return PJ_SUCCESS if successfull. 
     117 * Init transaction as UAC from the specified transmit data (\c tdata). 
     118 * The transmit data must have a valid \c Request-Line and \c CSeq header. 
     119 * If \c Route headers are present, it will be used to calculate remote 
     120 * destination. 
     121 * 
     122 * If \c Via header does not exist, it will be created along with a unique 
     123 * \c branch parameter. If it exists and contains branch parameter, then 
     124 * the \c branch parameter will be used as is as the transaction key. 
     125 * 
     126 * The \c Route headers in the transmit data, if present, are used to  
     127 * calculate remote destination. 
     128 * 
     129 * At the end of the function, the transaction will start resolving the 
     130 * addresses of remote server to contact. Transport will be acquired as soon 
     131 * as the resolving job completes. 
     132 * 
     133 * @param tsx       The transaction. 
     134 * @param tdata     The transmit data. 
     135 * 
     136 * @return          PJ_SUCCESS if successfull. 
    100137 */ 
    101138PJ_DECL(pj_status_t) pjsip_tsx_init_uac( pjsip_transaction *tsx,  
     
    104141/** 
    105142 * Init transaction as UAS. 
    106  * @param tsx the transaction to be initialized. 
    107  * @param rdata the received incoming request. 
     143 * 
     144 * @param tsx       The transaction to be initialized. 
     145 * @param rdata     The received incoming request. 
     146 * 
    108147 * @return PJ_SUCCESS if successfull. 
    109148 */ 
     
    113152/** 
    114153 * Process incoming message for this transaction. 
    115  * @param tsx the transaction. 
    116  * @param rdata the incoming message. 
     154 * 
     155 * @param tsx       The transaction. 
     156 * @param rdata     The incoming message. 
    117157 */ 
    118158PJ_DECL(void) pjsip_tsx_on_rx_msg( pjsip_transaction *tsx, 
     
    121161/** 
    122162 * Transmit message with this transaction. 
    123  * @param tsx the transaction. 
    124  * @param tdata the outgoing message. 
     163 * 
     164 * @param tsx       The transaction. 
     165 * @param tdata     The outgoing message. 
    125166 */ 
    126167PJ_DECL(void) pjsip_tsx_on_tx_msg( pjsip_transaction *tsx, 
     
    135176 * transaction will comply with RFC-3261, i.e. it will set itself to  
    136177 * TERMINATED state when it receives 2xx/INVITE. 
    137  * @param tsx The transaction. 
    138  * @param tdata The ACK request. 
     178 * 
     179 * @param tsx       The transaction. 
     180 * @param tdata     The ACK request. 
    139181 */ 
    140182PJ_DECL(void) pjsip_tsx_on_tx_ack( pjsip_transaction *tsx, 
     
    142184 
    143185/** 
    144  * Forcely terminate transaction. 
    145  * @param tsx the transaction. 
    146  * @param code the status code to report. 
     186 * Force terminate transaction. 
     187 * 
     188 * @param tsx       The transaction. 
     189 * @param code      The status code to report. 
    147190 */ 
    148191PJ_DECL(void) pjsip_tsx_terminate( pjsip_transaction *tsx, 
     
    152195 * Create transaction key, which is used to match incoming requests  
    153196 * or response (retransmissions) against transactions. 
    154  * @param pool The pool 
    155  * @param key Output key. 
    156  * @param role The role of the transaction. 
    157  * @param method The method to be put as a key.  
    158  * @param rdata The received data to calculate. 
    159  */ 
    160 PJ_DECL(void) pjsip_tsx_create_key( pj_pool_t *pool, 
    161                                     pj_str_t *key, 
    162                                     pjsip_role_e role, 
    163                                     const pjsip_method *method, 
    164                                     const pjsip_rx_data *rdata ); 
     197 * 
     198 * @param pool      The pool 
     199 * @param key       Output key. 
     200 * @param role      The role of the transaction. 
     201 * @param method    The method to be put as a key.  
     202 * @param rdata     The received data to calculate. 
     203 * 
     204 * @return          PJ_SUCCESS or the appropriate error code. 
     205 */ 
     206PJ_DECL(pj_status_t) pjsip_tsx_create_key( pj_pool_t *pool, 
     207                                           pj_str_t *key, 
     208                                           pjsip_role_e role, 
     209                                           const pjsip_method *method, 
     210                                           const pjsip_rx_data *rdata ); 
     211 
    165212 
    166213/** 
     
    184231 
    185232/* Thread Local Storage ID for transaction lock (initialized by endpoint) */ 
    186 extern int pjsip_tsx_lock_tls_id; 
     233extern long pjsip_tsx_lock_tls_id; 
    187234 
    188235PJ_END_DECL 
Note: See TracChangeset for help on using the changeset viewer.