1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
$FreeBSD$
--- modules/registrar/reg_mod.c.orig
+++ modules/registrar/reg_mod.c
@@ -70,6 +70,7 @@
int use_domain = 0;
char* realm_pref = ""; /* Realm prefix to be removed */
str realm_prefix;
+int use_tm = 0;
#define RCV_NAME "received"
#define RCV_NAME_LEN (sizeof(RCV_NAME) - 1)
@@ -84,6 +85,9 @@
int (*sl_reply)(struct sip_msg* _m, char* _s1, char* _s2);
+struct tm_binds tmb;
+
+
/*
* Exported functions
*/
@@ -115,6 +119,7 @@
{"use_domain", INT_PARAM, &use_domain },
{"max_contacts", INT_PARAM, &max_contacts },
{"retry_after", INT_PARAM, &retry_after },
+ {"use_tm", INT_PARAM, &use_tm },
{0, 0, 0}
};
@@ -140,17 +145,26 @@
static int mod_init(void)
{
bind_usrloc_t bind_usrloc;
+ load_tm_f load_tm;
DBG("registrar - initializing\n");
- /*
- * We will need sl_send_reply from stateless
- * module for sending replies
- */
- sl_reply = find_export("sl_send_reply", 2, 0);
- if (!sl_reply) {
- LOG(L_ERR, "registrar: This module requires sl module\n");
- return -1;
+ if (use_tm != 0) {
+ load_tm = (load_tm_f)find_export("load_tm", NO_SCRIPT, 0);
+ if (load_tm == NULL || load_tm(&tmb) == -1) {
+ LOG(L_ERR, "Can't import tm\n");
+ return -1;
+ }
+ } else {
+ /*
+ * We will need sl_send_reply from stateless
+ * module for sending replies
+ */
+ sl_reply = find_export("sl_send_reply", 2, 0);
+ if (!sl_reply) {
+ LOG(L_ERR, "registrar: This module requires sl module\n");
+ return -1;
+ }
}
realm_prefix.s = realm_pref;
|