[sr-dev] git:master: modules/textopsx: exported textopsx API

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Oct 19 12:50:00 CEST 2011


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

Author: pd <peter.dunkley at crocodile-rcs.com>
Committer: pd <peter.dunkley at crocodile-rcs.com>
Date:   Wed Oct 19 11:33:16 2011 +0100

modules/textopsx: exported textopsx API

- This is so that I can use msg_apply_changes in app_lua

---

 modules/textopsx/textopsx.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/modules/textopsx/textopsx.c b/modules/textopsx/textopsx.c
index ad099b9..2228d3b 100644
--- a/modules/textopsx/textopsx.c
+++ b/modules/textopsx/textopsx.c
@@ -33,6 +33,7 @@
 #include "../../data_lump.h"
 #include "../../msg_translator.h"
 
+#include "api.h"
 
 MODULE_VERSION
 
@@ -42,6 +43,7 @@ static int change_reply_status_f(struct sip_msg*, char*, char *);
 static int change_reply_status_fixup(void** param, int param_no);
 
 static int w_remove_body_f(struct sip_msg*, char*, char *);
+static int bind_textopsx(textopsx_api_t *tob);
 
 /* cfg functions */
 static cmd_export_t cmds[] = {
@@ -51,6 +53,8 @@ static cmd_export_t cmds[] = {
 		change_reply_status_fixup, ONREPLY_ROUTE },
 	{"remove_body",          (cmd_function)w_remove_body_f,         0,
 		0, ANY_ROUTE },
+	{"bind_textopsx",        (cmd_function)bind_textopsx,           1,
+		0, ANY_ROUTE },
 
 
 	{0,0,0,0,0}
@@ -257,3 +261,15 @@ static int w_remove_body_f(struct sip_msg *msg, char *p1, char *p2)
 	}
 	return 1;
 }
+
+/*
+ * Function to load the textops api.
+ */
+static int bind_textopsx(textopsx_api_t *tob){
+	if(tob==NULL){
+		LM_WARN("textopsx_binds: Cannot load textopsx API into a NULL pointer\n");
+		return -1;
+	}
+	tob->msg_apply_changes = msg_apply_changes_f;
+	return 0;
+}




More information about the sr-dev mailing list