Browse Source

dispatcher(k): use load_tm_api

- import tm module api directly
- patch by Stephen Young (styoung)
(cherry picked from commit fd5ddfd12c25497aa859dafc2bf65e3c07fd4529)
Daniel-Constantin Mierla 15 years ago
parent
commit
967542011b
1 changed files with 7 additions and 18 deletions
  1. 7 18
      modules_k/dispatcher/dispatcher.c

+ 7 - 18
modules_k/dispatcher/dispatcher.c

@@ -337,26 +337,15 @@ static int mod_init(void)
 		/*****************************************************
 		 * TM-Bindings
 	  	 *****************************************************/
-		load_tm_f load_tm;
-		load_tm=(load_tm_f)find_export("load_tm", 0, 0);
-	
-		/* import the TM auto-loading function */
-		if (load_tm)
+		if (load_tm_api( &tmb ) == -1)
 		{
-			/* let the auto-loading function load all TM stuff */
-			if (load_tm( &tmb ) == -1)
-			{
-				LM_ERR("could not load the TM-functions - disable DS ping\n");
-				return -1;
-			}
-			/*****************************************************
-			 * Register the PING-Timer
-	    	 *****************************************************/
-			register_timer(ds_check_timer, NULL, ds_ping_interval);
-		} else {
-			LM_WARN("could not bind to the TM-Module, automatic"
-					" re-activation disabled.\n");
+			LM_ERR("could not load the TM-functions - disable DS ping\n");
+			return -1;
 		}
+		/*****************************************************
+		 * Register the PING-Timer
+		 *****************************************************/
+		register_timer(ds_check_timer, NULL, ds_ping_interval);
 	}
 
 	return 0;