[sr-dev] git:5.0:93434c4b: siptrace: wrapper for sip_trace() variants to pass properly the params

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

[sr-dev] git:5.0:93434c4b: siptrace: wrapper for sip_trace() variants to pass properly the params

Daniel-Constantin Mierla
Module: kamailio
Branch: 5.0
Commit: 93434c4b90d4df2b24c74e4b0e10c7f7ba305dcc
URL: https://github.com/kamailio/kamailio/commit/93434c4b90d4df2b24c74e4b0e10c7f7ba305dcc

Author: Daniel-Constantin Mierla <[hidden email]>
Committer: Daniel-Constantin Mierla <[hidden email]>
Date: 2017-12-04T08:46:59+01:00

siptrace: wrapper for sip_trace() variants to pass properly the params

- reported by GH #1351

---

Modified: src/modules/siptrace/siptrace.c

---

Diff:  https://github.com/kamailio/kamailio/commit/93434c4b90d4df2b24c74e4b0e10c7f7ba305dcc.diff
Patch: https://github.com/kamailio/kamailio/commit/93434c4b90d4df2b24c74e4b0e10c7f7ba305dcc.patch

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index e40835652d..850cd36ae9 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -92,6 +92,8 @@ static int siptrace_init_rpc(void);
 static int child_init(int rank);
 static void destroy(void);
 static int sip_trace(struct sip_msg*, struct dest_info*, str *correlation_id_str, char*);
+static int sip_trace0(struct sip_msg *, char *p1, char *p2);
+static int sip_trace1(struct sip_msg *, char *dest, char *p2);
 static int sip_trace2(struct sip_msg *, char *dest, char *correlation_id);
 static int fixup_siptrace(void ** param, int param_no);
 
@@ -181,8 +183,8 @@ db_func_t db_funcs;       /*!< Database functions */
  * Exported functions
  */
 static cmd_export_t cmds[] = {
- {"sip_trace", (cmd_function)sip_trace, 0, 0, 0, ANY_ROUTE},
- {"sip_trace", (cmd_function)sip_trace, 1, fixup_siptrace, 0, ANY_ROUTE},
+ {"sip_trace", (cmd_function)sip_trace0, 0, 0, 0, ANY_ROUTE},
+ {"sip_trace", (cmd_function)sip_trace1, 1, fixup_siptrace, 0, ANY_ROUTE},
  {"sip_trace", (cmd_function)sip_trace2, 2, fixup_spve_spve, 0, ANY_ROUTE},
  {0, 0, 0, 0, 0, 0}
 };
@@ -970,6 +972,17 @@ static int fixup_siptrace(void** param, int param_no) {
  return 0;
 }
 
+static int sip_trace0(struct sip_msg *msg, char *p1, char *p2)
+{
+ return sip_trace(msg, NULL, NULL, NULL);
+
+}
+
+static int sip_trace1(struct sip_msg *msg, char *dest, char *p2)
+{
+ return sip_trace(msg, (struct dest_info *)dest, NULL, NULL);
+}
+
 static int sip_trace2(struct sip_msg *msg, char *dest, char *correlation_id)
 {
  struct dest_info *dst = NULL;


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