minor delayed clean-ups
authorJiri Kuthan <jiri@iptel.org>
Fri, 16 Aug 2002 13:26:15 +0000 (13:26 +0000)
committerJiri Kuthan <jiri@iptel.org>
Fri, 16 Aug 2002 13:26:15 +0000 (13:26 +0000)
README-MODULES
dset.c
error.c
error.h
modules/tm/Makefile
sr_module.c

index 591c6bd..2f2822d 100644 (file)
@@ -21,6 +21,9 @@ cpl           experimental alpha              Call Processing Language
 ext            experimental alpha              Execution of external URI
 (bia)                                                  processing logic
 
+exec   experimental beta               Execution of external URI
+(jku)                                                  processing logic
+
 im             temporary        alpha          Stateless instant messaging     
 (bia)                                                  client
 
diff --git a/dset.c b/dset.c
index 117f577..0dae3f3 100644 (file)
--- a/dset.c
+++ b/dset.c
@@ -13,6 +13,7 @@
 #include "ut.h"
 #include "hash_func.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 */
        if (nr_branches==MAX_BRANCHES-1) {
                LOG(L_ERR, "ERROR: append_branch: max nr of branches exceeded\n");
+               ser_error=E_TOO_MANY_BRANCHES;
                return -1;
        }
 
diff --git a/error.c b/error.c
index 8d1328d..7b5d5ca 100644 (file)
--- a/error.c
+++ b/error.c
@@ -50,6 +50,14 @@ int err2reason_phrase(
                        error_txt="Transaction tupel incomplete";
                        *sip_error=-E_BAD_REQ;
                        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:
                        error_txt="I'm terribly sorry, server error occured";
                        *sip_error=500;
diff --git a/error.h b/error.h
index 3544606..7687d65 100644 (file)
--- a/error.h
+++ b/error.h
 #define E_BAD_TUPEL            -9
 /* script programming error */
 #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
 /* unresolveable next-hop address */
 /* misformated request */
 #define E_BAD_REQ        -400
 
+/* error in server */
+#define E_BAD_SERVER     -500
+
+
 #define MAX_REASON_LEN 128
 
 #include "str.h"
index e969fb7..ca7d990 100644 (file)
@@ -6,7 +6,7 @@
 # WARNING: do not run this directly, it should be run by the master Makefile
 
 auto_gen=
-NAME=tm.so
+NAME=tm_mod.so
 LIBS= #-lpthread
 
 include ../../Makefile.modules
index 978b0b2..73bab2e 100644 (file)
@@ -13,6 +13,9 @@
 
 struct sr_module* modules=0;
 
+#ifdef STATIC_EXEC
+       extern struct module_exports* exec_exports();
+#endif
 #ifdef STATIC_TM
        extern struct module_exports* tm_exports();
 #endif
@@ -45,6 +48,11 @@ int register_builtin_modules()
        if (ret<0) return ret;
 #endif
 
+#ifdef EXEC_TM
+       ret=register_module(exec_exports,"built-in", 0); 
+       if (ret<0) return ret;
+#endif
+
 #ifdef STATIC_MAXFWD
        ret=register_module(maxfwd_exports, "built-in", 0);
        if (ret<0) return ret;