From 2097922746d12d332ce923193af9c624429b7f96 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 3 Nov 2023 08:41:08 +0100 Subject: [PATCH] tm: exposed t_reply_error() to intermodule API --- src/modules/tm/t_reply.h | 2 ++ src/modules/tm/tm.c | 2 +- src/modules/tm/tm_load.c | 1 + src/modules/tm/tm_load.h | 7 ++++--- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/modules/tm/t_reply.h b/src/modules/tm/t_reply.h index 38fe67f5cd5..709b70454ed 100644 --- a/src/modules/tm/t_reply.h +++ b/src/modules/tm/t_reply.h @@ -178,6 +178,8 @@ int t_reply_str(struct cell *t, struct sip_msg *, unsigned int, str *); int t_reply_unsafe(struct cell *t, struct sip_msg *, unsigned int, char *); int t_reply_str_unsafe(struct cell *t, struct sip_msg *, unsigned int, str *); +int ki_t_reply_error(sip_msg_t *msg); + enum rps relay_reply(struct cell *t, struct sip_msg *p_msg, int branch, unsigned int msg_status, struct cancel_info *cancel_data, diff --git a/src/modules/tm/tm.c b/src/modules/tm/tm.c index bf30639a248..ec83abedaae 100644 --- a/src/modules/tm/tm.c +++ b/src/modules/tm/tm.c @@ -1596,7 +1596,7 @@ int w_t_reply_wrp(struct sip_msg *msg, unsigned int code, char *txt) /** * kemi function to send reply based on internal error code */ -static int ki_t_reply_error(sip_msg_t *msg) +int ki_t_reply_error(sip_msg_t *msg) { char err_buffer[128]; str reason; diff --git a/src/modules/tm/tm_load.c b/src/modules/tm/tm_load.c index dced3edbeef..7149873515e 100644 --- a/src/modules/tm/tm_load.c +++ b/src/modules/tm/tm_load.c @@ -143,6 +143,7 @@ int load_tm(struct tm_binds *tmb) tmb->set_fr = t_set_fr; tmb->t_release_transaction = t_release_transaction; tmb->t_uas_request_clean_parsed = t_uas_request_clean_parsed; + tmb->t_reply_error = ki_t_reply_error; return 1; } diff --git a/src/modules/tm/tm_load.h b/src/modules/tm/tm_load.h index f13c04cde6f..bf41eb789ef 100644 --- a/src/modules/tm/tm_load.h +++ b/src/modules/tm/tm_load.h @@ -43,6 +43,9 @@ /* export not usable from scripts */ #define NO_SCRIPT -1 +typedef void (*t_on_route_f)(unsigned int); +typedef int (*t_no_param_f)(struct sip_msg *); + struct tm_binds { register_tmcb_f register_tmcb; @@ -127,6 +130,7 @@ struct tm_binds tset_fr_f set_fr; trelease_t t_release_transaction; t_uas_request_clean_parsed_f t_uas_request_clean_parsed; + t_no_param_f t_reply_error; }; typedef struct tm_binds tm_api_t; @@ -165,9 +169,6 @@ static inline int tm_load_api(tm_api_t *tmb) * eXtra API - not common used in other modules */ -typedef void (*t_on_route_f)(unsigned int); -typedef int (*t_no_param_f)(struct sip_msg *); - int t_check_trans(struct sip_msg *msg); int t_is_canceled(struct sip_msg *msg);