diff options
-rw-r--r-- | pjsip/include/pjsip/sip_config.h | 55 | ||||
-rw-r--r-- | pjsip/src/pjsip-simple/evsub.c | 6 | ||||
-rw-r--r-- | pjsip/src/pjsip-simple/presence.c | 2 |
3 files changed, 59 insertions, 4 deletions
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h index a171a096..1704a1af 100644 --- a/pjsip/include/pjsip/sip_config.h +++ b/pjsip/include/pjsip/sip_config.h @@ -792,6 +792,61 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void) #endif +/***************************************************************************** + * SIP Event framework and presence settings. + */ + +/** + * Specify the time (in seconds) to send SUBSCRIBE to refresh client + * subscription before the actual interval expires. + * + * Default: 5 seconds + */ +#ifndef PJSIP_EVSUB_TIME_UAC_REFRESH +# define PJSIP_EVSUB_TIME_UAC_REFRESH 5 +#endif + + +/** + * Specify the time (in seconds) to wait for the final NOTIFY from the + * server after client has sent un-SUBSCRIBE request. + * + * Default: 5 seconds + */ +#ifndef PJSIP_EVSUB_TIME_UAC_TERMINATE +# define PJSIP_EVSUB_TIME_UAC_TERMINATE 5 +#endif + + +/** + * Specify the time (in seconds) for client subscription to wait for another + * NOTIFY from the server, if it has rejected the last NOTIFY with non-2xx + * final response (such as 401). If further NOTIFY is not received within + * this period, the client will unsubscribe. + * + * Default: 5 seconds + */ +#ifndef PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY +# define PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY 5 +#endif + + +/** + * Specify the default expiration time for presence event subscription, for + * both client and server subscription. For client subscription, application + * can override this by specifying positive non-zero value in "expires" + * parameter when calling #pjsip_pres_initiate(). For server subscription, + * we would take the expiration value from the Expires header sent by client + * in the SUBSCRIBE request if the header exists and its value is less than + * this setting, otherwise this setting will be used. + * + * Default: 600 seconds (10 minutes) + */ +#ifndef PJSIP_PRES_DEFAULT_EXPIRES +# define PJSIP_PRES_DEFAULT_EXPIRES 600 +#endif + + PJ_END_DECL /** diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c index e820ce0f..d4dc8b4b 100644 --- a/pjsip/src/pjsip-simple/evsub.c +++ b/pjsip/src/pjsip-simple/evsub.c @@ -105,16 +105,16 @@ static pj_str_t evsub_state_names[] = */ /* Number of seconds to send SUBSCRIBE before the actual expiration */ -#define TIME_UAC_REFRESH 5 +#define TIME_UAC_REFRESH PJSIP_EVSUB_TIME_UAC_REFRESH /* Time to wait for the final NOTIFY after sending unsubscription */ -#define TIME_UAC_TERMINATE 5 +#define TIME_UAC_TERMINATE PJSIP_EVSUB_TIME_UAC_TERMINATE /* If client responds NOTIFY with non-2xx final response (such as 401), * wait for this seconds for further NOTIFY, otherwise client will * unsubscribe */ -#define TIME_UAC_WAIT_NOTIFY 5 +#define TIME_UAC_WAIT_NOTIFY PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY /* diff --git a/pjsip/src/pjsip-simple/presence.c b/pjsip/src/pjsip-simple/presence.c index f7b20df6..31c83fc1 100644 --- a/pjsip/src/pjsip-simple/presence.c +++ b/pjsip/src/pjsip-simple/presence.c @@ -32,7 +32,7 @@ #define THIS_FILE "presence.c" -#define PRES_DEFAULT_EXPIRES 600 +#define PRES_DEFAULT_EXPIRES PJSIP_PRES_DEFAULT_EXPIRES /* * Presence module (mod-presence) |