From 311f995fdf509f5f256dff60ef643ebe4c5c061f Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 5 Jan 2017 16:19:36 +0100 Subject: [PATCH] rtpproxy: small updates to the examples --- src/modules/rtpproxy/examples/4to6.cfg | 37 +++++++++++++------------- src/modules/rtpproxy/examples/alg.cfg | 36 +++++++++++-------------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/modules/rtpproxy/examples/4to6.cfg b/src/modules/rtpproxy/examples/4to6.cfg index 8519a55af51..678b96d9100 100644 --- a/src/modules/rtpproxy/examples/4to6.cfg +++ b/src/modules/rtpproxy/examples/4to6.cfg @@ -1,8 +1,7 @@ -# $Id$ # # Simple application level gateway config script. # -# Assumes that SER/rtpproxy run on a machine, which connected to +# Assumes that Kamailiortpproxy run on a machine, which connected to # both IPv4 and IPv6 networks. # # Correspondingly, this machine has two IP addresses: one IPv4 @@ -14,19 +13,19 @@ # 2002:1234:5678::1 - "external" IPv6 address # # rtpproxy started with `-l 192.168.0.1 -6 /2002:1234:5678::1' option. -# ser started with `-l 192.168.0.1 -l [2002:1234:5678::1] option. +# kamailio started with `-l 192.168.0.1 -l [2002:1234:5678::1] option. # # ------------------ module loading ---------------------------------- -loadmodule "/usr/local/lib/ser/modules/sl.so" -loadmodule "/usr/local/lib/ser/modules/tm.so" -loadmodule "/usr/local/lib/ser/modules/rr.so" -loadmodule "/usr/local/lib/ser/modules/maxfwd.so" -loadmodule "/usr/local/lib/ser/modules/usrloc.so" -loadmodule "/usr/local/lib/ser/modules/registrar.so" -loadmodule "/usr/local/lib/ser/modules/nathelper.so" -loadmodule "/usr/local/lib/ser/modules/rtpproxy.so" +loadmodule "/usr/local/lib/kamailio/modules/sl.so" +loadmodule "/usr/local/lib/kamailio/modules/tm.so" +loadmodule "/usr/local/lib/kamailio/modules/rr.so" +loadmodule "/usr/local/lib/kamailio/modules/maxfwd.so" +loadmodule "/usr/local/lib/kamailio/modules/usrloc.so" +loadmodule "/usr/local/lib/kamailio/modules/registrar.so" +loadmodule "/usr/local/lib/kamailio/modules/nathelper.so" +loadmodule "/usr/local/lib/kamailio/modules/rtpproxy.so" # ----------------- setting module-specific parameters --------------- @@ -36,7 +35,7 @@ modparam("nathelper", "natping_interval", 15) # ------------------ main fun below ---------------------------------- -route { +request_route { # initial sanity checks -- messages with # max_forwars == 0, or excessively long requests, # or those that don't addressed to us @@ -71,20 +70,20 @@ route { # between UAs if (af == inet) if (rtpproxy_offer("FAII")) - t_on_reply("1"); + t_on_reply("MNGRPL"); if (af == inet6) if (rtpproxy_offer("FAEI")) - t_on_reply("1"); + t_on_reply("MNGRPL"); } else if (lookup("location-inet6")) { if (af == inet) if (rtpproxy_offer("FAIE")) - t_on_reply("1"); + t_on_reply("MNGRPL"); # Comment out three lines below if you want # RTP for IPv6->IPv6 calls to go directly # between UAs if (af == inet6) if (rtpproxy_offer("FAEE")) - t_on_reply("1"); + t_on_reply("MNGRPL"); } else { sl_send_reply("403", "Call cannot be served here"); break; @@ -103,11 +102,11 @@ route { if (method == "INVITE") record_route(); - if (!t_relay()) - sl_reply_error(); + if (!t_relay()) + sl_reply_error(); } -onreply_route[1] { +onreply_route[MNGRPL] { if (!(status=~"183" || status=~"200")) break; rtpproxy_answer("FA"); diff --git a/src/modules/rtpproxy/examples/alg.cfg b/src/modules/rtpproxy/examples/alg.cfg index 19e875efaf8..21d4639107d 100644 --- a/src/modules/rtpproxy/examples/alg.cfg +++ b/src/modules/rtpproxy/examples/alg.cfg @@ -1,8 +1,7 @@ -# $Id$ # # Simple application level gateway config script. # -# Assumes that SER/rtpproxy run on a machine, which connected to +# Assumes that Kamailio and rtpproxy run on a machine, which connected to # two non-routable letworks: 192.168.0.0/24 and 192.168.1.1/24. # # Correspondingly, this machine has two IP addresses: 192.168.0.1 @@ -16,24 +15,23 @@ # ------------------ module loading ---------------------------------- -loadmodule "/usr/local/lib/ser/modules/sl.so" -loadmodule "/usr/local/lib/ser/modules/tm.so" -loadmodule "/usr/local/lib/ser/modules/rr.so" -loadmodule "/usr/local/lib/ser/modules/maxfwd.so" -loadmodule "/usr/local/lib/ser/modules/usrloc.so" -loadmodule "/usr/local/lib/ser/modules/registrar.so" -loadmodule "/usr/local/lib/ser/modules/nathelper.so" -loadmodule "/usr/local/lib/ser/modules/rtpproxy.so" +loadmodule "/usr/local/lib/kamailio/modules/sl.so" +loadmodule "/usr/local/lib/kamailio/modules/tm.so" +loadmodule "/usr/local/lib/kamailio/modules/rr.so" +loadmodule "/usr/local/lib/kamailio/modules/maxfwd.so" +loadmodule "/usr/local/lib/kamailio/modules/usrloc.so" +loadmodule "/usr/local/lib/kamailio/modules/registrar.so" +loadmodule "/usr/local/lib/kamailio/modules/nathelper.so" +loadmodule "/usr/local/lib/kamailio/modules/rtpproxy.so" # ----------------- setting module-specific parameters --------------- # -- nathelper params -- - modparam("nathelper", "natping_interval", 15) # ------------------ main fun below ---------------------------------- -route { +request_route { # initial sanity checks -- messages with # max_forwars == 0, or excessively long requests, # or those that don't addressed to us @@ -41,10 +39,6 @@ route { sl_send_reply("483", "Too Many Hops"); break; }; - if (msg:len > max_len) { - sl_send_reply("513", "Message too big"); - break; - }; if (!(uri == myself) && method == "INVITE") { sl_send_reply("403", "Call cannot be served here"); break; @@ -65,17 +59,17 @@ route { if (lookup("location-internal")) { if (dst_ip == 192.168.0.1) if (rtpproxy_offer("FAII")) - t_on_reply("1"); + t_on_reply("MNGRPL"); if (dst_ip == 192.168.1.1) if (rtpproxy_offer("FAEI")) - t_on_reply("1"); + t_on_reply("MNGRPL"); } else if (lookup("location-external")) { if (dst_ip == 192.168.0.1) if (rtpproxy_offer("FAIE")) - t_on_reply("1"); + t_on_reply("MNGRPL"); if (dst_ip == 192.168.1.1) if (rtpproxy_offer("FAEE")) - t_on_reply("1"); + t_on_reply("MNGRPL"); } else { sl_send_reply("403", "Call cannot be served here"); break; @@ -98,7 +92,7 @@ route { sl_reply_error(); } -onreply_route[1] { +onreply_route[MNGRPL] { if (!(status=~"183" || status=~"200")) break; rtpproxy_answer("FA");