From 0989b6b2030e91bf9a586f47616b5bebb80299bf Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 4 Oct 2017 15:59:17 +0200 Subject: [PATCH] net/siproxd: fixed bugs requested by @NicholasRush (#308) --- net/siproxd/Makefile | 2 +- .../OPNsense/Siproxd/forms/general.xml | 42 +++++++++++-------- .../app/models/OPNsense/Siproxd/General.xml | 4 ++ .../templates/OPNsense/Siproxd/siproxd.conf | 22 ++++++---- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/net/siproxd/Makefile b/net/siproxd/Makefile index 8f93e88bd..c54982e2d 100644 --- a/net/siproxd/Makefile +++ b/net/siproxd/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= siproxd -PLUGIN_VERSION= 0.1 +PLUGIN_VERSION= 0.2 PLUGIN_COMMENT= Siproxd is a proxy daemon for the SIP protocol PLUGIN_DEPENDS= siproxd PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/forms/general.xml b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/forms/general.xml index b0c537ce3..855274706 100644 --- a/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/forms/general.xml +++ b/net/siproxd/src/opnsense/mvc/app/controllers/OPNsense/Siproxd/forms/general.xml @@ -88,112 +88,118 @@ checkbox De-Jitter outbound packets (defaults to 0). + + general.proxy_auth_enable + + checkbox + Whether or not to enable authentication for clients to Siproxd. If checked please set up clients in the users tab. + general.tcp_timeout text - Time in seconds when an inactive TCP session will be disconnected. + Time in seconds when an inactive TCP session will be disconnected. general.tcp_connect_timeout text - Time in milli seconds siproxd should wait until the connection is established. + Time in milli seconds siproxd should wait until the connection is established. general.tcp_keepalive text - Time in seconds how often siproxd should send an empty Sip-Keep-Alive to hold the connection. + Time in seconds how often siproxd should send an empty Sip-Keep-Alive to hold the connection. general.ua_string text - Siproxd will masquerade the interal UAs to this given string (optional). + Siproxd will masquerade the interal UAs to this given string (optional). general.use_rport dropdown - This setting is only relevant for double nat scenarios, where default port 5060 would be replaced by a NAT device. + This setting is only relevant for double nat scenarios, where default port 5060 would be replaced by a NAT device. general.plugin_defaulttarget_enable checkbox - Enable or disable the defaulttarget plugin. + Enable or disable the defaulttarget plugin. general.plugin_defaulttarget_log checkbox - Enable logging of defaulttarget plugin. + Enable logging of defaulttarget plugin. general.plugin_defaulttarget_target text - Redirect all incoming calls to a given SIP-URI with format sip:internal@ip:port. + Redirect all incoming calls to a given SIP-URI with format sip:internal@ip:port. general.plugin_fix_bogus_via_enable checkbox - Enable or disable the fix_bogus_via plugin. + Enable or disable the fix_bogus_via plugin. general.plugin_fix_bogus_via_networks text - Give here a list of networks to replace the VIA-Header. Default should fit for most situations. + Give here a list of networks to replace the VIA-Header. Default should fit for most situations. general.plugin_fix_DTAG_enable checkbox - Enable or disable the fix_DTAG_networks plugin. + Enable or disable the fix_DTAG_networks plugin. general.plugin_fix_DTAG_networks text - List of networks where to apply the DTAG fix. Default should fit for most situations. + List of networks where to apply the DTAG fix. Default should fit for most situations. general.plugin_fbox_anoncall_enable checkbox - Enable or disable the fix_DTAG_networks plugin. + Enable or disable the fix_DTAG_networks plugin. general.plugin_fbox_anoncall_networks text - List of networks where to apply the FritzBox Anoncall plugin. Default should fit for most situations. + List of networks where to apply the FritzBox Anoncall plugin. Default should fit for most situations. general.plugin_stun_server_enable checkbox - Enable or disable the STUN plugin. + Enable or disable the STUN plugin. general.plugin_stun_server_host text - Here you can set the FQDN of your STUN server. + Here you can set the FQDN of your STUN server. general.plugin_stun_server_port text - Here you can set the port of your STUN server. + Here you can set the port of your STUN server. general.plugin_stun_server_period text - With STUN periond you can set the time in seconds how often to request for IP info from STUN server. + With STUN periond you can set the time in seconds how often to request for IP info from STUN server. diff --git a/net/siproxd/src/opnsense/mvc/app/models/OPNsense/Siproxd/General.xml b/net/siproxd/src/opnsense/mvc/app/models/OPNsense/Siproxd/General.xml index 81c5a657e..57e9849e9 100644 --- a/net/siproxd/src/opnsense/mvc/app/models/OPNsense/Siproxd/General.xml +++ b/net/siproxd/src/opnsense/mvc/app/models/OPNsense/Siproxd/General.xml @@ -84,6 +84,10 @@ 0 N + + 0 + N + 600 Y diff --git a/net/siproxd/src/opnsense/service/templates/OPNsense/Siproxd/siproxd.conf b/net/siproxd/src/opnsense/service/templates/OPNsense/Siproxd/siproxd.conf index 0e8ce56d0..2c904eec1 100644 --- a/net/siproxd/src/opnsense/service/templates/OPNsense/Siproxd/siproxd.conf +++ b/net/siproxd/src/opnsense/service/templates/OPNsense/Siproxd/siproxd.conf @@ -2,10 +2,10 @@ {% from 'OPNsense/Macros/interface.macro' import physical_interface %} {% if helpers.exists('OPNsense.siproxd.general.if_inbound') and OPNsense.siproxd.general.if_inbound != '' %} -if_inbound = {{ physical_interface('OPNsense.siproxd.general.if_inbound') }} +if_inbound = {{ physical_interface(OPNsense.siproxd.general.if_inbound) }} {% endif %} {% if helpers.exists('OPNsense.siproxd.general.if_outbound') and OPNsense.siproxd.general.if_outbound != '' %} -if_outbound = {{ physical_interface('OPNsense.siproxd.general.if_outbound') }} +if_outbound = {{ physical_interface(OPNsense.siproxd.general.if_outbound) }} {% endif %} {% if helpers.exists('OPNsense.siproxd.general.host_outbound') and OPNsense.siproxd.general.host_outbound != '' %} @@ -52,11 +52,19 @@ rtp_dscp = {{ OPNsense.siproxd.general.rtp_dscp }} {% if helpers.exists('OPNsense.siproxd.general.sip_dscp') and OPNsense.siproxd.general.sip_dscp != '' %} sip_dscp = {{ OPNsense.siproxd.general.sip_dscp }} {% endif %} -{% if helpers.exists('OPNsense.siproxd.general.rtp_input_dejitter') and OPNsense.siproxd.general.rtp_input_dejitter != '' %} -rtp_input_dejitter = {{ OPNsense.siproxd.general.rtp_input_dejitter }} +{% if helpers.exists('OPNsense.siproxd.general.rtp_input_dejitter') and OPNsense.siproxd.general.rtp_input_dejitter == '1' %} +rtp_input_dejitter = 1 +{% else %} +rtp_input_dejitter = 0 {% endif %} -{% if helpers.exists('OPNsense.siproxd.general.rtp_output_dejitter') and OPNsense.siproxd.general.rtp_output_dejitter != '' %} -rtp_output_dejitter = {{ OPNsense.siproxd.general.rtp_output_dejitter }} +{% if helpers.exists('OPNsense.siproxd.general.rtp_output_dejitter') and OPNsense.siproxd.general.rtp_output_dejitter == '1' %} +rtp_output_dejitter = 1 +{% else %} +rtp_output_dejitter = 0 +{% endif %} +{% if helpers.exists('OPNsense.siproxd.general.proxy_auth_enable') and OPNsense.siproxd.general.proxy_auth_enable == '1' %} +proxy_auth_realm = Authentication_Realm +proxy_auth_pwfile = /usr/local/etc/siproxd_passwd.cfg {% endif %} {% if helpers.exists('OPNsense.siproxd.general.tcp_timeout') and OPNsense.siproxd.general.tcp_timeout != '' %} tcp_timeout = {{ OPNsense.siproxd.general.tcp_timeout }} @@ -94,7 +102,7 @@ plugindir=/usr/local/lib/siproxd/ {% if helpers.exists('OPNsense.siproxd.general.plugin_defaulttarget_enable') and OPNsense.siproxd.general.plugin_defaulttarget_enable == '1' %} load_plugin=plugin_defaulttarget.la -{% if helpers.exists('OPNsense.siproxd.general.plugin_defaulttarget_log') and OPNsense.siproxd.general.plugin_defaulttarget_log != '' %} +{% if helpers.exists('OPNsense.siproxd.general.plugin_defaulttarget_log') and OPNsense.siproxd.general.plugin_defaulttarget_log == '1' %} plugin_defaulttarget_log = 1 {% endif %} {% if helpers.exists('OPNsense.siproxd.general.plugin_defaulttarget_target') and OPNsense.siproxd.general.plugin_defaulttarget_target != '' %}