Module: kamailio
Branch: master
Commit: 2097922746d12d332ce923193af9c624429b7f96
URL:
https://github.com/kamailio/kamailio/commit/2097922746d12d332ce923193af9c62…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-11-03T08:41:08+01:00
tm: exposed t_reply_error() to intermodule API
---
Modified: src/modules/tm/t_reply.h
Modified: src/modules/tm/tm.c
Modified: src/modules/tm/tm_load.c
Modified: src/modules/tm/tm_load.h
---
Diff:
https://github.com/kamailio/kamailio/commit/2097922746d12d332ce923193af9c62…
Patch:
https://github.com/kamailio/kamailio/commit/2097922746d12d332ce923193af9c62…
---
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);