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,101 +0,0 @@
1
-#
2
-# $Id$
3
-#
4
-# simple proxy script for forwarding to voicemail server
5
-# for unavailable users
6
-#
7
-
8
-loadmodule "modules/sl/sl.so"
9
-loadmodule "modules/tm/tm.so"
10
-loadmodule "modules/rr/rr.so"
11
-loadmodule "modules/maxfwd/maxfwd.so"
12
-loadmodule "modules/mysql/mysql.so"
13
-loadmodule "modules/group/group.so"
14
-loadmodule "modules/usrloc/usrloc.so"
15
-loadmodule "modules/registrar/registrar.so"
16
-
17
-# time to give up on ringing -- global timer, applies to 
18
-#    all transactions
19
-modparam("tm", "fr_inv_timer", 90)
20
-
21
-# database with user group membership
22
-modparam("group", "db_url", "mysql://ser:heslo@localhost/ser")
23
-
24
-
25
-# ---------------------  request routing logic -------------------
26
-route {
27
-
28
-	if (!mf_process_maxfwd_header("10")) {
29
-		log("LOG: Too many hops\n");
30
-		sl_send_reply("483", "Alas Too Many Hops");
31
-		break;
32
-	};
33
-
34
-	if (!(method=="REGISTER")) record_route();
35
-	if (loose_route()) {
36
-		t_relay();
37
-		break;
38
-	};
39
-
40
-	if (!uri==myself) {
41
-		t_relay();
42
-		break;
43
-	};
44
-
45
-	if (method == "REGISTER") {
46
-		if (!save("location")) {
47
-			sl_reply_error();
48
-		};
49
-		break;
50
-	};
51
-
52
-	# does the user wish redirection on no availability? (i.e., is he
53
-	# in the voicemail group?) -- determine it now and store it in
54
-	# flag 4, before we rewrite the flag using UsrLoc
55
-	if (is_user_in("Request-URI", "voicemail")) {
56
-		setflag(4);
57
-	};
58
-
59
-	# native SIP destinations are handled using our USRLOC DB
60
-	if (!lookup("location")) {
61
-		# handle user which was not found
62
-		route(4);
63
-		break;
64
-	};
65
-
66
-	# if user is on-line and is in voicemail group, enable redirection
67
-	if (method == "INVITE" && isflagset(4)) {
68
-		t_on_failure("1");
69
-	};
70
-	t_relay();
71
-}
72
-
73
-# ------------- handling of unavailable user ------------------
74
-route[4] {
75
-
76
-	# non-Voip -- just send "off-line"
77
-	if (!(method == "INVITE" || method == "ACK" || method == "CANCEL")) {
78
-		sl_send_reply("404", "Not Found");
79
-		break;
80
-	};
81
-
82
-	# not voicemail subscriber
83
-	if (!isflagset(4)) { 
84
-		sl_send_reply("404", "Not Found and no voicemail turned on");
85
-		break;
86
-	};
87
-
88
-	# forward to voicemail now
89
-	rewritehostport("bat.iptel.org:5090");
90
-	t_relay_to_udp("bat.iptel.org", "5090");	
91
-}
92
-
93
-# if forwarding downstream did not succeed, try voicemail running
94
-# at bat.iptel.org:5090
95
-
96
-failure_route[1] {
97
-	revert_uri();
98
-	rewritehostport("bat.iptel.org:5090");
99
-	append_branch();
100
-	t_relay_to_udp("bat.iptel.org", "5090");
101
-}
Browse code

- sql:// changed to mysql:// in all modules

Jan Janak authored on 03/11/2003 13:03:56
Showing 1 changed files
... ...
@@ -19,7 +19,7 @@ loadmodule "modules/registrar/registrar.so"
19 19
 modparam("tm", "fr_inv_timer", 90)
20 20
 
21 21
 # database with user group membership
22
-modparam("group", "db_url", "sql://ser:heslo@localhost/ser")
22
+modparam("group", "db_url", "mysql://ser:heslo@localhost/ser")
23 23
 
24 24
 
25 25
 # ---------------------  request routing logic -------------------
Browse code

initial commit of example showing how a proxy server can serve a voicemail server

Jiri Kuthan authored on 30/10/2003 14:52:41
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,101 @@
1
+#
2
+# $Id$
3
+#
4
+# simple proxy script for forwarding to voicemail server
5
+# for unavailable users
6
+#
7
+
8
+loadmodule "modules/sl/sl.so"
9
+loadmodule "modules/tm/tm.so"
10
+loadmodule "modules/rr/rr.so"
11
+loadmodule "modules/maxfwd/maxfwd.so"
12
+loadmodule "modules/mysql/mysql.so"
13
+loadmodule "modules/group/group.so"
14
+loadmodule "modules/usrloc/usrloc.so"
15
+loadmodule "modules/registrar/registrar.so"
16
+
17
+# time to give up on ringing -- global timer, applies to 
18
+#    all transactions
19
+modparam("tm", "fr_inv_timer", 90)
20
+
21
+# database with user group membership
22
+modparam("group", "db_url", "sql://ser:heslo@localhost/ser")
23
+
24
+
25
+# ---------------------  request routing logic -------------------
26
+route {
27
+
28
+	if (!mf_process_maxfwd_header("10")) {
29
+		log("LOG: Too many hops\n");
30
+		sl_send_reply("483", "Alas Too Many Hops");
31
+		break;
32
+	};
33
+
34
+	if (!(method=="REGISTER")) record_route();
35
+	if (loose_route()) {
36
+		t_relay();
37
+		break;
38
+	};
39
+
40
+	if (!uri==myself) {
41
+		t_relay();
42
+		break;
43
+	};
44
+
45
+	if (method == "REGISTER") {
46
+		if (!save("location")) {
47
+			sl_reply_error();
48
+		};
49
+		break;
50
+	};
51
+
52
+	# does the user wish redirection on no availability? (i.e., is he
53
+	# in the voicemail group?) -- determine it now and store it in
54
+	# flag 4, before we rewrite the flag using UsrLoc
55
+	if (is_user_in("Request-URI", "voicemail")) {
56
+		setflag(4);
57
+	};
58
+
59
+	# native SIP destinations are handled using our USRLOC DB
60
+	if (!lookup("location")) {
61
+		# handle user which was not found
62
+		route(4);
63
+		break;
64
+	};
65
+
66
+	# if user is on-line and is in voicemail group, enable redirection
67
+	if (method == "INVITE" && isflagset(4)) {
68
+		t_on_failure("1");
69
+	};
70
+	t_relay();
71
+}
72
+
73
+# ------------- handling of unavailable user ------------------
74
+route[4] {
75
+
76
+	# non-Voip -- just send "off-line"
77
+	if (!(method == "INVITE" || method == "ACK" || method == "CANCEL")) {
78
+		sl_send_reply("404", "Not Found");
79
+		break;
80
+	};
81
+
82
+	# not voicemail subscriber
83
+	if (!isflagset(4)) { 
84
+		sl_send_reply("404", "Not Found and no voicemail turned on");
85
+		break;
86
+	};
87
+
88
+	# forward to voicemail now
89
+	rewritehostport("bat.iptel.org:5090");
90
+	t_relay_to_udp("bat.iptel.org", "5090");	
91
+}
92
+
93
+# if forwarding downstream did not succeed, try voicemail running
94
+# at bat.iptel.org:5090
95
+
96
+failure_route[1] {
97
+	revert_uri();
98
+	rewritehostport("bat.iptel.org:5090");
99
+	append_branch();
100
+	t_relay_to_udp("bat.iptel.org", "5090");
101
+}