diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-02-13 02:52:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-02-13 02:52:37 +0000 |
commit | 9451220daa74b4cd87e0567e33bb29464c8825df (patch) | |
tree | c97eee5a52cf59793d7aa98fab19873d92a82cc3 /pjsip/include | |
parent | 4e08dac382d28c026ea22e8c1b073bee59bab737 (diff) |
Implement ticket #99: a more generic mechanism to implement UAC transaction timeout after provisional response is received
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@942 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsip/sip_transaction.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h index 0b5eee10..5148ca06 100644 --- a/pjsip/include/pjsip/sip_transaction.h +++ b/pjsip/include/pjsip/sip_transaction.h @@ -74,6 +74,21 @@ typedef enum pjsip_tsx_state_e /** + * Transaction timeout timer policy, to control the UAC transaction timeout + * scheduling (see #pjsip_tsx_set_uac_timeout()). + */ +typedef enum pjsip_tsx_timeout_policy +{ + PJSIP_TSX_IGNORE_100 = 1, /**< To make the UAC transaction NOT to cancel + the timeout timer when 100 response is + received.*/ + PJSIP_TSX_IGNORE_1xx = 3 /**< To make the UAC transaction NOT to cancel + the timeout timer when any 1xx responses + are received. */ +} pjsip_tsx_timeout_policy; + + +/** * This structure describes SIP transaction object. The transaction object * is used to handle both UAS and UAC transaction. */ @@ -130,6 +145,9 @@ struct pjsip_transaction pj_timer_entry retransmit_timer;/**< Retransmit timer. */ pj_timer_entry timeout_timer; /**< Timeout timer. */ + unsigned msec_timeout; /**< User set timeout. */ + pjsip_tsx_timeout_policy timeout_policy; /**< Timeout policy. */ + /** Module specific data. */ void *mod_data[PJSIP_MAX_MODULE]; }; @@ -232,6 +250,46 @@ PJ_DECL(pj_status_t) pjsip_tsx_set_transport(pjsip_transaction *tsx, /** + * Set the UAC absolute transaction timeout. Normally UAC transaction will + * stop its timeout timer (timer B for INVITE and timer F for non-INVITE + * transactions) after a provisional response is received. + * + * When this timer is set, the transaction's timer B and F will use this + * value, and if the \a flag flag is set, the transaction will continue + * the scheduling of the timeout timer even when provisional response has + * been received. + * + * Note that this function MUST be called AFTER the transaction has been + * created AND BEFORE any request is transmitted. + * + * @param tsx The client/UAC transaction. + * @param msec_time The timeout value, in miliseconds. Currently this + * value must be non-zero (value zero is reserved for + * future use). + * @param flag Option flags to control whether the transaction should + * cancel the timeout timer on arrival of provisional + * responses (which is yes according to RFC 3261). + * The valid values are: + * - PJSIP_TSX_IGNORE_100, to make the UAC transaction + * NOT to cancel the timeout timer when 100 response + * is received. + * - PJSIP_TSX_IGNORE_1xx, to make the UAC transaction + * NOT to cancel the timeout timer when any 1xx + * responses are received. + * + * Note that regardless of the values in the \a flag + * argument, the provisional response would still be + * delivered to transaction user and it will still + * affect the transaction state. The \a flag flag only + * changes the behavior of the timeout timer of the + * transaction. + */ +PJ_DECL(pj_status_t) pjsip_tsx_set_uac_timeout(pjsip_transaction *tsx, + unsigned msec_time, + pjsip_tsx_timeout_policy flag); + + +/** * Call this function to manually feed a message to the transaction. * For UAS transaction, application MUST call this function after * UAS transaction has been created. |