Browse code

*** empty log message ***

Bogdan-Andrei Iancu authored on 23/09/2002 11:29:41
Showing 5 changed files
... ...
@@ -166,7 +166,7 @@ static int mod_init(void)
166 166
 
167 167
 	/* import the TM auto-loading function */
168 168
 	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT))) {
169
-		LOG(L_ERR, "ERROR: acc: mod_init: can't import load_tm\n");
169
+		LOG(L_ERR, "ERROR: jabber: mod_init: can't import load_tm\n");
170 170
 		return -1;
171 171
 	}
172 172
 	/* let the auto-loading function load all TM stuff */
... ...
@@ -391,7 +391,7 @@ int jab_send_sip_msg(str *to, str *from, str *contact, str *msg)
391 391
 	}
392 392
 	str_hdr.s = buf1;
393 393
 
394
-	return tmb.t_uac( &msg_type, to, &str_hdr , msg, &tfrom, 0 );
394
+	return tmb.t_uac( &msg_type, to, &str_hdr , msg, &tfrom, 0 , 0, 0);
395 395
 }
396 396
 
397 397
 /**
... ...
@@ -46,6 +46,7 @@
46 46
 #include "../../db/db.h"
47 47
 #include "../tm/t_funcs.h"
48 48
 #include "../tm/uac.h"
49
+#include "../tm/tm_load.h"
49 50
 
50 51
 #include "msfuncs.h"
51 52
 
... ...
@@ -96,9 +97,11 @@
96 97
 	}
97 98
 
98 99
 /** database connection */
99
-
100 100
 db_con_t *db_con = NULL;
101 101
 
102
+/** TM bind */
103
+struct tm_binds tmb;
104
+
102 105
 /** parameters */
103 106
 
104 107
 char *db_url="sql://root@127.0.0.1/msilo";
... ...
@@ -170,29 +173,26 @@ struct module_exports exports= {
170 173
  */
171 174
 static int mod_init(void)
172 175
 {
176
+	load_tm_f  load_tm;
177
+
173 178
 	DBG("MSILO: initializing ...\n");
174
-	
179
+
180
+	/* binding to mysql module  */
175 181
 	if (bind_dbmod())
176 182
 	{
177 183
 		DBG("MSILO: ERROR: Database module not found\n");
178 184
 		return -1;
179 185
 	}
180 186
 
181
-	/**
182
-	db_con = db_init(db_url);
183
-	if (!db_con)
184
-	{
185
-		DBG("MSILO: Error while connecting database\n");
186
-		return -3;
187
-	}
188
-	else
189
-	{
190
-		db_use_table(db_con, db_table);
191
-		DBG("MSILO: Database connection opened successfuly\n");
187
+	/* import the TM auto-loading function */
188
+	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT))) {
189
+		LOG(L_ERR, "ERROR: msilo: mod_init: can't import load_tm\n");
190
+		return -1;
192 191
 	}
193
-	*/
194
-	
195
-	DBG("MSILO: initialized ...\n");	
192
+	/* let the auto-loading function load all TM stuff */
193
+	if (load_tm( &tmb )==-1)
194
+		return -1;
195
+
196 196
 	return 0;
197 197
 }
198 198
 
... ...
@@ -575,7 +575,7 @@ static int m_dump(struct sip_msg* msg, char* str1, char* str2)
575 575
 					str_vals[STR_IDX_BODY] ) < 0)
576 576
 			{
577 577
 				DBG("MSILO: m_dump: sending simple body\n");
578
-				t_uac(&msg_type, &pto->uri, &hdr_str,
578
+				tmb.t_uac(&msg_type, &pto->uri, &hdr_str,
579 579
 					&str_vals[STR_IDX_BODY], &str_vals[STR_IDX_FROM],
580 580
 					m_tm_callback, (void*)msg_id, 0
581 581
 				);
... ...
@@ -583,7 +583,7 @@ static int m_dump(struct sip_msg* msg, char* str1, char* str2)
583 583
 			else
584 584
 			{
585 585
 				DBG("MSILO: m_dump: sending composed body\n");
586
-				t_uac(&msg_type, &pto->uri, &hdr_str,
586
+				tmb.t_uac(&msg_type, &pto->uri, &hdr_str,
587 587
 					&body_str, &str_vals[STR_IDX_FROM],
588 588
 					m_tm_callback, (void*)msg_id, 0
589 589
 				);
... ...
@@ -534,7 +534,7 @@ int global_init()
534 534
 
535 535
 	/* import the TM auto-loading function */
536 536
 	if ( !(load_tm=(load_tm_f)find_export("load_tm", NO_SCRIPT))) {
537
-		LOG(L_ERR, "ERROR: acc: mod_init: can't import load_tm\n");
537
+		LOG(L_ERR, "ERROR: sms: global_init: can't import load_tm\n");
538 538
 		goto error;
539 539
 	}
540 540
 	/* let the auto-loading function load all TM stuff */
... ...
@@ -320,7 +320,7 @@ int send_sip_msg_request(str *to, str *from_user, str *body)
320 320
 	/** sending SIP MSG using IM - deprecated **/
321 321
 	/*foo = im_send_message(to, to, &from, &contact, body); */
322 322
 	/** sending with TM **/
323
-	foo = tmb.t_uac( &msg_type, to, &hdrs, body, &from, 0);
323
+	foo = tmb.t_uac( &msg_type, to, &hdrs, body, &from, 0, 0, 0);
324 324
 	if (from.s) pkg_free(from.s);
325 325
 	if (hdrs.s) pkg_free(hdrs.s);
326 326
 	return foo;