[sr-dev] git:jason.penton/kamailio_ims_extensions: CDP: add api load function

Jason Penton jason.penton at gmail.com
Wed Oct 26 09:51:18 CEST 2011


Module: sip-router
Branch: jason.penton/kamailio_ims_extensions
Commit: 4c0dda545501e3a81b3ad7081be64820bc93fee6
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=4c0dda545501e3a81b3ad7081be64820bc93fee6

Author: Jason Penton <jason.penton at gmail.com>
Committer: Jason Penton <jason.penton at gmail.com>
Date:   Tue Oct 25 12:59:05 2011 +0200

CDP: add api load function

---

 modules/cdp/cdp_load.h |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/modules/cdp/cdp_load.h b/modules/cdp/cdp_load.h
index 7444f01..241d4c3 100644
--- a/modules/cdp/cdp_load.h
+++ b/modules/cdp/cdp_load.h
@@ -54,7 +54,7 @@
 #ifndef _CDP_BIND_H
 #define _CDP_BIND_H
 
-
+#include "../../sr_module.h"
 #include "utils.h"
 #include "diameter.h"
 #include "diameter_api.h"
@@ -116,6 +116,25 @@ struct cdp_binds {
 typedef int(*load_cdp_f)( struct cdp_binds *cdpb );
 int load_cdp( struct cdp_binds *cdpb);
 
+static inline int load_cdp_api(struct cdp_binds* cdpb)
+{
+	load_cdp_f load_cdp;
+
+	/* import the TM auto-loading function */
+	load_cdp = (load_cdp_f)find_export("load_cdp", NO_SCRIPT, 0);
+	
+	if (load_cdp == NULL) {
+		LOG(L_WARN, "Cannot import load_cdp function from CDP module\n");
+		return -1;
+	}
+	
+	/* let the auto-loading function load all TM stuff */
+	if (load_cdp(cdpb) == -1) {
+		return -1;
+	}
+	return 0;
+}
+
 
 #endif
 




More information about the sr-dev mailing list