Browse Source

handle registration port redirect per protocol

drop_requests
Luis Azedo 8 years ago
parent
commit
14cc3b696f
3 changed files with 50 additions and 25 deletions
  1. +5
    -5
      kamailio/defs.cfg
  2. +14
    -15
      kamailio/local.cfg
  3. +31
    -5
      kamailio/registrar-role.cfg

+ 5
- 5
kamailio/defs.cfg View File

@ -118,12 +118,12 @@
#!endif
#!endif
#!trydef KZ_MULTI_HOMED 0
#!ifndef KZ_DISABLE_REGISTRAR_PORT
#!trydef KZ_REGISTRAR_PORT 7000
#!ifndef KZ_DISABLE_WEBSOCKETS_REGISTRAR_PORT
#!trydef KZ_WEBSOCKETS_REGISTRAR_PORT 7000
#!endif
mhomed=KZ_MULTI_HOMED
#!ifndef KZ_DISABLE_TLS_REGISTRAR_PORT
#!trydef KZ_TLS_REGISTRAR_PORT 7000
#!endif
# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab

+ 14
- 15
kamailio/local.cfg View File

@ -71,31 +71,30 @@
## E.g.: Add MTU=1472 to the /etc/sysconfig/network-scripts/XXX
# udp4_raw_mtu = 1472
################################################################################
## KZ_MULTI_HOMED
################################################################################
## This parameter is OPTIONAL.
## It will try to locate outbound interface
## on multihomed host. By default forward
## requests use the incoming socket disregarding
## the destination location. When enabled Kamailio
## will select a socket that can reach the
## destination and enables config less webrtc/tls on freeswitch.
## This reduces performance.
###!define KZ_MULTI_HOMED 1
################################################################################
## KZ_DISABLE_REGISTRAR_PORT
## KZ_DISABLE_REGISTRAR_PORTS
################################################################################
## This parameter is OPTIONAL.
## It will disable publishing single proxy port on registrar success messages
## By default single port proxy is send on registrar success messages
## for websockets/tls protocols. the default port is 7000
## which enables config less in freeswitch for handling webrtc/tls
## ie, no certs in freeswitch, no webrtc/tls listeners on freeswitch
## by disabling single port proxy, ecallmgr needs to be started with
## 'use_transport_for_fs_path' set to true in its environment configuration
##
###!define KZ_DISABLE_REGISTRAR_PORT 1
##
###!define KZ_DISABLE_WEBSOCKETS_REGISTRAR_PORT 1
###!define KZ_DISABLE_TLS_REGISTRAR_PORT 1
##
## you can also change the ports used for single port redirect
##!define KZ_WEBSOCKETS_REGISTRAR_PORT 5060
##!define KZ_TLS_REGISTRAR_PORT 5060
##
## also available for udp/tcp if it works for you
##!define KZ_UDP_REGISTRAR_PORT 8000
##!define KZ_UDP_REGISTRAR_PORT 8000
################################################################################
## SIP traffic mirroring to SIP_TRACE server


+ 31
- 5
kamailio/registrar-role.cfg View File

@ -291,11 +291,37 @@ route[SAVE_LOCATION]
$var(ip) = "[" + $Ri + "]";
}
#!ifndef KZ_DISABLE_REGISTRAR_PORT
$var(port) = KZ_REGISTRAR_PORT;
#!else
$var(port) = $Rp;
#!endif
# allow port redirection on registration
switch($proto)
{
#!ifdef KZ_WEBSOCKETS_REGISTRAR_PORT
case "ws":
case "wss":
$var(port) = KZ_WEBSOCKETS_REGISTRAR_PORT;
break;
#!endif
#!ifdef KZ_TLS_REGISTRAR_PORT
case "tls":
$var(port) = KZ_TLS_REGISTRAR_PORT;
break;
#!endif
#!ifdef KZ_UDP_REGISTRAR_PORT
case "udp":
$var(port) = KZ_UDP_REGISTRAR_PORT;
break;
#!endif
#!ifdef KZ_TCP_REGISTRAR_PORT
case "tcp":
$var(port) = KZ_UDP_REGISTRAR_PORT;
break;
#!endif
default:
$var(port) = $Rp;
}
$var(AdvIP) = $RAi;
if(af==INET6) {


Loading…
Cancel
Save