[sr-dev] git:master: dispatcher(k): use load_tm_api

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 15 23:54:24 CET 2010


Module: sip-router
Branch: master
Commit: fd5ddfd12c25497aa859dafc2bf65e3c07fd4529
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fd5ddfd12c25497aa859dafc2bf65e3c07fd4529

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Mar 15 23:50:13 2010 +0100

dispatcher(k): use load_tm_api

- import tm module api directly
- patch by Stephen Young (styoung)

---

 modules_k/dispatcher/dispatcher.c |   25 +++++++------------------
 1 files changed, 7 insertions(+), 18 deletions(-)

diff --git a/modules_k/dispatcher/dispatcher.c b/modules_k/dispatcher/dispatcher.c
index 07a5f37..02ce218 100644
--- a/modules_k/dispatcher/dispatcher.c
+++ b/modules_k/dispatcher/dispatcher.c
@@ -352,26 +352,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;




More information about the sr-dev mailing list