From 452c9967286f1b91c32798ce0cb634971eb675d1 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 2 Nov 2021 11:22:10 +0100 Subject: [PATCH] TT#144053 tsilo: fix build warnings > CC (gcc) [M tsilo.so] tsilo.o > tsilo.c: In function 'ki_ts_append_by_contact': > tsilo.c:515:51: warning: passing argument 4 of 'ts_append_by_contact' from incompatible pointer type [-Wincompatible-pointer-types] > 515 | rc = ts_append_by_contact(_msg, &ruri, &contact, _table); > | ^~~~~~ > | | > | str * {aka struct _str *} > In file included from tsilo.c:41: > ts_append.h:27:78: note: expected 'char *' but argument is of type 'str *' {aka 'struct _str *'} > 27 | int ts_append_by_contact(struct sip_msg* msg, str *ruri, str *contact, char *table); > | ~~~~~~^~~~~ > tsilo.c: In function 'ki_ts_append_by_contact_uri': > tsilo.c:609:51: warning: passing argument 4 of 'ts_append_by_contact' from incompatible pointer type [-Wincompatible-pointer-types] > 609 | rc = ts_append_by_contact(_msg, &ruri, &contact, _table); > | ^~~~~~ > | | > | str * {aka struct _str *} > In file included from tsilo.c:41: > ts_append.h:27:78: note: expected 'char *' but argument is of type 'str *' {aka 'struct _str *'} > 27 | int ts_append_by_contact(struct sip_msg* msg, str *ruri, str *contact, char *table); > | ~~~~~~^~~~~ > LD (gcc) [M tsilo.so] tsilo.so Change-Id: I9a9bb7959ba691de0a696839c63168384de97e22 --- .../tsilo_add_ts_append_by_contact.patch | 46 +++++++++++++------ 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/debian/patches/sipwise/tsilo_add_ts_append_by_contact.patch b/debian/patches/sipwise/tsilo_add_ts_append_by_contact.patch index e315c9001..459af9525 100644 --- a/debian/patches/sipwise/tsilo_add_ts_append_by_contact.patch +++ b/debian/patches/sipwise/tsilo_add_ts_append_by_contact.patch @@ -1,3 +1,15 @@ +From: Sipwise Development Team +Date: Tue, 2 Nov 2021 11:14:23 +0100 +Subject: tsilo_add_ts_append_by_contact + +--- + src/modules/tsilo/ts_append.c | 116 ++++++++++++++++++ + src/modules/tsilo/ts_append.h | 2 + + src/modules/tsilo/tsilo.c | 269 +++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 386 insertions(+), 1 deletion(-) + +diff --git a/src/modules/tsilo/ts_append.c b/src/modules/tsilo/ts_append.c +index 7d95186..1847ac1 100644 --- a/src/modules/tsilo/ts_append.c +++ b/src/modules/tsilo/ts_append.c @@ -139,3 +139,119 @@ done: @@ -120,6 +132,8 @@ + + return ret; +} +diff --git a/src/modules/tsilo/ts_append.h b/src/modules/tsilo/ts_append.h +index 56f9120..461f888 100644 --- a/src/modules/tsilo/ts_append.h +++ b/src/modules/tsilo/ts_append.h @@ -24,5 +24,7 @@ @@ -130,6 +144,8 @@ +int ts_append_by_contact_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *uri, str *contact); #endif +diff --git a/src/modules/tsilo/tsilo.c b/src/modules/tsilo/tsilo.c +index 0c531ac..2eefb2f 100644 --- a/src/modules/tsilo/tsilo.c +++ b/src/modules/tsilo/tsilo.c @@ -34,6 +34,8 @@ @@ -141,7 +157,7 @@ #include "ts_hash.h" #include "ts_handlers.h" #include "ts_append.h" -@@ -61,7 +63,9 @@ static int w_ts_append_to2(struct sip_ms +@@ -61,7 +63,9 @@ static int w_ts_append_to2(struct sip_msg* msg, char *idx, char *lbl, char *d, c static int fixup_ts_append_to(void** param, int param_no); static int w_ts_append(struct sip_msg* _msg, char *_table, char *_ruri); static int fixup_ts_append(void** param, int param_no); @@ -163,7 +179,7 @@ {"ts_store", (cmd_function)w_ts_store, 0, 0 , 0, REQUEST_ROUTE | FAILURE_ROUTE }, {"ts_store", (cmd_function)w_ts_store1, 1, -@@ -241,6 +249,23 @@ static int fixup_ts_append(void** param, +@@ -241,6 +249,23 @@ static int fixup_ts_append(void** param, int param_no) return 0; } @@ -187,10 +203,13 @@ /** * */ -@@ -360,6 +385,238 @@ static int ki_ts_append_to_uri(sip_msg_t - /** - * - */ +@@ -357,6 +382,238 @@ static int ki_ts_append_to_uri(sip_msg_t* _msg, int tindex, int tlabel, + _table->s, _uri); + } + ++/** ++ * ++ */ +static int w_ts_append_by_contact2(struct sip_msg* _msg, char *_table, char *_ruri) { + str ruri = STR_NULL; + str ruri_fixed = STR_NULL; @@ -318,7 +337,7 @@ + } + + /* contact must be of syntax: sip:@: with no parameters list */ -+ rc = ts_append_by_contact(_msg, &ruri, &contact, _table); ++ rc = ts_append_by_contact(_msg, &ruri, &contact, _table->s); + + pkg_free(ruri.s); + pkg_free(contact.s); @@ -412,7 +431,7 @@ + return -1; + + /* contact must be of syntax: sip:@: with no parameters list */ -+ rc = ts_append_by_contact(_msg, &ruri, &contact, _table); ++ rc = ts_append_by_contact(_msg, &ruri, &contact, _table->s); + + pkg_free(ruri.s); + pkg_free(contact.s); @@ -420,13 +439,10 @@ + return rc; +} + -+/** -+ * -+ */ - static int w_ts_store(struct sip_msg* msg, char *p1, char *p2) - { - return ts_store(msg, 0); -@@ -417,6 +674,16 @@ static sr_kemi_t sr_kemi_tsilo_exports[] + /** + * + */ +@@ -417,6 +674,16 @@ static sr_kemi_t sr_kemi_tsilo_exports[] = { { SR_KEMIP_INT, SR_KEMIP_INT, SR_KEMIP_STR, SR_KEMIP_STR, SR_KEMIP_NONE, SR_KEMIP_NONE } },