Fixed ticket #302: Behavior in cancelling INVITE session when no provisional response has been received (thanks Esbjörn Dominique)

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1319 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/include/pjsip-ua/sip_inv.h b/pjsip/include/pjsip-ua/sip_inv.h
index 7ea1f27..3a144f8 100644
--- a/pjsip/include/pjsip-ua/sip_inv.h
+++ b/pjsip/include/pjsip-ua/sip_inv.h
@@ -223,7 +223,8 @@
     char		 obj_name[PJ_MAX_OBJ_NAME]; /**< Log identification */
     pj_pool_t		*pool;			    /**< Dialog's pool.	    */
     pjsip_inv_state	 state;			    /**< Invite sess state. */
-    pj_bool_t		 cancelling;		    /**< CANCEL sent?	    */
+    pj_bool_t		 cancelling;		    /**< CANCEL requested   */
+    pj_bool_t		 pending_cancel;	    /**< Wait to send CANCEL*/
     pjsip_status_code	 cause;			    /**< Disconnect cause.  */
     pj_str_t		 cause_text;		    /**< Cause text.	    */
     pj_bool_t		 notify;		    /**< Internal.	    */
diff --git a/pjsip/include/pjsip/sip_transaction.h b/pjsip/include/pjsip/sip_transaction.h
index 1787f78..657e82a 100644
--- a/pjsip/include/pjsip/sip_transaction.h
+++ b/pjsip/include/pjsip/sip_transaction.h
@@ -297,6 +297,18 @@
 
 
 /**
+ * Cease retransmission on the UAC transaction. The UAC transaction is
+ * still considered running, and it will complete when either final
+ * response is received or the transaction times out.
+ *
+ * This operation normally is used for INVITE transaction only, when
+ * the transaction is cancelled before any provisional response has been
+ * received.
+ */
+PJ_DECL(pj_status_t) pjsip_tsx_stop_retransmit(pjsip_transaction *tsx);
+
+
+/**
  * Get the transaction instance in the incoming message. If the message
  * has a corresponding transaction, this function will return non NULL
  * value.