Browse code

minor delayed clean-ups

Jiri Kuthan authored on 16/08/2002 13:26:15
Showing 6 changed files
... ...
@@ -21,6 +21,9 @@ cpl		experimental alpha		Call Processing Language
21 21
 ext		experimental alpha		Execution of external URI
22 22
 (bia)							processing logic
23 23
 
24
+exec	experimental beta		Execution of external URI
25
+(jku)							processing logic
26
+
24 27
 im		temporary	 alpha		Stateless instant messaging	
25 28
 (bia)							client
26 29
 
... ...
@@ -13,6 +13,7 @@
13 13
 #include "ut.h"
14 14
 #include "hash_func.h"
15 15
 #include "dset.h"
16
+#include "error.h"
16 17
 
17 18
 
18 19
 
... ...
@@ -57,6 +58,7 @@ int append_branch( struct sip_msg *msg, char *uri, int uri_len )
57 57
 	   of branches, don't try new ones */
58 58
 	if (nr_branches==MAX_BRANCHES-1) {
59 59
 		LOG(L_ERR, "ERROR: append_branch: max nr of branches exceeded\n");
60
+		ser_error=E_TOO_MANY_BRANCHES;
60 61
 		return -1;
61 62
 	}
62 63
 
... ...
@@ -50,6 +50,14 @@ int err2reason_phrase(
50 50
 			error_txt="Transaction tupel incomplete";
51 51
 			*sip_error=-E_BAD_REQ;
52 52
 			break;
53
+		case E_EXEC:
54
+			error_txt="Error in external logic";
55
+			*sip_error=-E_BAD_SERVER;
56
+			break;
57
+		case E_TOO_MANY_BRANCHES:
58
+			error_txt="Forking capacity exceeded";
59
+			*sip_error=-E_BAD_SERVER;
60
+			break;
53 61
 		default:
54 62
 			error_txt="I'm terribly sorry, server error occured";
55 63
 			*sip_error=500;
... ...
@@ -18,6 +18,10 @@
18 18
 #define E_BAD_TUPEL		-9
19 19
 /* script programming error */
20 20
 #define E_SCRIPT		-10
21
+/* error in exceution of external tools */
22
+#define E_EXEC			-11
23
+/* too many branches demanded */
24
+#define E_TOO_MANY_BRANCHES -12
21 25
 
22 26
 #define E_SEND		  -477
23 27
 /* unresolveable next-hop address */
... ...
@@ -27,6 +31,10 @@
27 27
 /* misformated request */
28 28
 #define E_BAD_REQ	  -400
29 29
 
30
+/* error in server */
31
+#define E_BAD_SERVER	  -500
32
+
33
+
30 34
 #define MAX_REASON_LEN	128
31 35
 
32 36
 #include "str.h"
... ...
@@ -6,7 +6,7 @@
6 6
 # WARNING: do not run this directly, it should be run by the master Makefile
7 7
 
8 8
 auto_gen=
9
-NAME=tm.so
9
+NAME=tm_mod.so
10 10
 LIBS= #-lpthread
11 11
 
12 12
 include ../../Makefile.modules
... ...
@@ -13,6 +13,9 @@
13 13
 
14 14
 struct sr_module* modules=0;
15 15
 
16
+#ifdef STATIC_EXEC
17
+	extern struct module_exports* exec_exports();
18
+#endif
16 19
 #ifdef STATIC_TM
17 20
 	extern struct module_exports* tm_exports();
18 21
 #endif
... ...
@@ -45,6 +48,11 @@ int register_builtin_modules()
45 45
 	if (ret<0) return ret;
46 46
 #endif
47 47
 
48
+#ifdef EXEC_TM
49
+	ret=register_module(exec_exports,"built-in", 0); 
50
+	if (ret<0) return ret;
51
+#endif
52
+
48 53
 #ifdef STATIC_MAXFWD
49 54
 	ret=register_module(maxfwd_exports, "built-in", 0);
50 55
 	if (ret<0) return ret;