瀏覽代碼

minor delayed clean-ups

Jiri Kuthan 23 年之前
父節點
當前提交
3044915006
共有 6 個文件被更改,包括 30 次插入1 次删除
  1. 3 0
      README-MODULES
  2. 2 0
      dset.c
  3. 8 0
      error.c
  4. 8 0
      error.h
  5. 1 1
      modules/tm/Makefile
  6. 8 0
      sr_module.c

+ 3 - 0
README-MODULES

@@ -21,6 +21,9 @@ cpl		experimental alpha		Call Processing Language
 ext		experimental alpha		Execution of external URI
 ext		experimental alpha		Execution of external URI
 (bia)							processing logic
 (bia)							processing logic
 
 
+exec	experimental beta		Execution of external URI
+(jku)							processing logic
+
 im		temporary	 alpha		Stateless instant messaging	
 im		temporary	 alpha		Stateless instant messaging	
 (bia)							client
 (bia)							client
 
 

+ 2 - 0
dset.c

@@ -13,6 +13,7 @@
 #include "ut.h"
 #include "ut.h"
 #include "hash_func.h"
 #include "hash_func.h"
 #include "dset.h"
 #include "dset.h"
+#include "error.h"
 
 
 
 
 
 
@@ -57,6 +58,7 @@ int append_branch( struct sip_msg *msg, char *uri, int uri_len )
 	   of branches, don't try new ones */
 	   of branches, don't try new ones */
 	if (nr_branches==MAX_BRANCHES-1) {
 	if (nr_branches==MAX_BRANCHES-1) {
 		LOG(L_ERR, "ERROR: append_branch: max nr of branches exceeded\n");
 		LOG(L_ERR, "ERROR: append_branch: max nr of branches exceeded\n");
+		ser_error=E_TOO_MANY_BRANCHES;
 		return -1;
 		return -1;
 	}
 	}
 
 

+ 8 - 0
error.c

@@ -50,6 +50,14 @@ int err2reason_phrase(
 			error_txt="Transaction tupel incomplete";
 			error_txt="Transaction tupel incomplete";
 			*sip_error=-E_BAD_REQ;
 			*sip_error=-E_BAD_REQ;
 			break;
 			break;
+		case E_EXEC:
+			error_txt="Error in external logic";
+			*sip_error=-E_BAD_SERVER;
+			break;
+		case E_TOO_MANY_BRANCHES:
+			error_txt="Forking capacity exceeded";
+			*sip_error=-E_BAD_SERVER;
+			break;
 		default:
 		default:
 			error_txt="I'm terribly sorry, server error occured";
 			error_txt="I'm terribly sorry, server error occured";
 			*sip_error=500;
 			*sip_error=500;

+ 8 - 0
error.h

@@ -18,6 +18,10 @@
 #define E_BAD_TUPEL		-9
 #define E_BAD_TUPEL		-9
 /* script programming error */
 /* script programming error */
 #define E_SCRIPT		-10
 #define E_SCRIPT		-10
+/* error in exceution of external tools */
+#define E_EXEC			-11
+/* too many branches demanded */
+#define E_TOO_MANY_BRANCHES -12
 
 
 #define E_SEND		  -477
 #define E_SEND		  -477
 /* unresolveable next-hop address */
 /* unresolveable next-hop address */
@@ -27,6 +31,10 @@
 /* misformated request */
 /* misformated request */
 #define E_BAD_REQ	  -400
 #define E_BAD_REQ	  -400
 
 
+/* error in server */
+#define E_BAD_SERVER	  -500
+
+
 #define MAX_REASON_LEN	128
 #define MAX_REASON_LEN	128
 
 
 #include "str.h"
 #include "str.h"

+ 1 - 1
modules/tm/Makefile

@@ -6,7 +6,7 @@
 # WARNING: do not run this directly, it should be run by the master Makefile
 # WARNING: do not run this directly, it should be run by the master Makefile
 
 
 auto_gen=
 auto_gen=
-NAME=tm.so
+NAME=tm_mod.so
 LIBS= #-lpthread
 LIBS= #-lpthread
 
 
 include ../../Makefile.modules
 include ../../Makefile.modules

+ 8 - 0
sr_module.c

@@ -13,6 +13,9 @@
 
 
 struct sr_module* modules=0;
 struct sr_module* modules=0;
 
 
+#ifdef STATIC_EXEC
+	extern struct module_exports* exec_exports();
+#endif
 #ifdef STATIC_TM
 #ifdef STATIC_TM
 	extern struct module_exports* tm_exports();
 	extern struct module_exports* tm_exports();
 #endif
 #endif
@@ -45,6 +48,11 @@ int register_builtin_modules()
 	if (ret<0) return ret;
 	if (ret<0) return ret;
 #endif
 #endif
 
 
+#ifdef EXEC_TM
+	ret=register_module(exec_exports,"built-in", 0); 
+	if (ret<0) return ret;
+#endif
+
 #ifdef STATIC_MAXFWD
 #ifdef STATIC_MAXFWD
 	ret=register_module(maxfwd_exports, "built-in", 0);
 	ret=register_module(maxfwd_exports, "built-in", 0);
 	if (ret<0) return ret;
 	if (ret<0) return ret;