From 89725b879f66d567431a9069cc6012be00c1788a Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 24 Apr 2012 13:09:14 +0000 Subject: Re #1474: merged r4054-r4079 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4082 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-simple/evsub.c | 18 ++++++------------ pjsip/src/pjsip-ua/sip_inv.c | 2 +- pjsip/src/pjsua-lib/pjsua_call.c | 6 ++---- 3 files changed, 9 insertions(+), 17 deletions(-) (limited to 'pjsip/src') diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c index d61fe71d..372c5151 100644 --- a/pjsip/src/pjsip-simple/evsub.c +++ b/pjsip/src/pjsip-simple/evsub.c @@ -1818,7 +1818,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) @@ -1898,19 +1897,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); diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 17c38473..41e3291f 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -2242,7 +2242,7 @@ PJ_DEF(pj_status_t) pjsip_inv_end_session( pjsip_inv_session *inv, return PJSIP_ESESSIONTERMINATED; default: - pj_assert("!Invalid operation!"); + pj_assert(!"Invalid operation!"); pj_log_pop_indent(); return PJ_EINVALIDOP; } diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 6dc49fdf..e3786369 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -1269,10 +1269,8 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) &pjsua_var.acc[acc_id].cfg.timer_setting); if (status != PJ_SUCCESS) { pjsua_perror(THIS_FILE, "Session Timer init failed", status); - status = pjsip_inv_end_session(inv, PJSIP_SC_INTERNAL_SERVER_ERROR, - NULL, &response); - if (status == PJ_SUCCESS && response) - status = pjsip_inv_send_msg(inv, response); + pjsip_dlg_respond(dlg, rdata, PJSIP_SC_INTERNAL_SERVER_ERROR, NULL, NULL, NULL); + pjsip_inv_terminate(inv, PJSIP_SC_INTERNAL_SERVER_ERROR, PJ_FALSE); pjsua_media_channel_deinit(call->index); -- cgit v1.2.3