From b2aac52d83d6e4fb46e2bef723647fa2bb1ad8be Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Tue, 13 Oct 2009 14:01:59 +0000 Subject: Ticket #364: Upon unregistration, (un)REGISTER should be sent only after (un)PUBLISH has completed successfully - wait for unpublication to complete or some delay expires, before sending unregistration - added unpublish_max_wait_time_msec field in account config to control how long to wait git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2942 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_pres.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pjsip/src/pjsua-lib/pjsua_pres.c') diff --git a/pjsip/src/pjsua-lib/pjsua_pres.c b/pjsip/src/pjsua-lib/pjsua_pres.c index bef8af92..4515636c 100644 --- a/pjsip/src/pjsua-lib/pjsua_pres.c +++ b/pjsip/src/pjsua-lib/pjsua_pres.c @@ -992,7 +992,7 @@ static void publish_cb(struct pjsip_publishc_cbparam *param) } } else { - if (param->expiration == -1) { + if (param->expiration < 1) { /* Could happen if server "forgot" to include Expires header * in the response. We will not renew, so destroy the pubc. */ @@ -1201,10 +1201,13 @@ void pjsua_pres_delete_acc(int acc_id) if (acc->publish_sess) { acc->online_status = PJ_FALSE; send_publish(acc_id, PJ_FALSE); + /* By ticket #364, don't destroy the session yet (let the callback + destroy it) if (acc->publish_sess) { pjsip_publishc_destroy(acc->publish_sess); acc->publish_sess = NULL; } + */ acc_cfg->publish_enabled = PJ_FALSE; } } -- cgit v1.2.3