1#
2# IMCONF usage example
3#
4#
5
6
7debug=2           # debug level (cmd line: -dddddddddd)
8fork=no           # don't fork
9log_stderror=yes  # log to stderr (cmd line: -E)
10
11
12children=0        # number of children
13check_via=no      # (cmd. line: -v)
14dns=off           # (cmd. line: -r)
15rev_dns=off       # (cmd. line: -R)
16port=5060
17
18alias="stefan.lo"
19
20# ------------------ module loading ----------------------------------
21mpath="/usr/local/lib64/kamailio/modules"
22
23loadmodule "db_mysql.so"
24
25loadmodule "textops.so"
26
27loadmodule "sl.so"
28loadmodule "maxfwd.so"
29loadmodule "imc.so"
30loadmodule "tm.so"
31loadmodule "xlog.so"
32loadmodule "registrar.so"
33loadmodule "usrloc.so"
34loadmodule "mi_fifo.so"
35
36# ----------------- setting module-specific parameters ---------------
37
38# -- mi_fifo params --
39
40modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
41
42# -- usrloc params --
43
44modparam("usrloc", "db_mode", 2)
45
46# -- registrar params --
47
48modparam("registrar", "default_expires", 120)
49
50# -- registrar params --
51
52modparam("usrloc", "db_mode", 0)
53
54# -- imc params --
55modparam("imc", "imc_cmd_start_char", "#")
56modparam("imc|usrloc", "db_url", "mysql://kamailio:kamailiorw@192.168.2.132/kamailio")
57
58# -- tm params --
59
60modparam("tm", "fr_timer", 10 )
61modparam("tm", "fr_inv_timer", 15 )
62modparam("tm", "wt_timer", 10 )
63
64
65route{
66    	if ( !mf_process_maxfwd_header("10") )
67    	{
68        	sl_send_reply("483","To Many Hops");
69        	drop();
70    	};
71
72        # registrations -
73	if(is_method("REGISTER")) {
74		save("location");
75		exit;
76	}
77
78	if(uri=~"sip:q.*@")
79	{
80	        # IMC - message
81		xdbg("script: message from [$fu] r-uri [$ru] msg [$rb]\n");
82		if(is_method("MESSAGE"))
83		{
84			log("MESSAGE received -> processing with imc\n");
85			sl_send_reply("200", "ok");
86			imc_manager();
87			exit;
88		} else {
89			sl_send_reply("404", "not found");
90			exit;
91		};
92   	} else {
93		xdbg("script: message not for room, from [$fu] r-uri [$ru] msg [$rb]\n");
94		if(!lookup("location"))
95		{
96			sl_send_reply("404", "not found");
97			exit;
98		}
99		t_relay();
100		exit();
101	};
102}
103