2
0
Эх сурвалжийг харах

kamailio.cfg: option to use rtpengine for nat traversal

- define WITH_NAT
- define WITH_RTPENGINE
Daniel-Constantin Mierla 5 жил өмнө
parent
commit
fcf895d274
1 өөрчлөгдсөн 19 нэмэгдсэн , 2 устгасан
  1. 19 2
      etc/kamailio.cfg

+ 19 - 2
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()) {