Skip to content

Commit

Permalink
Merge pull request #75 from 2600hz/registrar-port-4.2
Browse files Browse the repository at this point in the history
support single port for registrar success messages - 4.2
  • Loading branch information
k-anderson authored Jun 1, 2018
2 parents baeedd4 + ea11537 commit 23d0c8b
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
8 changes: 8 additions & 0 deletions kamailio/defs.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,12 @@
#!define KZ_PRESENCE_REQUEST_PROBE 1
#!endif

#!ifndef KZ_DISABLE_WEBSOCKETS_REGISTRAR_PORT
#!trydef KZ_WEBSOCKETS_REGISTRAR_PORT 7000
#!endif

#!ifndef KZ_DISABLE_TLS_REGISTRAR_PORT
#!trydef KZ_TLS_REGISTRAR_PORT 7000
#!endif

# vim: tabstop=4 softtabstop=4 shiftwidth=4 expandtab
24 changes: 24 additions & 0 deletions kamailio/local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,30 @@
## destination. This reduces performance.
mhomed=0

################################################################################
## 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_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 7000
##!define KZ_TCP_REGISTRAR_PORT 7000


## YOU SHOULD NOT HAVE TO CHANGE THESE!
## By setting MY_IP_ADDRESS above these will resolve
## to the proper bindings. These are here
Expand Down
32 changes: 31 additions & 1 deletion kamailio/registrar-role.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,37 @@ route[SAVE_LOCATION]
$var(ip) = "[" + $Ri + "]";
}

$var(port) = $Rp;
# 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) {
Expand Down

0 comments on commit 23d0c8b

Please sign in to comment.