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