Browse code

kamailio.cfg: option to use rtpengine for nat traversal

- define WITH_NAT
- define WITH_RTPENGINE

Daniel-Constantin Mierla authored on 29/10/2019 09:22:05
Showing 1 changed files
... ...
@@ -45,10 +45,16 @@
45 45
 #
46 46
 # *** To enable nat traversal execute:
47 47
 #     - define WITH_NAT
48
+#     - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
48 49
 #     - install RTPProxy: http://www.rtpproxy.org
49 50
 #     - start RTPProxy:
50 51
 #        rtpproxy -l _your_public_ip_ -s udp:localhost:7722
51
-#     - option for NAT SIP OPTIONS keepalives: WITH_NATSIPPING
52
+#
53
+# *** To use RTPEngine (instead of RTPProxy) for nat traversal execute:
54
+#     - define WITH_RTPENGINE
55
+#     - install RTPEngine: https://github.com/sipwise/rtpengine
56
+#     - start RTPEngine:
57
+#        rtpengine --listen-ng=127.0.0.1:2223 ...
52 58
 #
53 59
 # *** To enable PSTN gateway routing execute:
54 60
 #     - define WITH_PSTN
... ...
@@ -417,9 +423,13 @@ modparam("presence_xml", "force_active", 1)
417 423
 #!endif
418 424
 
419 425
 #!ifdef WITH_NAT
426
+#!ifdef WITH_RTPENGINE
427
+# ----- rtpengine params -----
428
+modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:2223")
429
+#!else
420 430
 # ----- rtpproxy params -----
421 431
 modparam("rtpproxy", "rtpproxy_sock", "udp:127.0.0.1:7722")
422
-
432
+#!endit
423 433
 # ----- nathelper params -----
424 434
 modparam("nathelper", "natping_interval", 30)
425 435
 modparam("nathelper", "ping_nated_only", 1)
... ...
@@ -809,9 +819,16 @@ route[NATMANAGE] {
809 819
 	if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB))) return;
810 820
 
811 821
 	if(nat_uac_test("8")) {
822
+#!ifdef WITH_RTPENGINE
823
+		rtpengine_manage("replace-origin replace-session-connection");
824
+#!else
812 825
 		rtpproxy_manage("co");
826
+#!endif
813 827
 	} else {
828
+		rtpengine_manage("trust-address replace-origin replace-session-connection");
829
+#!else
814 830
 		rtpproxy_manage("cor");
831
+#!endif
815 832
 	}
816 833
 
817 834
 	if (is_request()) {