-
Notifications
You must be signed in to change notification settings - Fork 16
/
kamailio.cfg.in
82 lines (68 loc) · 1.59 KB
/
kamailio.cfg.in
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
mpath=KAM_MPATH
loadmodule "sl/sl.so"
loadmodule "tm/tm.so"
loadmodule "rr/rr.so"
loadmodule "maxfwd/maxfwd.so"
loadmodule "rtpproxy/rtpproxy.so"
loadmodule "textops/textops.so"
loadmodule "pv/pv.so"
loadmodule "siputils/siputils.so"
modparam("rtpproxy", "rtpproxy_sock", RTPP_SOCK_TEST)
listen=udp:127.0.0.1:5060
listen=udp:[::1]:5060
route {
// initial sanity checks -- messages with
// max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 4096 ) {
sl_send_reply("513", "Message too big");
exit;
};
// shield us against retransmits
if (!t_newtran()) {
sl_reply_error();
exit;
};
if (method == "INVITE") {
if (rtpproxy_offer("r")) {
t_on_reply("1");
if (!has_totag()) {
t_on_failure("1");
};
} else {
sl_send_reply("502", "Very Bad Gateway");
};
};
if (method == "BYE") {
unforce_rtp_proxy();
};
record_route();
if (loose_route()) {
t_relay();
exit;
};
if (src_port == 5061) {
rewriteport("5062");
} else {
rewriteport("5061");
};
t_relay();
// rtpproxy_stream2uac("ringback", "10");
exit;
}
onreply_route[1]
{
if (status=~"(180)|(183)|2[0-9][0-9]") {
if(!search("^Content-Length:[ ]*0")) {
rtpproxy_answer("r");
// rtpproxy_stream2uas("ringback", "10");
};
};
}
failure_route[1]
{
unforce_rtp_proxy();
}