git:master:42764f90: tm: split wrappers for t set flags cfg functions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

git:master:42764f90: tm: split wrappers for t set flags cfg functions

Daniel-Constantin Mierla-6
Module: kamailio
Branch: master
Commit: 42764f908c4bd8d2eedf0b940c3289cacd12362b
URL: https://github.com/kamailio/kamailio/commit/42764f908c4bd8d2eedf0b940c3289cacd12362b

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
Date: 2017-06-09T08:21:50+02:00

tm: split wrappers for t set flags cfg functions

---

Modified: src/modules/tm/tm.c

---

Diff:  https://github.com/kamailio/kamailio/commit/42764f908c4bd8d2eedf0b940c3289cacd12362b.diff
Patch: https://github.com/kamailio/kamailio/commit/42764f908c4bd8d2eedf0b940c3289cacd12362b.patch

---

diff --git a/src/modules/tm/tm.c b/src/modules/tm/tm.c
index 1fc7f62890..6543db5ccd 100644
--- a/src/modules/tm/tm.c
+++ b/src/modules/tm/tm.c
@@ -1812,15 +1812,13 @@ int ki_t_reset_max_lifetime(sip_msg_t* msg)
  * static int t_set_foo(struct sip_msg* msg, char*, char* )
  * that will expect fparam as first param and will set or reset T_FOO
  * in the current or next to be created transaction. */
-#define W_T_SET_FLAG_GEN_FUNC(fname, T_FLAG_NAME) \
- static int fname(struct sip_msg* msg, char* p1, char* p2) \
+#define T_SET_FLAG_GEN_FUNC(fname, T_FLAG_NAME) \
+ static int fname(sip_msg_t* msg, int state) \
 { \
- int state; \
  struct cell* t; \
  unsigned int set_flags; \
  unsigned int reset_flags; \
  \
- if (get_int_fparam(&state, msg, (fparam_t*)p1) < 0) return -1; \
  t=get_t(); \
  /* in REPLY_ROUTE and FAILURE_ROUTE T will be set to current transaction; \
  * in REQUEST_ROUTE T will be set only if the transaction was already  \
@@ -1848,28 +1846,45 @@ int ki_t_reset_max_lifetime(sip_msg_t* msg)
  return 1; \
 }
 
+#define W_T_SET_FLAG_GEN_FUNC(fname, T_FLAG_NAME) \
+ static int w_##fname(sip_msg_t* msg, char* p1, char* p2) \
+{ \
+ int state; \
+ if (get_int_fparam(&state, msg, (fparam_t*)p1) < 0) return -1; \
+ return fname(msg, state); \
+}
 
 /* set automatically sending 100 replies on/off for the current or
  * next to be created transaction */
-W_T_SET_FLAG_GEN_FUNC(w_t_set_auto_inv_100, T_AUTO_INV_100)
+T_SET_FLAG_GEN_FUNC(t_set_auto_inv_100, T_AUTO_INV_100)
+
+W_T_SET_FLAG_GEN_FUNC(t_set_auto_inv_100, T_AUTO_INV_100)
 
 
 /* set 6xx handling for the current or next to be created transaction */
-W_T_SET_FLAG_GEN_FUNC(w_t_set_disable_6xx, T_DISABLE_6xx)
+T_SET_FLAG_GEN_FUNC(t_set_disable_6xx, T_DISABLE_6xx)
+
+W_T_SET_FLAG_GEN_FUNC(t_set_disable_6xx, T_DISABLE_6xx)
 
 
 /* disable dns failover for the current transaction */
-W_T_SET_FLAG_GEN_FUNC(w_t_set_disable_failover, T_DISABLE_FAILOVER)
+T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER)
+
+W_T_SET_FLAG_GEN_FUNC(t_set_disable_failover, T_DISABLE_FAILOVER)
 
 
 #ifdef CANCEL_REASON_SUPPORT
 /* disable/enable e2e cancel reason copy for the current transaction */
-W_T_SET_FLAG_GEN_FUNC(w_t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON)
+T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON)
+
+W_T_SET_FLAG_GEN_FUNC(t_set_no_e2e_cancel_reason, T_NO_E2E_CANCEL_REASON)
 #endif /* CANCEL_REASON_SUPPORT */
 
 
 /* disable internal negative reply for the current transaction */
-W_T_SET_FLAG_GEN_FUNC(w_t_set_disable_internal_reply, T_DISABLE_INTERNAL_REPLY)
+T_SET_FLAG_GEN_FUNC(t_set_disable_internal_reply, T_DISABLE_INTERNAL_REPLY)
+
+W_T_SET_FLAG_GEN_FUNC(t_set_disable_internal_reply, T_DISABLE_INTERNAL_REPLY)
 
 
 /* FAILURE_ROUTE and BRANCH_FAILURE_ROUTE only,


_______________________________________________
Kamailio (SER) - Development Mailing List
[hidden email]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev