Ticket #995: Send un-PUBLISH when pjsua_acc_set_registration(FALSE) is called (thanks Johan Lantz for the suggestion)
 - in this implementation, when pjsua_acc_set_registration(FALSE) is called, the un-REGISTER request will be sent immediately after un-PUBLISH, unlike the process during shutdown where the un-REGISTER request will be sent only after un-PUBLISH transaction is complete


git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@3096 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 965ead0..1809662 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -1264,6 +1264,9 @@
 	    status = PJ_EINVALIDOP;
 	    goto on_return;
 	}
+
+	pjsua_pres_unpublish(&pjsua_var.acc[acc_id]);
+
 	status = pjsip_regc_unregister(pjsua_var.acc[acc_id].regc, &tdata);
     }