|
@@ -39,6 +39,14 @@
|
|
#include "../../data_lump_rpl.h"
|
|
#include "../../data_lump_rpl.h"
|
|
|
|
|
|
|
|
|
|
|
|
+#ifdef ENABLE_ASYNC_MUTEX
|
|
|
|
+#define LOCK_ASYNC_CONTINUE(_t) lock(&(_t)->async_mutex )
|
|
|
|
+#define UNLOCK_ASYNC_CONTINUE(_t) unlock(&(_t)->async_mutex )
|
|
|
|
+#else
|
|
|
|
+#define LOCK_ASYNC_CONTINUE(_t) LOCK_REPLIES(_t)
|
|
|
|
+#define UNLOCK_ASYNC_CONTINUE(_t) UNLOCK_REPLIES(_t)
|
|
|
|
+#endif
|
|
|
|
+
|
|
/* Suspends the transaction for later use.
|
|
/* Suspends the transaction for later use.
|
|
* Save the returned hash_index and label to get
|
|
* Save the returned hash_index and label to get
|
|
* back to the SIP request processing, see the readme.
|
|
* back to the SIP request processing, see the readme.
|
|
@@ -179,7 +187,10 @@ int t_continue(unsigned int hash_index, unsigned int label,
|
|
|
|
|
|
/* The transaction has to be locked to protect it
|
|
/* The transaction has to be locked to protect it
|
|
* form calling t_continue() multiple times simultaneously */
|
|
* form calling t_continue() multiple times simultaneously */
|
|
- LOCK_REPLIES(t);
|
|
|
|
|
|
+ LOCK_ASYNC_CONTINUE(t);
|
|
|
|
+
|
|
|
|
+ t->flags |= T_ASYNC_CONTINUE; /* we can now know anywhere in kamailio
|
|
|
|
+ * that we are executing post a suspend */
|
|
|
|
|
|
/* which route block type were we in when we were suspended */
|
|
/* which route block type were we in when we were suspended */
|
|
cb_type = FAILURE_CB_TYPE;;
|
|
cb_type = FAILURE_CB_TYPE;;
|
|
@@ -208,7 +219,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
|
|
/* Either t_continue() has already been
|
|
/* Either t_continue() has already been
|
|
* called or the branch has already timed out.
|
|
* called or the branch has already timed out.
|
|
* Needless to continue. */
|
|
* Needless to continue. */
|
|
- UNLOCK_REPLIES(t);
|
|
|
|
|
|
+ UNLOCK_ASYNC_CONTINUE(t);
|
|
UNREF(t); /* t_unref would kill the transaction */
|
|
UNREF(t); /* t_unref would kill the transaction */
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
@@ -378,7 +389,7 @@ int t_continue(unsigned int hash_index, unsigned int label,
|
|
}
|
|
}
|
|
|
|
|
|
done:
|
|
done:
|
|
- UNLOCK_REPLIES(t);
|
|
|
|
|
|
+ UNLOCK_ASYNC_CONTINUE(t);
|
|
|
|
|
|
if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
|
|
if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
|
|
/* unref the transaction */
|
|
/* unref the transaction */
|
|
@@ -438,10 +449,10 @@ kill_trans:
|
|
"reply generation failed\n");
|
|
"reply generation failed\n");
|
|
/* The transaction must be explicitely released,
|
|
/* The transaction must be explicitely released,
|
|
* no more timer is running */
|
|
* no more timer is running */
|
|
- UNLOCK_REPLIES(t);
|
|
|
|
|
|
+ UNLOCK_ASYNC_CONTINUE(t);
|
|
t_release_transaction(t);
|
|
t_release_transaction(t);
|
|
} else {
|
|
} else {
|
|
- UNLOCK_REPLIES(t);
|
|
|
|
|
|
+ UNLOCK_ASYNC_CONTINUE(t);
|
|
}
|
|
}
|
|
|
|
|
|
if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
|
|
if(t->async_backup.backup_route != TM_ONREPLY_ROUTE){
|