Browse code

new example showing behaviour of flag processing in reply handlers introduced

Jiri Kuthan authored on 14/10/2003 00:57:13
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,100 @@
1
+#
2
+# $Id$
3
+#
4
+# simple quick-start config script
5
+#
6
+
7
+# ----------- global configuration parameters ------------------------
8
+
9
+debug=3         # debug level (cmd line: -dddddddddd)
10
+fork=yes
11
+log_stderror=no	# (cmd line: -E)
12
+
13
+fork=no
14
+log_stderror=yes
15
+
16
+check_via=no	# (cmd. line: -v)
17
+dns=no           # (cmd. line: -r)
18
+rev_dns=no      # (cmd. line: -R)
19
+children=4
20
+fifo="/tmp/ser_fifo"
21
+
22
+listen=195.37.77.100
23
+port=5068
24
+
25
+# ------------------ module loading ----------------------------------
26
+
27
+# Uncomment this if you want to use SQL database
28
+#loadmodule "/usr/local/lib/ser/modules/mysql.so"
29
+
30
+loadmodule "/usr/local/lib/ser/modules/sl.so"
31
+loadmodule "/usr/local/lib/ser/modules/tm.so"
32
+loadmodule "/usr/local/lib/ser/modules/rr.so"
33
+loadmodule "/usr/local/lib/ser/modules/maxfwd.so"
34
+loadmodule "/usr/local/lib/ser/modules/usrloc.so"
35
+loadmodule "/usr/local/lib/ser/modules/registrar.so"
36
+loadmodule "/usr/local/lib/ser/modules/textops.so"
37
+
38
+# Uncomment this if you want digest authentication
39
+# mysql.so must be loaded !
40
+#loadmodule "/usr/local/lib/ser/modules/auth.so"
41
+#loadmodule "/usr/local/lib/ser/modules/auth_db.so"
42
+
43
+# ----------------- setting module-specific parameters ---------------
44
+
45
+# -- usrloc params --
46
+
47
+modparam("usrloc", "db_mode",   0)
48
+
49
+# Uncomment this if you want to use SQL database 
50
+# for persistent storage and comment the previous line
51
+#modparam("usrloc", "db_mode", 2)
52
+
53
+# -- auth params --
54
+# Uncomment if you are using auth module
55
+#
56
+#modparam("auth_db", "calculate_ha1", yes)
57
+#
58
+# If you set "calculate_ha1" parameter to yes (which true in this config), 
59
+# uncomment also the following parameter)
60
+#
61
+#modparam("auth_db", "password_column", "password")
62
+
63
+# -- rr params --
64
+# add value to ;lr param to make some broken UAs happy
65
+modparam("rr", "enable_full_lr", 1)
66
+
67
+# -------------------------  request routing logic -------------------
68
+
69
+# main routing logic
70
+
71
+route{
72
+
73
+	setflag(1);
74
+	t_on_failure("1");
75
+	t_on_reply("1");
76
+	log(1, "message received\n");
77
+	t_relay_to_udp("iptel.org", "5060");
78
+
79
+	break;
80
+
81
+}
82
+
83
+onreply_route[1]
84
+{
85
+	if (isflagset(1)) {
86
+		log(1, "onreply: flag set\n");
87
+	} else {
88
+		log(1, "onreply: flag unset\n");
89
+	};
90
+}
91
+
92
+failure_route[1] 
93
+{
94
+	if (isflagset(1)) {
95
+		log(1, "failure: flag set\n");
96
+	} else {
97
+		log(1, "failure: flag unset\n");
98
+	};
99
+}
100
+