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,93 +0,0 @@
1
-#
2
-# $Id$
3
-#
4
-# this script is configured for use as voicemail UAS; it processes
5
-# INVITEs and BYEs and asks SEMS to record media via "vm"; in this
6
-# script, all record-routing and other constructs known from proxy
7
-# scripts are not present  -- it is a simple UAS 
8
-#
9
-
10
-# ----------- global configuration parameters ------------------------
11
-
12
-#debug=		        # debug level (cmd line: -dddddddddd)
13
-#fork=no
14
-#log_stderror=yes 	# (cmd line: -E)
15
-
16
-
17
-check_via=no		# (cmd. line: -v)
18
-dns=no			# (cmd. line: -r)
19
-rev_dns=no		# (cmd. line: -R)
20
-port=5090
21
-children=4
22
-fifo="/tmp/vm_ser_fifo"
23
-
24
-# ------------------ module loading ----------------------------------
25
-
26
-loadmodule "/home/srouter/sip_router/modules/sl/sl.so"
27
-loadmodule "/home/srouter/sip_router/modules/tm/tm.so"
28
-loadmodule "/home/srouter/sip_router/modules/maxfwd/maxfwd.so"
29
-loadmodule "/home/srouter/sip_router/modules/mysql/mysql.so"
30
-loadmodule "/home/srouter/sip_router/modules/vm/vm.so"
31
-	    
32
-# ----------------- setting module-specific parameters ---------------
33
-
34
-modparam("vm", "db_url","mysql://ser:heslo@dbhost/ser")
35
-
36
-# -------------------------  request routing logic -------------------
37
-
38
-# main routing logic
39
-
40
-route{
41
-
42
-
43
-	# initial sanity checks -- messages with
44
-	# max_forwars==0, or excessively long requests
45
-	if (!mf_process_maxfwd_header("10")) {
46
-		sl_send_reply("483","Too Many Hops");
47
-		break;
48
-	};
49
-	if (len_gt( max_len )) {
50
-		sl_send_reply("513", "Message too big");
51
-		break;
52
-	};
53
-
54
-	if (!uri==myself) {
55
-		sl_send_reply("404", "not reponsible for host in r-uri");
56
-		break;
57
-	};
58
-
59
-
60
-	# Voicemail specific configuration - begin
61
-
62
-	if(method=="ACK" || method=="INVITE" || method=="BYE"){
63
-
64
-		if (!t_newtran()) {
65
-			log("could not create new transaction\n");
66
-			sl_send_reply("500","could not create new transaction");
67
-			break;
68
-		};
69
-
70
-		t_reply("100","Trying -- just wait a minute !");
71
-		if(method=="INVITE"){
72
-			log("**************** vm start - begin ******************\n");
73
-			if(!vm("/tmp/am_fifo","voicemail")){
74
-				log("could not contact the answer machine\n");
75
-				t_reply("500","could not contact the answer machine");
76
-			};
77
-			log("**************** vm start - end ******************\n");
78
-		} else if(method=="BYE"){
79
-			log("**************** vm end - begin ******************\n");
80
-			if(!vm("/tmp/am_fifo","bye")){
81
-				log("could not contact the answer machine\n");
82
-				t_reply("500","could not contact the answer machine");
83
-			};
84
-			log("**************** vm end - end ******************\n");
85
-		};
86
-		break;
87
-	};
88
-	if (method=="CANCEL") {
89
-		sl_send_reply("200", "cancels are junked here");
90
-		break;
91
-	};
92
-	sl_send_reply("501", "method not understood here");
93
-}
Browse code

changed vm module name from 'voicemail' to 'vm' to avoid confusion.

Raphael Coeffic authored on 14/01/2004 18:23:50
Showing 1 changed files
... ...
@@ -31,7 +31,7 @@ loadmodule "/home/srouter/sip_router/modules/vm/vm.so"
31 31
 	    
32 32
 # ----------------- setting module-specific parameters ---------------
33 33
 
34
-modparam("voicemail", "db_url","mysql://ser:heslo@dbhost/ser")
34
+modparam("vm", "db_url","mysql://ser:heslo@dbhost/ser")
35 35
 
36 36
 # -------------------------  request routing logic -------------------
37 37
 
Browse code

deleted the announcement server part, so that the example gets simplier.

Raphael Coeffic authored on 29/11/2003 12:45:44
Showing 1 changed files
... ...
@@ -70,16 +70,9 @@ route{
70 70
 		t_reply("100","Trying -- just wait a minute !");
71 71
 		if(method=="INVITE"){
72 72
 			log("**************** vm start - begin ******************\n");
73
-			if (uri=~"sip:as_welcome@.*" || uri=~"sip:as_nomoney@.*") {
74
-	               		if (!vm("/tmp/am_fifo", "announcement")) {
75
-			        	log("couldn't contact announcement server\n");
76
-					t_reply("500", "couldn not contact announcement server");
77
-				};
78
-			} else {
79
-				if(!vm("/tmp/am_fifo","voicemail")){
80
-					log("could not contact the answer machine\n");
81
-					t_reply("500","could not contact the answer machine");
82
-				};
73
+			if(!vm("/tmp/am_fifo","voicemail")){
74
+				log("could not contact the answer machine\n");
75
+				t_reply("500","could not contact the answer machine");
83 76
 			};
84 77
 			log("**************** vm start - end ******************\n");
85 78
 		} else if(method=="BYE"){
Browse code

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

Jan Janak authored on 03/11/2003 13:03:56
Showing 1 changed files
... ...
@@ -31,7 +31,7 @@ loadmodule "/home/srouter/sip_router/modules/vm/vm.so"
31 31
 	    
32 32
 # ----------------- setting module-specific parameters ---------------
33 33
 
34
-modparam("voicemail", "db_url","sql://ser:heslo@dbhost/ser")
34
+modparam("voicemail", "db_url","mysql://ser:heslo@dbhost/ser")
35 35
 
36 36
 # -------------------------  request routing logic -------------------
37 37
 
Browse code

examples ported from stable to devel

Jiri Kuthan authored on 10/10/2003 06:27:18
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,100 @@
1
+#
2
+# $Id$
3
+#
4
+# this script is configured for use as voicemail UAS; it processes
5
+# INVITEs and BYEs and asks SEMS to record media via "vm"; in this
6
+# script, all record-routing and other constructs known from proxy
7
+# scripts are not present  -- it is a simple UAS 
8
+#
9
+
10
+# ----------- global configuration parameters ------------------------
11
+
12
+#debug=		        # debug level (cmd line: -dddddddddd)
13
+#fork=no
14
+#log_stderror=yes 	# (cmd line: -E)
15
+
16
+
17
+check_via=no		# (cmd. line: -v)
18
+dns=no			# (cmd. line: -r)
19
+rev_dns=no		# (cmd. line: -R)
20
+port=5090
21
+children=4
22
+fifo="/tmp/vm_ser_fifo"
23
+
24
+# ------------------ module loading ----------------------------------
25
+
26
+loadmodule "/home/srouter/sip_router/modules/sl/sl.so"
27
+loadmodule "/home/srouter/sip_router/modules/tm/tm.so"
28
+loadmodule "/home/srouter/sip_router/modules/maxfwd/maxfwd.so"
29
+loadmodule "/home/srouter/sip_router/modules/mysql/mysql.so"
30
+loadmodule "/home/srouter/sip_router/modules/vm/vm.so"
31
+	    
32
+# ----------------- setting module-specific parameters ---------------
33
+
34
+modparam("voicemail", "db_url","sql://ser:heslo@dbhost/ser")
35
+
36
+# -------------------------  request routing logic -------------------
37
+
38
+# main routing logic
39
+
40
+route{
41
+
42
+
43
+	# initial sanity checks -- messages with
44
+	# max_forwars==0, or excessively long requests
45
+	if (!mf_process_maxfwd_header("10")) {
46
+		sl_send_reply("483","Too Many Hops");
47
+		break;
48
+	};
49
+	if (len_gt( max_len )) {
50
+		sl_send_reply("513", "Message too big");
51
+		break;
52
+	};
53
+
54
+	if (!uri==myself) {
55
+		sl_send_reply("404", "not reponsible for host in r-uri");
56
+		break;
57
+	};
58
+
59
+
60
+	# Voicemail specific configuration - begin
61
+
62
+	if(method=="ACK" || method=="INVITE" || method=="BYE"){
63
+
64
+		if (!t_newtran()) {
65
+			log("could not create new transaction\n");
66
+			sl_send_reply("500","could not create new transaction");
67
+			break;
68
+		};
69
+
70
+		t_reply("100","Trying -- just wait a minute !");
71
+		if(method=="INVITE"){
72
+			log("**************** vm start - begin ******************\n");
73
+			if (uri=~"sip:as_welcome@.*" || uri=~"sip:as_nomoney@.*") {
74
+	               		if (!vm("/tmp/am_fifo", "announcement")) {
75
+			        	log("couldn't contact announcement server\n");
76
+					t_reply("500", "couldn not contact announcement server");
77
+				};
78
+			} else {
79
+				if(!vm("/tmp/am_fifo","voicemail")){
80
+					log("could not contact the answer machine\n");
81
+					t_reply("500","could not contact the answer machine");
82
+				};
83
+			};
84
+			log("**************** vm start - end ******************\n");
85
+		} else if(method=="BYE"){
86
+			log("**************** vm end - begin ******************\n");
87
+			if(!vm("/tmp/am_fifo","bye")){
88
+				log("could not contact the answer machine\n");
89
+				t_reply("500","could not contact the answer machine");
90
+			};
91
+			log("**************** vm end - end ******************\n");
92
+		};
93
+		break;
94
+	};
95
+	if (method=="CANCEL") {
96
+		sl_send_reply("200", "cancels are junked here");
97
+		break;
98
+	};
99
+	sl_send_reply("501", "method not understood here");
100
+}