summaryrefslogtreecommitdiffstats
path: root/testing/kamailio/kamailio.cfg
blob: 9c101a871fcc7ed2704aff1c6ae127f52d8d179d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Demonstration Kamailio Configuration for AlpineLinux


#--------------------------------------------------------
# Section 1:  Global Definitions
#--------------------------------------------------------
debug		=	3
fork		=	yes
log_stderror	=	no
listen		=	0.0.0.0
port		=	5060
children	=	4

dns		=	no
rev_dns		=	no

mpath		= 	"/usr/lib/kamailio/modules/"
#--------------------------------------------------------
# Section 2:  Modules
#--------------------------------------------------------

loadmodule	"sl.so"
loadmodule	"tm.so"		
loadmodule	"rr.so"
loadmodule	"maxfwd.so"
loadmodule	"usrloc.so"
loadmodule	"registrar.so"
loadmodule	"mi_fifo.so"

#--------------------------------------------------------
# Section 1:  Module Configuration
#--------------------------------------------------------

modparam ( "usrloc", "db_mode", 0 )
modparam ( "rr", "enable_full_lr", 1 )
modparam ( "mi_fifo", "fifo_name", "/tmp/kamailio_fifo")

#--------------------------------------------------------
# Section 1:  Main Route Block
#--------------------------------------------------------

route 
  {
	if (!mf_process_maxfwd_header("10")) 
		{	
		sl_send_reply("483", "Too Many Hops");
		return;
		}

	if (msg:len > max_len) 
		{
		sl_send_reply("513", "Message Overflow");
		return;
		}
	
	if (method == "REGISTER" )
		{
		route(2);
		return;
		}

	loose_route();
	
	if (!lookup("location")) {
		sl_send_reply("404", "User Not Found");
		return;
		}
		
	route(1);
		
}
#--------------------------------------------------------
# Section 1:  Secondary Route Blocks
#--------------------------------------------------------

# - Default message handler
route[1] {
	if (!t_relay()) {
		sl_reply_error();
		}
}

#- Registration Request
route[2] {
	if (!save("location")) {
		sl_reply_error();
	}
}

#--------------------------------------------------------
# Section 1:  Reply Route Block
#--------------------------------------------------------


#--------------------------------------------------------
# Section 1:  Failure Route Block
#--------------------------------------------------------