Browse code

examples: moved to misc directory

Daniel-Constantin Mierla authored on 07/12/2016 13:56:54
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,36 +0,0 @@
1
-#
2
-# $Id$
3
-#
4
-# this example shows use of ser as stateless redirect server
5
-# which rewrites URIs using an exernal utility
6
-#
7
-
8
-# ------------------ module loading ----------------------------------
9
-
10
-loadmodule "modules/exec/exec.so"
11
-loadmodule "modules/sl/sl.so"
12
-
13
-# -------------------------  request routing logic -------------------
14
-
15
-# main routing logic
16
-
17
-route{
18
-	# for testing purposes, simply okay all REGISTERs
19
-	if (method=="REGISTER") {
20
-		log("REGISTER");
21
-		sl_send_reply("200", "ok");
22
-		break;
23
-	};
24
-
25
-	# first dump the message to a file using cat command
26
-	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
27
-	# and then rewrite URI using external utility
28
-	# note that the last echo command trashes input parameter
29
-	if (exec_dset("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
30
-		sl_send_reply("300", "Redirect");
31
-	} else {
32
-		sl_reply_error();
33
-		log(1, "alas, rewriting failed\n");
34
-	};
35
-}
36
-
Browse code

examples aligned to 8.11

Jiri Kuthan authored on 03/06/2003 03:18:12
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ route{
26 26
 	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
27 27
 	# and then rewrite URI using external utility
28 28
 	# note that the last echo command trashes input parameter
29
-	if (exec_dst("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
29
+	if (exec_dset("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
30 30
 		sl_send_reply("300", "Redirect");
31 31
 	} else {
32 32
 		sl_reply_error();
Browse code

example aligned to new exec module

Jiri Kuthan authored on 14/12/2002 22:10:01
Showing 1 changed files
... ...
@@ -26,7 +26,7 @@ route{
26 26
 	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
27 27
 	# and then rewrite URI using external utility
28 28
 	# note that the last echo command trashes input parameter
29
-	if (exec_uri("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
29
+	if (exec_dst("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
30 30
 		sl_send_reply("300", "Redirect");
31 31
 	} else {
32 32
 		sl_reply_error();
Browse code

admin documentation refurbished -- quite many changes, don't want me to list all of them

Jiri Kuthan authored on 09/12/2002 02:32:56
Showing 1 changed files
... ...
@@ -5,20 +5,10 @@
5 5
 # which rewrites URIs using an exernal utility
6 6
 #
7 7
 
8
-# ----------- global configuration parameters ------------------------
9
-
10
-debug=4
11
-fork=no
12
-log_stderror=yes	# (cmd line: -E)
13
-check_via=no # (cmd. line: -v)
14
-dns=no # (cmd. line: -r)
15
-syn_branch=1
16
-reply_to_via=0
17
-
18 8
 # ------------------ module loading ----------------------------------
19 9
 
20
-loadmodule "/usr/lib/ser/modules/sl.so"
21
-loadmodule "/usr/lib/ser/modules/exec.so"
10
+loadmodule "modules/exec/exec.so"
11
+loadmodule "modules/sl/sl.so"
22 12
 
23 13
 # -------------------------  request routing logic -------------------
24 14
 
... ...
@@ -32,17 +22,11 @@ route{
32 22
 		break;
33 23
 	};
34 24
 
35
-	# obsoleted
36
-	#ext_rewriteuri("echo sip:jiri@iptel.org; echo >/dev/null");
37
-	#break;
38
-
39 25
 	# first dump the message to a file using cat command
40 26
 	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
41 27
 	# and then rewrite URI using external utility
42 28
 	# note that the last echo command trashes input parameter
43 29
 	if (exec_uri("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
44
-
45
-	#if (exec_uri("/tmp/sh.sh")) {
46 30
 		sl_send_reply("300", "Redirect");
47 31
 	} else {
48 32
 		sl_reply_error();
Browse code

examples simplified and aligned to latest ser version

Jiri Kuthan authored on 04/10/2002 21:37:11
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@
8 8
 # ----------- global configuration parameters ------------------------
9 9
 
10 10
 debug=4
11
-fork=1
11
+fork=no
12 12
 log_stderror=yes	# (cmd line: -E)
13 13
 check_via=no # (cmd. line: -v)
14 14
 dns=no # (cmd. line: -r)
... ...
@@ -18,9 +18,7 @@ reply_to_via=0
18 18
 # ------------------ module loading ----------------------------------
19 19
 
20 20
 loadmodule "/usr/lib/ser/modules/sl.so"
21
-loadmodule "/usr/lib/ser/modules/print.so"
22
-loadmodule "/usr/lib/ser/modules/exec_mod.so"
23
-loadmodule "/usr/lib/ser/modules/ext.so"
21
+loadmodule "/usr/lib/ser/modules/exec.so"
24 22
 
25 23
 # -------------------------  request routing logic -------------------
26 24
 
Browse code

listen option removed from example config files

Jiri Kuthan authored on 24/09/2002 02:38:45
Showing 1 changed files
... ...
@@ -15,11 +15,6 @@ dns=no # (cmd. line: -r)
15 15
 syn_branch=1
16 16
 reply_to_via=0
17 17
 
18
-# advertise IP address in Via (as opposed to advertising DNS name
19
-# which is annoying for downstream servers and some phones can
20
-# not handle DNS at all)
21
-listen=195.37.77.100
22
-
23 18
 # ------------------ module loading ----------------------------------
24 19
 
25 20
 loadmodule "/usr/lib/ser/modules/sl.so"
Browse code

fixed module paths

Jiri Kuthan authored on 19/09/2002 22:06:17
Showing 1 changed files
... ...
@@ -22,10 +22,10 @@ listen=195.37.77.100
22 22
 
23 23
 # ------------------ module loading ----------------------------------
24 24
 
25
-loadmodule "../sip_router/modules/sl/sl.so"
26
-loadmodule "../sip_router/modules/print/print.so"
27
-loadmodule "../sip_router/modules/exec/exec_mod.so"
28
-loadmodule "../sip_router/modules/ext/ext.so"
25
+loadmodule "/usr/lib/ser/modules/sl.so"
26
+loadmodule "/usr/lib/ser/modules/print.so"
27
+loadmodule "/usr/lib/ser/modules/exec_mod.so"
28
+loadmodule "/usr/lib/ser/modules/ext.so"
29 29
 
30 30
 # -------------------------  request routing logic -------------------
31 31
 
Browse code

scripts moved to examples

Jiri Kuthan authored on 19/08/2002 18:33:17
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,59 @@
1
+#
2
+# $Id$
3
+#
4
+# this example shows use of ser as stateless redirect server
5
+# which rewrites URIs using an exernal utility
6
+#
7
+
8
+# ----------- global configuration parameters ------------------------
9
+
10
+debug=4
11
+fork=1
12
+log_stderror=yes	# (cmd line: -E)
13
+check_via=no # (cmd. line: -v)
14
+dns=no # (cmd. line: -r)
15
+syn_branch=1
16
+reply_to_via=0
17
+
18
+# advertise IP address in Via (as opposed to advertising DNS name
19
+# which is annoying for downstream servers and some phones can
20
+# not handle DNS at all)
21
+listen=195.37.77.100
22
+
23
+# ------------------ module loading ----------------------------------
24
+
25
+loadmodule "../sip_router/modules/sl/sl.so"
26
+loadmodule "../sip_router/modules/print/print.so"
27
+loadmodule "../sip_router/modules/exec/exec_mod.so"
28
+loadmodule "../sip_router/modules/ext/ext.so"
29
+
30
+# -------------------------  request routing logic -------------------
31
+
32
+# main routing logic
33
+
34
+route{
35
+	# for testing purposes, simply okay all REGISTERs
36
+	if (method=="REGISTER") {
37
+		log("REGISTER");
38
+		sl_send_reply("200", "ok");
39
+		break;
40
+	};
41
+
42
+	# obsoleted
43
+	#ext_rewriteuri("echo sip:jiri@iptel.org; echo >/dev/null");
44
+	#break;
45
+
46
+	# first dump the message to a file using cat command
47
+	exec_msg("printenv SRCIP > /tmp/exectest.txt; cat >> /tmp/exectest.txt");
48
+	# and then rewrite URI using external utility
49
+	# note that the last echo command trashes input parameter
50
+	if (exec_uri("echo sip:mra@iptel.org;echo sip:mrb@iptel.org;echo>/dev/null")) {
51
+
52
+	#if (exec_uri("/tmp/sh.sh")) {
53
+		sl_send_reply("300", "Redirect");
54
+	} else {
55
+		sl_reply_error();
56
+		log(1, "alas, rewriting failed\n");
57
+	};
58
+}
59
+