Browse code

core: etc - basic and advanced configs relocated to misc/examples/pkg

- they are not installed by default anymore
- use 'make install-cfg-extras' to get them installed in the target etc folder

Daniel-Constantin Mierla authored on 07/11/2017 14:33:37
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,636 +0,0 @@
1
-#!KAMAILIO
2
-#
3
-# Kamailio (OpenSER) SIP Server v5.0 - default configuration script
4
-#     - web: http://www.kamailio.org
5
-#     - git: http://sip-router.org
6
-#
7
-# Direct your questions about this file to: <sr-users@lists.sip-router.org>
8
-#
9
-# Refer to the Core CookBook at http://www.kamailio.org/wiki/
10
-# for an explanation of possible statements, functions and parameters.
11
-#
12
-# Several features can be enabled using '#!define WITH_FEATURE' directives:
13
-#
14
-# *** To run in debug mode:
15
-#     - define WITH_DEBUG
16
-#
17
-# *** To enable mysql:
18
-#     - define WITH_MYSQL
19
-#
20
-# *** To enable authentication execute:
21
-#     - enable mysql
22
-#     - define WITH_AUTH
23
-#     - add users using 'kamctl'
24
-#
25
-# *** To enable IP authentication execute:
26
-#     - enable mysql
27
-#     - enable authentication
28
-#     - define WITH_IPAUTH
29
-#     - add IP addresses with group id '1' to 'address' table
30
-#
31
-# *** To enable persistent user location execute:
32
-#     - enable mysql
33
-#     - define WITH_USRLOCDB
34
-#
35
-# *** To enable nat traversal execute:
36
-#     - define WITH_NAT
37
-#     - install RTPProxy: http://www.rtpproxy.org
38
-#     - start RTPProxy:
39
-#        rtpproxy -l _your_public_ip_ -s udp:localhost:7722
40
-#     - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
41
-#
42
-# *** To enable TLS support execute:
43
-#     - adjust CFGDIR/tls.cfg as needed
44
-#     - define WITH_TLS
45
-#
46
-# *** To enhance accounting execute:
47
-#     - enable mysql
48
-#     - define WITH_ACCDB
49
-#     - add following columns to database
50
-#!ifdef ACCDB_COMMENT
51
-  ALTER TABLE acc ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';
52
-  ALTER TABLE acc ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT '';
53
-  ALTER TABLE acc ADD COLUMN src_ip varchar(64) NOT NULL default '';
54
-  ALTER TABLE acc ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';
55
-  ALTER TABLE acc ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';
56
-  ALTER TABLE acc ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT '';
57
-  ALTER TABLE missed_calls ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';
58
-  ALTER TABLE missed_calls ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT '';
59
-  ALTER TABLE missed_calls ADD COLUMN src_ip varchar(64) NOT NULL default '';
60
-  ALTER TABLE missed_calls ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';
61
-  ALTER TABLE missed_calls ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';
62
-  ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT '';
63
-#!endif
64
-
65
-####### Include Local Config If Exists #########
66
-import_file "kamailio-local.cfg"
67
-
68
-####### Defined Values #########
69
-
70
-# *** Value defines - IDs used later in config
71
-#!ifdef WITH_MYSQL
72
-# - database URL - used to connect to database server by modules such
73
-#       as: auth_db, acc, usrloc, a.s.o.
74
-#!ifndef DBURL
75
-#!define DBURL "mysql://kamailio:kamailiorw@localhost/kamailio"
76
-#!endif
77
-#!endif
78
-#!define MULTIDOMAIN 0
79
-
80
-# - flags
81
-#   FLT_ - per transaction (message) flags
82
-#	FLB_ - per branch flags
83
-#!define FLT_ACC 1
84
-#!define FLT_ACCMISSED 2
85
-#!define FLT_ACCFAILED 3
86
-#!define FLT_NATS 5
87
-
88
-#!define FLB_NATB 6
89
-#!define FLB_NATSIPPING 7
90
-
91
-####### Global Parameters #########
92
-
93
-### LOG Levels: 3=DBG, 2=INFO, 1=NOTICE, 0=WARN, -1=ERR
94
-#!ifdef WITH_DEBUG
95
-debug=4
96
-log_stderror=yes
97
-#!else
98
-debug=2
99
-log_stderror=no
100
-#!endif
101
-
102
-memdbg=5
103
-memlog=5
104
-
105
-log_facility=LOG_LOCAL0
106
-
107
-fork=yes
108
-children=4
109
-
110
-/* uncomment the next line to disable TCP (default on) */
111
-#disable_tcp=yes
112
-
113
-/* uncomment the next line to disable the auto discovery of local aliases
114
- * based on reverse DNS on IPs (default on) */
115
-#auto_aliases=no
116
-
117
-/* add local domain aliases */
118
-#alias="sip.mydomain.com"
119
-
120
-/* uncomment and configure the following line if you want Kamailio to
121
- * bind on a specific interface/port/proto (default bind on all available) */
122
-#listen=udp:10.0.0.10:5060
123
-
124
-/* port to listen to
125
- * - can be specified more than once if needed to listen on many ports */
126
-port=5060
127
-
128
-#!ifdef WITH_TLS
129
-enable_tls=yes
130
-#!endif
131
-
132
-# life time of TCP connection when there is no traffic
133
-# - a bit higher than registration expires to cope with UA behind NAT
134
-tcp_connection_lifetime=3605
135
-
136
-####### Modules Section ########
137
-
138
-# set paths to location of modules (to sources or installation folders)
139
-#!ifdef WITH_SRCPATH
140
-mpath="modules"
141
-#!else
142
-mpath="/usr/local/lib/kamailio/modules/"
143
-#!endif
144
-
145
-#!ifdef WITH_MYSQL
146
-loadmodule "db_mysql.so"
147
-#!endif
148
-
149
-loadmodule "jsonrpcs.so"
150
-loadmodule "kex.so"
151
-loadmodule "corex.so"
152
-loadmodule "tm.so"
153
-loadmodule "tmx.so"
154
-loadmodule "sl.so"
155
-loadmodule "rr.so"
156
-loadmodule "pv.so"
157
-loadmodule "maxfwd.so"
158
-loadmodule "usrloc.so"
159
-loadmodule "registrar.so"
160
-loadmodule "textops.so"
161
-loadmodule "siputils.so"
162
-loadmodule "xlog.so"
163
-loadmodule "sanity.so"
164
-loadmodule "ctl.so"
165
-loadmodule "cfg_rpc.so"
166
-loadmodule "acc.so"
167
-loadmodule "counters.so"
168
-
169
-#!ifdef WITH_AUTH
170
-loadmodule "auth.so"
171
-loadmodule "auth_db.so"
172
-#!ifdef WITH_IPAUTH
173
-loadmodule "permissions.so"
174
-#!endif
175
-#!endif
176
-
177
-#!ifdef WITH_NAT
178
-loadmodule "nathelper.so"
179
-loadmodule "rtpproxy.so"
180
-#!endif
181
-
182
-#!ifdef WITH_TLS
183
-loadmodule "tls.so"
184
-#!endif
185
-
186
-#!ifdef WITH_DEBUG
187
-loadmodule "debugger.so"
188
-#!endif
189
-
190
-# ----------------- setting module-specific parameters ---------------
191
-
192
-
193
-# ----- jsonrpcs params -----
194
-modparam("jsonrpcs", "pretty_format", 1)
195
-/* set the path to RPC fifo control file */
196
-# modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
197
-/* set the path to RPC unix socket control file */
198
-# modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
199
-
200
-# ----- ctl params -----
201
-#modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
202
-
203
-# ----- tm params -----
204
-# auto-discard branches from previous serial forking leg
205
-modparam("tm", "failure_reply_mode", 3)
206
-# default retransmission timeout: 30sec
207
-modparam("tm", "fr_timer", 30000)
208
-# default invite retransmission timeout after 1xx: 120sec
209
-modparam("tm", "fr_inv_timer", 120000)
210
-
211
-
212
-# ----- rr params -----
213
-# add value to ;lr param to cope with most of the UAs
214
-modparam("rr", "enable_full_lr", 1)
215
-# do not append from tag to the RR (no need for this script)
216
-modparam("rr", "append_fromtag", 0)
217
-
218
-
219
-# ----- registrar params -----
220
-modparam("registrar", "method_filtering", 1)
221
-/* uncomment the next line to disable parallel forking via location */
222
-# modparam("registrar", "append_branches", 0)
223
-/* uncomment the next line not to allow more than 10 contacts per AOR */
224
-#modparam("registrar", "max_contacts", 10)
225
-# max value for expires of registrations
226
-modparam("registrar", "max_expires", 3600)
227
-# set it to 1 to enable GRUU
228
-modparam("registrar", "gruu_enabled", 0)
229
-
230
-
231
-# ----- acc params -----
232
-/* what special events should be accounted ? */
233
-modparam("acc", "early_media", 0)
234
-modparam("acc", "report_ack", 0)
235
-modparam("acc", "report_cancels", 0)
236
-/* by default we do not adjust the direct of the sequential requests.
237
- * if you enable this parameter, be sure the enable "append_fromtag"
238
- * in "rr" module */
239
-modparam("acc", "detect_direction", 0)
240
-/* account triggers (flags) */
241
-modparam("acc", "log_flag", FLT_ACC)
242
-modparam("acc", "log_missed_flag", FLT_ACCMISSED)
243
-modparam("acc", "log_extra",
244
-	"src_user=$fU;src_domain=$fd;src_ip=$si;"
245
-	"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
246
-modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
247
-/* enhanced DB accounting */
248
-#!ifdef WITH_ACCDB
249
-modparam("acc", "db_flag", FLT_ACC)
250
-modparam("acc", "db_missed_flag", FLT_ACCMISSED)
251
-modparam("acc", "db_url", DBURL)
252
-modparam("acc", "db_extra",
253
-	"src_user=$fU;src_domain=$fd;src_ip=$si;"
254
-	"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
255
-#!endif
256
-
257
-
258
-# ----- usrloc params -----
259
-/* enable DB persistency for location entries */
260
-#!ifdef WITH_USRLOCDB
261
-modparam("usrloc", "db_url", DBURL)
262
-modparam("usrloc", "db_mode", 2)
263
-modparam("usrloc", "use_domain", MULTIDOMAIN)
264
-#!endif
265
-
266
-
267
-# ----- auth_db params -----
268
-#!ifdef WITH_AUTH
269
-modparam("auth_db", "db_url", DBURL)
270
-modparam("auth_db", "calculate_ha1", yes)
271
-modparam("auth_db", "password_column", "password")
272
-modparam("auth_db", "load_credentials", "")
273
-modparam("auth_db", "use_domain", MULTIDOMAIN)
274
-
275
-# ----- permissions params -----
276
-#!ifdef WITH_IPAUTH
277
-modparam("permissions", "db_url", DBURL)
278
-modparam("permissions", "db_mode", 1)
279
-#!endif
280
-
281
-#!endif
282
-
283
-
284
-#!ifdef WITH_NAT
285
-# ----- rtpproxy params -----
286
-modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
287
-
288
-# ----- nathelper params -----
289
-modparam("nathelper", "natping_interval", 30)
290
-modparam("nathelper", "ping_nated_only", 1)
291
-modparam("nathelper", "sipping_bflag", FLB_NATSIPPING)
292
-modparam("nathelper", "sipping_from", "sip:pinger@kamailio.org")
293
-
294
-# params needed for NAT traversal in other modules
295
-modparam("nathelper|registrar", "received_avp", "$avp(RECEIVED)")
296
-modparam("usrloc", "nat_bflag", FLB_NATB)
297
-#!endif
298
-
299
-
300
-#!ifdef WITH_TLS
301
-# ----- tls params -----
302
-modparam("tls", "config", "/usr/local/etc/kamailio/tls.cfg")
303
-#!endif
304
-
305
-#!ifdef WITH_DEBUG
306
-# ----- debugger params -----
307
-modparam("debugger", "cfgtrace", 1)
308
-#!endif
309
-
310
-####### Routing Logic ########
311
-
312
-
313
-# Main SIP request routing logic
314
-# - processing of any incoming SIP request starts with this route
315
-# - note: this is the same as route { ... }
316
-request_route {
317
-
318
-	# per request initial checks
319
-	route(REQINIT);
320
-
321
-	# NAT detection
322
-	route(NATDETECT);
323
-
324
-	# CANCEL processing
325
-	if (is_method("CANCEL")) {
326
-		if (t_check_trans()) {
327
-			route(RELAY);
328
-		}
329
-		exit;
330
-	}
331
-
332
-	# handle requests within SIP dialogs
333
-	route(WITHINDLG);
334
-
335
-	### only initial requests (no To tag)
336
-
337
-	# handle retransmissions
338
-	if(t_precheck_trans()) {
339
-		t_check_trans();
340
-		exit;
341
-	}
342
-	t_check_trans();
343
-
344
-	# authentication
345
-	route(AUTH);
346
-
347
-	# record routing for dialog forming requests (in case they are routed)
348
-	# - remove preloaded route headers
349
-	remove_hf("Route");
350
-	if (is_method("INVITE|SUBSCRIBE"))
351
-		record_route();
352
-
353
-	# account only INVITEs
354
-	if (is_method("INVITE")) {
355
-		setflag(FLT_ACC); # do accounting
356
-	}
357
-
358
-	# dispatch requests to foreign domains
359
-	route(SIPOUT);
360
-
361
-	### requests for my local domains
362
-
363
-	# handle registrations
364
-	route(REGISTRAR);
365
-
366
-	if ($rU==$null) {
367
-		# request with no Username in RURI
368
-		sl_send_reply("484","Address Incomplete");
369
-		exit;
370
-	}
371
-
372
-	# user location service
373
-	route(LOCATION);
374
-}
375
-
376
-
377
-route[RELAY] {
378
-	# enable additional event routes for forwarded requests
379
-	# - serial forking, RTP relaying handling, a.s.o.
380
-	if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {
381
-		if(!t_is_set("branch_route")) t_on_branch("MANAGE_BRANCH");
382
-	}
383
-	if (is_method("INVITE|SUBSCRIBE|UPDATE")) {
384
-		if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");
385
-	}
386
-	if (is_method("INVITE")) {
387
-		if(!t_is_set("failure_route")) t_on_failure("MANAGE_FAILURE");
388
-	}
389
-
390
-	if (!t_relay()) {
391
-		sl_reply_error();
392
-	}
393
-	exit;
394
-}
395
-
396
-# Per SIP request initial checks
397
-route[REQINIT] {
398
-#!ifdef WITH_ANTIFLOOD
399
-	# flood dection from same IP and traffic ban for a while
400
-	# be sure you exclude checking trusted peers, such as pstn gateways
401
-	# - local host excluded (e.g., loop to self)
402
-	if(src_ip!=myself) {
403
-		if($sht(ipban=>$si)!=$null) {
404
-			# ip is already blocked
405
-			xdbg("request from blocked IP - $rm from $fu (IP:$si:$sp)\n");
406
-			exit;
407
-		}
408
-		if (!pike_check_req()) {
409
-			xlog("L_ALERT","ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n");
410
-			$sht(ipban=>$si) = 1;
411
-			exit;
412
-		}
413
-	}
414
-	if($ua =~ "friendly-scanner") {
415
-		sl_send_reply("200", "OK");
416
-		exit;
417
-	}
418
-#!endif
419
-
420
-	if (!mf_process_maxfwd_header("10")) {
421
-		sl_send_reply("483","Too Many Hops");
422
-		exit;
423
-	}
424
-
425
-	if(is_method("OPTIONS") && uri==myself && $rU==$null) {
426
-		sl_send_reply("200","Keepalive");
427
-		exit;
428
-	}
429
-
430
-	if(!sanity_check("1511", "7")) {
431
-		xlog("Malformed SIP message from $si:$sp\n");
432
-		exit;
433
-	}
434
-}
435
-
436
-# Handle requests within SIP dialogs
437
-route[WITHINDLG] {
438
-	if (!has_totag()) return;
439
-
440
-	# sequential request withing a dialog should
441
-	# take the path determined by record-routing
442
-	if (loose_route()) {
443
-		route(DLGURI);
444
-		if (is_method("BYE")) {
445
-			setflag(FLT_ACC); # do accounting ...
446
-			setflag(FLT_ACCFAILED); # ... even if the transaction fails
447
-		}
448
-		else if ( is_method("ACK") ) {
449
-			# ACK is forwarded statelessly
450
-			route(NATMANAGE);
451
-		}
452
-		else if ( is_method("NOTIFY") ) {
453
-			# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
454
-			record_route();
455
-		}
456
-		route(RELAY);
457
-		exit;
458
-	}
459
-	if ( is_method("ACK") ) {
460
-		if ( t_check_trans() ) {
461
-			# no loose-route, but stateful ACK;
462
-			# must be an ACK after a 487
463
-			# or e.g. 404 from upstream server
464
-			route(RELAY);
465
-			exit;
466
-		} else {
467
-			# ACK without matching transaction ... ignore and discard
468
-			exit;
469
-		}
470
-	}
471
-	sl_send_reply("404", "Not here");
472
-	exit;
473
-}
474
-
475
-# Handle SIP registrations
476
-route[REGISTRAR] {
477
-	if (!is_method("REGISTER")) return;
478
-	if(isflagset(FLT_NATS)) {
479
-		setbflag(FLB_NATB);
480
-#!ifdef WITH_NATSIPPING
481
-		# do SIP NAT pinging
482
-		setbflag(FLB_NATSIPPING);
483
-#!endif
484
-	}
485
-	if (!save("location"))
486
-		sl_reply_error();
487
-
488
-	exit;
489
-}
490
-
491
-# User location service
492
-route[LOCATION] {
493
-	if (!lookup("location")) {
494
-		$var(rc) = $rc;
495
-		t_newtran();
496
-		switch ($var(rc)) {
497
-			case -1:
498
-			case -3:
499
-				send_reply("404", "Not Found");
500
-				exit;
501
-			case -2:
502
-				send_reply("405", "Method Not Allowed");
503
-				exit;
504
-		}
505
-	}
506
-
507
-	# when routing via usrloc, log the missed calls also
508
-	if (is_method("INVITE")) {
509
-		setflag(FLT_ACCMISSED);
510
-	}
511
-
512
-	route(RELAY);
513
-	exit;
514
-}
515
-
516
-
517
-# IP authorization and user uthentication
518
-route[AUTH] {
519
-#!ifdef WITH_AUTH
520
-
521
-#!ifdef WITH_IPAUTH
522
-	if((!is_method("REGISTER")) && allow_source_address()) {
523
-		# source IP allowed
524
-		return;
525
-	}
526
-#!endif
527
-
528
-	if (is_method("REGISTER") || from_uri==myself) {
529
-		# authenticate requests
530
-		if (!auth_check("$fd", "subscriber", "1")) {
531
-			auth_challenge("$fd", "0");
532
-			exit;
533
-		}
534
-		# user authenticated - remove auth header
535
-		if(!is_method("REGISTER|PUBLISH"))
536
-			consume_credentials();
537
-	}
538
-	# if caller is not local subscriber, then check if it calls
539
-	# a local destination, otherwise deny, not an open relay here
540
-	if (from_uri!=myself && uri!=myself) {
541
-		sl_send_reply("403","Not relaying");
542
-		exit;
543
-	}
544
-
545
-#!endif
546
-	return;
547
-}
548
-
549
-# Caller NAT detection
550
-route[NATDETECT] {
551
-#!ifdef WITH_NAT
552
-	force_rport();
553
-	if (nat_uac_test("19")) {
554
-		if (is_method("REGISTER")) {
555
-			fix_nated_register();
556
-		} else {
557
-			if(is_first_hop())
558
-				set_contact_alias();
559
-		}
560
-		setflag(FLT_NATS);
561
-	}
562
-#!endif
563
-	return;
564
-}
565
-
566
-# RTPProxy control
567
-route[NATMANAGE] {
568
-#!ifdef WITH_NAT
569
-	if (is_request()) {
570
-		if(has_totag()) {
571
-			if(check_route_param("nat=yes")) {
572
-				setbflag(FLB_NATB);
573
-			}
574
-		}
575
-	}
576
-	if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
577
-		return;
578
-
579
-	rtpproxy_manage("co");
580
-
581
-	if (is_request()) {
582
-		if (!has_totag()) {
583
-			if(t_is_branch_route()) {
584
-				add_rr_param(";nat=yes");
585
-			}
586
-		}
587
-	}
588
-	if (is_reply()) {
589
-		if(isbflagset(FLB_NATB)) {
590
-			set_contact_alias();
591
-		}
592
-	}
593
-#!endif
594
-	return;
595
-}
596
-
597
-# URI update for dialog requests
598
-route[DLGURI] {
599
-#!ifdef WITH_NAT
600
-	if(!isdsturiset()) {
601
-		handle_ruri_alias();
602
-	}
603
-#!endif
604
-	return;
605
-}
606
-
607
-# Routing to foreign domains
608
-route[SIPOUT] {
609
-	if (uri==myself) return;
610
-
611
-	append_hf("P-hint: outbound\r\n");
612
-	route(RELAY);
613
-	exit;
614
-}
615
-
616
-# Manage outgoing branches
617
-branch_route[MANAGE_BRANCH] {
618
-	xdbg("new branch [$T_branch_idx] to $ru\n");
619
-	route(NATMANAGE);
620
-}
621
-
622
-# Manage incoming replies
623
-onreply_route[MANAGE_REPLY] {
624
-	xdbg("incoming reply\n");
625
-	if(status=~"[12][0-9][0-9]")
626
-		route(NATMANAGE);
627
-}
628
-
629
-# Manage failure routing cases
630
-failure_route[MANAGE_FAILURE] {
631
-	route(NATMANAGE);
632
-
633
-	if (t_is_canceled()) {
634
-		exit;
635
-	}
636
-}
Browse code

cfg: fix spelling error in load module statement related to jsonrpcs

Henning Westerholt authored on 04/11/2017 22:28:32
Showing 1 changed files
... ...
@@ -146,7 +146,7 @@ mpath="/usr/local/lib/kamailio/modules/"
146 146
 loadmodule "db_mysql.so"
147 147
 #!endif
148 148
 
149
-loadmodule "jsonrpc.so"
149
+loadmodule "jsonrpcs.so"
150 150
 loadmodule "kex.so"
151 151
 loadmodule "corex.so"
152 152
 loadmodule "tm.so"
Browse code

examples, modules: fix common typo [skip ci]

Mikko Lehto authored on 02/06/2017 00:36:51
Showing 1 changed files
... ...
@@ -446,7 +446,7 @@ route[WITHINDLG] {
446 446
 			setflag(FLT_ACCFAILED); # ... even if the transaction fails
447 447
 		}
448 448
 		else if ( is_method("ACK") ) {
449
-			# ACK is forwarded statelessy
449
+			# ACK is forwarded statelessly
450 450
 			route(NATMANAGE);
451 451
 		}
452 452
 		else if ( is_method("NOTIFY") ) {
Browse code

etc: load counters module in config files

- it provides control interface to counters/stats

Daniel-Constantin Mierla authored on 10/01/2017 18:51:19
Showing 1 changed files
... ...
@@ -164,6 +164,7 @@ loadmodule "sanity.so"
164 164
 loadmodule "ctl.so"
165 165
 loadmodule "cfg_rpc.so"
166 166
 loadmodule "acc.so"
167
+loadmodule "counters.so"
167 168
 
168 169
 #!ifdef WITH_AUTH
169 170
 loadmodule "auth.so"
Browse code

etc: removed mi modules from config files

Daniel-Constantin Mierla authored on 04/01/2017 14:47:54
Showing 1 changed files
... ...
@@ -146,7 +146,7 @@ mpath="/usr/local/lib/kamailio/modules/"
146 146
 loadmodule "db_mysql.so"
147 147
 #!endif
148 148
 
149
-loadmodule "mi_fifo.so"
149
+loadmodule "jsonrpc.so"
150 150
 loadmodule "kex.so"
151 151
 loadmodule "corex.so"
152 152
 loadmodule "tm.so"
... ...
@@ -163,7 +163,6 @@ loadmodule "xlog.so"
163 163
 loadmodule "sanity.so"
164 164
 loadmodule "ctl.so"
165 165
 loadmodule "cfg_rpc.so"
166
-loadmodule "mi_rpc.so"
167 166
 loadmodule "acc.so"
168 167
 
169 168
 #!ifdef WITH_AUTH
... ...
@@ -190,8 +189,12 @@ loadmodule "debugger.so"
190 189
 # ----------------- setting module-specific parameters ---------------
191 190
 
192 191
 
193
-# ----- mi_fifo params -----
194
-#modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
192
+# ----- jsonrpcs params -----
193
+modparam("jsonrpcs", "pretty_format", 1)
194
+/* set the path to RPC fifo control file */
195
+# modparam("jsonrpcs", "fifo_name", "/var/run/kamailio/kamailio_rpc.fifo")
196
+/* set the path to RPC unix socket control file */
197
+# modparam("jsonrpcs", "dgram_socket", "/var/run/kamailio/kamailio_rpc.sock")
195 198
 
196 199
 # ----- ctl params -----
197 200
 #modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
Browse code

kamailio-basic.cfg: updated version in comments and small format fixes

Daniel-Constantin Mierla authored on 23/04/2016 06:23:30
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 #!KAMAILIO
2 2
 #
3
-# Kamailio (OpenSER) SIP Server v4.3 - default configuration script
3
+# Kamailio (OpenSER) SIP Server v5.0 - default configuration script
4 4
 #     - web: http://www.kamailio.org
5 5
 #     - git: http://sip-router.org
6 6
 #
... ...
@@ -11,10 +11,10 @@
11 11
 #
12 12
 # Several features can be enabled using '#!define WITH_FEATURE' directives:
13 13
 #
14
-# *** To run in debug mode: 
14
+# *** To run in debug mode:
15 15
 #     - define WITH_DEBUG
16 16
 #
17
-# *** To enable mysql: 
17
+# *** To enable mysql:
18 18
 #     - define WITH_MYSQL
19 19
 #
20 20
 # *** To enable authentication execute:
... ...
@@ -111,14 +111,14 @@ children=4
111 111
 #disable_tcp=yes
112 112
 
113 113
 /* uncomment the next line to disable the auto discovery of local aliases
114
-   based on reverse DNS on IPs (default on) */
114
+ * based on reverse DNS on IPs (default on) */
115 115
 #auto_aliases=no
116 116
 
117 117
 /* add local domain aliases */
118 118
 #alias="sip.mydomain.com"
119 119
 
120
-/* uncomment and configure the following line if you want Kamailio to 
121
-   bind on a specific interface/port/proto (default bind on all available) */
120
+/* uncomment and configure the following line if you want Kamailio to
121
+ * bind on a specific interface/port/proto (default bind on all available) */
122 122
 #listen=udp:10.0.0.10:5060
123 123
 
124 124
 /* port to listen to
... ...
@@ -229,14 +229,14 @@ modparam("registrar", "gruu_enabled", 0)
229 229
 modparam("acc", "early_media", 0)
230 230
 modparam("acc", "report_ack", 0)
231 231
 modparam("acc", "report_cancels", 0)
232
-/* by default ww do not adjust the direct of the sequential requests.
233
-   if you enable this parameter, be sure the enable "append_fromtag"
234
-   in "rr" module */
232
+/* by default we do not adjust the direct of the sequential requests.
233
+ * if you enable this parameter, be sure the enable "append_fromtag"
234
+ * in "rr" module */
235 235
 modparam("acc", "detect_direction", 0)
236 236
 /* account triggers (flags) */
237 237
 modparam("acc", "log_flag", FLT_ACC)
238 238
 modparam("acc", "log_missed_flag", FLT_ACCMISSED)
239
-modparam("acc", "log_extra", 
239
+modparam("acc", "log_extra",
240 240
 	"src_user=$fU;src_domain=$fd;src_ip=$si;"
241 241
 	"dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
242 242
 modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
Browse code

etc: don't set fifo and ctl socket in config files

- modparams were commented, to be used as samples if needed to be
changed
- the default values are enough for proper packaging and use of run_dir
in order to avoid security exposures of /tmp dir

Daniel-Constantin Mierla authored on 28/04/2015 13:34:44
Showing 1 changed files
... ...
@@ -191,10 +191,10 @@ loadmodule "debugger.so"
191 191
 
192 192
 
193 193
 # ----- mi_fifo params -----
194
-modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
194
+#modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
195 195
 
196 196
 # ----- ctl params -----
197
-modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
197
+#modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
198 198
 
199 199
 # ----- tm params -----
200 200
 # auto-discard branches from previous serial forking leg
Browse code

etc: change fifo default to /var/run/kamailio

Victor Seva authored on 17/02/2015 09:08:18
Showing 1 changed files
... ...
@@ -191,7 +191,7 @@ loadmodule "debugger.so"
191 191
 
192 192
 
193 193
 # ----- mi_fifo params -----
194
-modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
194
+modparam("mi_fifo", "fifo_name", "/var/run/kamailio/kamailio_fifo")
195 195
 
196 196
 # ----- ctl params -----
197 197
 modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
Browse code

etc: set ctl "binrpc" to new /var/run/kamailio default value

Victor Seva authored on 17/02/2015 09:03:35
Showing 1 changed files
... ...
@@ -193,6 +193,8 @@ loadmodule "debugger.so"
193 193
 # ----- mi_fifo params -----
194 194
 modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
195 195
 
196
+# ----- ctl params -----
197
+modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
196 198
 
197 199
 # ----- tm params -----
198 200
 # auto-discard branches from previous serial forking leg
Browse code

configuration update - version

Olle E. Johansson authored on 12/10/2014 18:14:38
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 #!KAMAILIO
2 2
 #
3
-# Kamailio (OpenSER) SIP Server v4.2 - default configuration script
3
+# Kamailio (OpenSER) SIP Server v4.3 - default configuration script
4 4
 #     - web: http://www.kamailio.org
5 5
 #     - git: http://sip-router.org
6 6
 #
Browse code

kamailio-basic.cfg: updates to track minimal common parts with kamailio.cfg

Daniel-Constantin Mierla authored on 20/09/2014 20:23:14
Showing 1 changed files
... ...
@@ -37,6 +37,7 @@
37 37
 #     - install RTPProxy: http://www.rtpproxy.org
38 38
 #     - start RTPProxy:
39 39
 #        rtpproxy -l _your_public_ip_ -s udp:localhost:7722
40
+#     - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
40 41
 #
41 42
 # *** To enable TLS support execute:
42 43
 #     - adjust CFGDIR/tls.cfg as needed
... ...
@@ -136,9 +137,9 @@ tcp_connection_lifetime=3605
136 137
 
137 138
 # set paths to location of modules (to sources or installation folders)
138 139
 #!ifdef WITH_SRCPATH
139
-mpath="modules_k:modules"
140
+mpath="modules"
140 141
 #!else
141
-mpath="/usr/local/lib/kamailio/modules_k/:/usr/local/lib/kamailio/modules/"
142
+mpath="/usr/local/lib/kamailio/modules/"
142 143
 #!endif
143 144
 
144 145
 #!ifdef WITH_MYSQL
... ...
@@ -327,6 +328,11 @@ request_route {
327 328
 
328 329
 	### only initial requests (no To tag)
329 330
 
331
+	# handle retransmissions
332
+	if(t_precheck_trans()) {
333
+		t_check_trans();
334
+		exit;
335
+	}
330 336
 	t_check_trans();
331 337
 
332 338
 	# authentication
... ...
@@ -399,6 +405,10 @@ route[REQINIT] {
399 405
 			exit;
400 406
 		}
401 407
 	}
408
+	if($ua =~ "friendly-scanner") {
409
+		sl_send_reply("200", "OK");
410
+		exit;
411
+	}
402 412
 #!endif
403 413
 
404 414
 	if (!mf_process_maxfwd_header("10")) {
... ...
@@ -406,6 +416,11 @@ route[REQINIT] {
406 416
 		exit;
407 417
 	}
408 418
 
419
+	if(is_method("OPTIONS") && uri==myself && $rU==$null) {
420
+		sl_send_reply("200","Keepalive");
421
+		exit;
422
+	}
423
+
409 424
 	if(!sanity_check("1511", "7")) {
410 425
 		xlog("Malformed SIP message from $si:$sp\n");
411 426
 		exit;
... ...
@@ -414,59 +429,60 @@ route[REQINIT] {
414 429
 
415 430
 # Handle requests within SIP dialogs
416 431
 route[WITHINDLG] {
417
-	if (has_totag()) {
418
-		# sequential request withing a dialog should
419
-		# take the path determined by record-routing
420
-		if (loose_route()) {
421
-			route(DLGURI);
422
-			if (is_method("BYE")) {
423
-				setflag(FLT_ACC); # do accounting ...
424
-				setflag(FLT_ACCFAILED); # ... even if the transaction fails
425
-			}
426
-			else if ( is_method("ACK") ) {
427
-				# ACK is forwarded statelessy
428
-				route(NATMANAGE);
429
-			}
430
-			else if ( is_method("NOTIFY") ) {
431
-				# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
432
-				record_route();
433
-			}
432
+	if (!has_totag()) return;
433
+
434
+	# sequential request withing a dialog should
435
+	# take the path determined by record-routing
436
+	if (loose_route()) {
437
+		route(DLGURI);
438
+		if (is_method("BYE")) {
439
+			setflag(FLT_ACC); # do accounting ...
440
+			setflag(FLT_ACCFAILED); # ... even if the transaction fails
441
+		}
442
+		else if ( is_method("ACK") ) {
443
+			# ACK is forwarded statelessy
444
+			route(NATMANAGE);
445
+		}
446
+		else if ( is_method("NOTIFY") ) {
447
+			# Add Record-Route for in-dialog NOTIFY as per RFC 6665.
448
+			record_route();
449
+		}
450
+		route(RELAY);
451
+		exit;
452
+	}
453
+	if ( is_method("ACK") ) {
454
+		if ( t_check_trans() ) {
455
+			# no loose-route, but stateful ACK;
456
+			# must be an ACK after a 487
457
+			# or e.g. 404 from upstream server
434 458
 			route(RELAY);
459
+			exit;
435 460
 		} else {
436
-			if ( is_method("ACK") ) {
437