summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2012-04-20 09:59:51 +0000
committerBenny Prijono <bennylp@teluu.com>2012-04-20 09:59:51 +0000
commit824407dfad66205a82037b8212549a5a45e87195 (patch)
tree7add70b3126acae030f84adc2612920a2a883ceb
parentb6df668ea5730d2f664646a8fd9bc1964f8e340f (diff)
Fixed #1491: Failed to refresh (presence) subscription if Subscription-State header contains no "expires" parameter
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4064 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip-simple/evsub.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c
index 6abc00df..c20657da 100644
--- a/pjsip/src/pjsip-simple/evsub.c
+++ b/pjsip/src/pjsip-simple/evsub.c
@@ -1804,7 +1804,6 @@ static void on_tsx_state_uac( pjsip_evsub *sub, pjsip_transaction *tsx,
pjsip_tx_data *tdata;
pj_status_t status;
- int next_refresh;
/* Only want to handle initial NOTIFY receive event. */
if (tsx->state != PJSIP_TSX_STATE_TRYING)
@@ -1884,19 +1883,14 @@ static void on_tsx_state_uac( pjsip_evsub *sub, pjsip_transaction *tsx,
(pj_stricmp(&sub_state->sub_state, &STR_ACTIVE)==0 ||
pj_stricmp(&sub_state->sub_state, &STR_PENDING)==0))
{
- next_refresh = sub_state->expires_param;
+ int next_refresh = sub_state->expires_param;
+ unsigned timeout;
- } else {
- next_refresh = sub->expires->ivalue;
- }
+ update_expires(sub, next_refresh);
- /* Update time */
- update_expires(sub, next_refresh);
-
- /* Start UAC refresh timer, only when we're not unsubscribing */
- if (sub->expires->ivalue != 0) {
- unsigned timeout = (next_refresh > TIME_UAC_REFRESH) ?
- next_refresh - TIME_UAC_REFRESH : next_refresh;
+ /* Start UAC refresh timer, only when we're not unsubscribing */
+ timeout = (next_refresh > TIME_UAC_REFRESH) ?
+ next_refresh - TIME_UAC_REFRESH : next_refresh;
PJ_LOG(5,(sub->obj_name, "Will refresh in %d seconds", timeout));
set_timer(sub, TIMER_TYPE_UAC_REFRESH, timeout);