Ignore:
Timestamp:
Feb 22, 2008 11:10:17 AM (14 years ago)
Author:
bennylp
Message:

Ticket #7: Move PJSIP compile time configurations/settings (such as T1, T2 timers) to run-time (thanks Philippe Leuba)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r1748 r1818  
    5151 
    5252/** 
    53  * @defgroup PJSIP_CONFIG Compile Time Configuration 
     53 * @defgroup PJSIP_CONFIG PJSIP Configurations/Settings 
    5454 * @ingroup PJSIP_BASE 
    5555 * @brief PJSIP compile time configurations. 
     
    6363#   include <pjsip/sip_autoconf.h> 
    6464#endif 
     65 
     66 
     67/** 
     68 * This structure describes PJSIP run-time configurations/settings. 
     69 * Application may use #pjsip_cfg() function to modify the settings 
     70 * before creating the stack. 
     71 */ 
     72typedef struct pjsip_cfg_t 
     73{ 
     74    /** Transaction layer settings. */ 
     75    struct { 
     76 
     77        /** Maximum number of transactions. The value is initialized with 
     78         *  PJSIP_MAX_TSX_COUNT 
     79         */ 
     80        unsigned max_count; 
     81 
     82        /* Timeout values: */ 
     83 
     84        /** Transaction T1 timeout, in msec. Default value is PJSIP_T1_TIMEOUT 
     85         */ 
     86        unsigned t1; 
     87 
     88        /** Transaction T2 timeout, in msec. Default value is PJSIP_T2_TIMEOUT 
     89         */ 
     90        unsigned t2; 
     91 
     92        /** Transaction completed timer for non-INVITE, in msec. Default value 
     93         *  is PJSIP_T4_TIMEOUT 
     94         */ 
     95        unsigned t4; 
     96 
     97        /** Transaction completed timer for INVITE, in msec. Default value is 
     98         *  PJSIP_TD_TIMEOUT. 
     99         */ 
     100        unsigned td; 
     101 
     102    } tsx; 
     103 
     104    /* Dialog layer settings .. TODO */ 
     105 
     106} pjsip_cfg_t; 
     107 
     108 
     109#ifdef PJ_DLL 
     110/** 
     111 * Get pjsip configuration instance. Application may modify the 
     112 * settings before creating the SIP endpoint and modules. 
     113 * 
     114 * @return  Configuration instance. 
     115 */ 
     116PJ_DECL(pjsip_cfg_t*) pjsip_cfg(void); 
     117 
     118#else   /* PJ_DLL */ 
     119 
     120PJ_DECL_DATA(pjsip_cfg_t) pjsip_sip_cfg_var; 
     121 
     122/** 
     123 * Get pjsip configuration instance. Application may modify the 
     124 * settings before creating the SIP endpoint and modules. 
     125 * 
     126 * @return  Configuration instance. 
     127 */ 
     128PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) 
     129{ 
     130    return &pjsip_sip_cfg_var; 
     131} 
     132 
     133#endif  /* PJ_DLL */ 
    65134 
    66135 
     
    408477 
    409478/* Endpoint. */ 
    410 #define PJSIP_MAX_TIMER_COUNT           (2*PJSIP_MAX_TSX_COUNT + 2*PJSIP_MAX_DIALOG_COUNT) 
     479#define PJSIP_MAX_TIMER_COUNT           (2*pjsip_cfg()->tsx.max_count + \ 
     480                                         2*PJSIP_MAX_DIALOG_COUNT) 
    411481 
    412482/** 
     
    633703 */ 
    634704 
     705 
    635706#include <pj/config.h> 
    636707 
Note: See TracChangeset for help on using the changeset viewer.