Index: /pjproject/branches/1.x/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- /pjproject/branches/1.x/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3829)
+++ /pjproject/branches/1.x/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3830)
@@ -5119,5 +5119,5 @@
     }
 
-    status = pjsua_destroy2(1);
+    status = pjsua_destroy();
 
     pj_bzero(&app_config, sizeof(app_config));
Index: /pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- /pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h	(revision 3829)
+++ /pjproject/branches/1.x/pjsip/include/pjsua-lib/pjsua.h	(revision 3830)
@@ -1300,7 +1300,24 @@
 {
     /**
-     * Do not invoke any networking functions.
-     */
-    PJSUA_DESTROY_NO_NETWORK = 1
+     * Allow sending outgoing messages (such as unregistration, event
+     * unpublication, BYEs, unsubscription, etc.), but do not wait for
+     * responses. This is useful to perform "best effort" clean up
+     * without delaying the shutdown process waiting for responses.
+     */
+    PJSUA_DESTROY_NO_RX_MSG = 1,
+
+    /**
+     * If this flag is set, do not send any outgoing messages at all.
+     * This flag is useful if application knows that the network which
+     * the messages are to be sent on is currently down.
+     */
+    PJSUA_DESTROY_NO_TX_MSG = 2,
+
+    /**
+     * Do not send or receive messages during destroy. This flag is
+     * shorthand for  PJSUA_DESTROY_NO_RX_MSG + PJSUA_DESTROY_NO_TX_MSG.
+     */
+    PJSUA_DESTROY_NO_NETWORK = PJSUA_DESTROY_NO_RX_MSG |
+			       PJSUA_DESTROY_NO_TX_MSG
 
 } pjsua_destroy_flag;
Index: /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3829)
+++ /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_core.c	(revision 3830)
@@ -1306,5 +1306,5 @@
 
 	/* Terminate all calls. */
-	if ((flags & PJSUA_DESTROY_NO_NETWORK) == 0) {
+	if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) {
 	    pjsua_call_hangup_all();
 	}
@@ -1336,6 +1336,6 @@
 	}
 	
-	/* No need to wait if we didn't send anything */
-	if (flags & PJSUA_DESTROY_NO_NETWORK) {
+	/* No waiting if RX is disabled */
+	if (flags & PJSUA_DESTROY_NO_RX_MSG) {
 	    max_wait = 0;
 	}
@@ -1370,5 +1370,5 @@
 		continue;
 
-	    if (pjsua_var.acc[i].regc && (flags & PJSUA_DESTROY_NO_NETWORK)==0)
+	    if (pjsua_var.acc[i].regc && (flags & PJSUA_DESTROY_NO_TX_MSG)==0)
 	    {
 		pjsua_acc_set_registration(i, PJ_FALSE);
@@ -1396,6 +1396,6 @@
 	}
 	
-	/* No need to wait if we didn't send anything */
-	if (flags & PJSUA_DESTROY_NO_NETWORK) {
+	/* No waiting if RX is disabled */
+	if (flags & PJSUA_DESTROY_NO_RX_MSG) {
 	    max_wait = 0;
 	}
@@ -1421,5 +1421,5 @@
 	 * transports shutdown to complete: 
 	 */
-	if (i < 20 && (flags & PJSUA_DESTROY_NO_NETWORK) == 0) {
+	if (i < 20 && (flags & PJSUA_DESTROY_NO_RX_MSG) == 0) {
 	    busy_sleep(1000 - i*50);
 	}
Index: /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_pres.c
===================================================================
--- /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 3829)
+++ /pjproject/branches/1.x/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 3830)
@@ -1285,5 +1285,5 @@
 	acc->online_status = PJ_FALSE;
 
-	if ((flags & PJSUA_DESTROY_NO_NETWORK) == 0) {
+	if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) {
 	    send_publish(acc->index, PJ_FALSE);
 	}
@@ -1323,5 +1323,5 @@
 	pjsip_pres_set_status(uapres->sub, &pres_status);
 
-	if ((flags & PJSUA_DESTROY_NO_NETWORK) == 0) {
+	if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) {
 	    if (pjsip_pres_notify(uapres->sub,
 				  PJSIP_EVSUB_STATE_TERMINATED, NULL,
@@ -2282,5 +2282,5 @@
     }
 
-    if ((flags & PJSUA_DESTROY_NO_NETWORK) == 0) {
+    if ((flags & PJSUA_DESTROY_NO_TX_MSG) == 0) {
 	refresh_client_subscriptions();
 
