Module: kamailio Branch: master Commit: fcf895d274d1793440529525e1db9603cfa19aec URL: https://github.com/kamailio/kamailio/commit/fcf895d274d1793440529525e1db9603...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2019-10-29T10:22:05+01:00
kamailio.cfg: option to use rtpengine for nat traversal
- define WITH_NAT - define WITH_RTPENGINE
---
Modified: etc/kamailio.cfg
---
Diff: https://github.com/kamailio/kamailio/commit/fcf895d274d1793440529525e1db9603... Patch: https://github.com/kamailio/kamailio/commit/fcf895d274d1793440529525e1db9603...
---
diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg index 9047f49fef..21470ce47c 100644 --- a/etc/kamailio.cfg +++ b/etc/kamailio.cfg @@ -45,10 +45,16 @@ # # *** To enable nat traversal execute: # - define WITH_NAT +# - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING # - install RTPProxy: http://www.rtpproxy.org # - start RTPProxy: # rtpproxy -l _your_public_ip_ -s udp:localhost:7722 -# - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING +# +# *** To use RTPEngine (instead of RTPProxy) for nat traversal execute: +# - define WITH_RTPENGINE +# - install RTPEngine: https://github.com/sipwise/rtpengine +# - start RTPEngine: +# rtpengine --listen-ng=127.0.0.1:2223 ... # # *** To enable PSTN gateway routing execute: # - define WITH_PSTN @@ -417,9 +423,13 @@ modparam("presence_xml", "force_active", 1) #!endif
#!ifdef WITH_NAT +#!ifdef WITH_RTPENGINE +# ----- rtpengine params ----- +modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223") +#!else # ----- rtpproxy params ----- modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722") - +#!endit # ----- nathelper params ----- modparam("nathelper", "natping_interval", 30) modparam("nathelper", "ping_nated_only", 1) @@ -809,9 +819,16 @@ route[NATMANAGE] { if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
if(nat_uac_test("8")) { +#!ifdef WITH_RTPENGINE + rtpengine_manage("replace-origin replace-session-connection"); +#!else rtpproxy_manage("co"); +#!endif } else { + rtpengine_manage("trust-address replace-origin replace-session-connection"); +#!else rtpproxy_manage("cor"); +#!endif }
if (is_request()) {