Skip to content

Commit

Permalink
Add outbound proxy to phone configuration (#284)
Browse files Browse the repository at this point in the history
* Add proxy to yealink template

* don't enable proxy if variable is set and empty

* Add proxy to Sangoma template

* Add backup proxy to Sangoma template

* Add proxy to nethphone template

* Add proxy to Fanvil templates

* Add proxy to Akuvox templates

* Add proxy variables to documentation

* Add proxy to Gigaset Maxwell template

* Choose default proxy port keeping in account encryption configuration
  • Loading branch information
Stell0 authored Nov 24, 2023
1 parent 290572c commit 86ee608
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 42 deletions.
10 changes: 5 additions & 5 deletions data/templates/akuvox.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ Config.Account{{ line }}.SIP.TransType = {{ _context['account_encryption_' ~ lin
Config.Account{{ line }}.SIP.ListenPortMin = 5062
Config.Account{{ line }}.SIP.ListenPortMax = 5062

Config.Account{{ line }}.OUTPROXY.Enable = 0
Config.Account{{ line }}.OUTPROXY.Server =
Config.Account{{ line }}.OUTPROXY.Port = 5060
Config.Account{{ line }}.OUTPROXY.BakServer =
Config.Account{{ line }}.OUTPROXY.BakPort = 5060
Config.Account{{ line }}.OUTPROXY.Enable = {{ _context['outbound_proxy_' ~ line] is defined and _context['outbound_proxy_' ~ line] != '' ? '1' : '0' }}
Config.Account{{ line }}.OUTPROXY.Server = {{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.Port = {{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.BakServer = {{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.BakPort = {{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.DHCPOption = 0

Config.Account{{ line }}.STUN.Enable = 0
Expand Down
10 changes: 5 additions & 5 deletions data/templates/akuvox410w.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ Config.Account{{ line }}.SIP.TransType = {{ _context['account_encryption_' ~ lin
Config.Account{{ line }}.SIP.ListenPortMin = 1024
Config.Account{{ line }}.SIP.ListenPortMax = 65535

Config.Account{{ line }}.OUTPROXY.Enable = 0
Config.Account{{ line }}.OUTPROXY.Server =
Config.Account{{ line }}.OUTPROXY.Port = 5060
Config.Account{{ line }}.OUTPROXY.BakServer =
Config.Account{{ line }}.OUTPROXY.BakPort = 5060
Config.Account{{ line }}.OUTPROXY.Enable = {{ _context['outbound_proxy_' ~ line] is defined and _context['outbound_proxy_' ~ line] != '' ? '1' : '0' }}
Config.Account{{ line }}.OUTPROXY.Server = {{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.Port = {{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.BakServer = {{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.BakPort = {{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.DHCPOption = 0

Config.Account{{ line }}.STUN.Enable = 0
Expand Down
10 changes: 5 additions & 5 deletions data/templates/akuvox480w.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ Config.Account{{ line }}.SIP.TransType = {{ _context['account_encryption_' ~ lin
Config.Account{{ line }}.SIP.ListenPortMin = 1024
Config.Account{{ line }}.SIP.ListenPortMax = 65535

Config.Account{{ line }}.OUTPROXY.Enable = 0
Config.Account{{ line }}.OUTPROXY.Server =
Config.Account{{ line }}.OUTPROXY.Port = 5060
Config.Account{{ line }}.OUTPROXY.BakServer =
Config.Account{{ line }}.OUTPROXY.BakPort = 5060
Config.Account{{ line }}.OUTPROXY.Enable = {{ _context['outbound_proxy_' ~ line] is defined and _context['outbound_proxy_' ~ line] != '' ? '1' : '0' }}
Config.Account{{ line }}.OUTPROXY.Server = {{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.Port = {{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.BakServer = {{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
Config.Account{{ line }}.OUTPROXY.BakPort = {{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
Config.Account{{ line }}.OUTPROXY.DHCPOption = 0

Config.Account{{ line }}.STUN.Enable = 0
Expand Down
10 changes: 5 additions & 5 deletions data/templates/fanvil-V67.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ SIP{{ line }} Backup Port :
SIP{{ line }} Backup Transport :0
SIP{{ line }} Backup TTL :3600
SIP{{ line }} Enable Reg :1
SIP{{ line }} Proxy Addr :
SIP{{ line }} Proxy Port :
SIP{{ line }} Proxy Addr :{{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
SIP{{ line }} Proxy Port :{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Proxy User :
SIP{{ line }} Proxy Pswd :
SIP{{ line }} BakProxy Addr :
SIP{{ line }} BakProxy Port :
SIP{{ line }} Enable Failback :0
SIP{{ line }} BakProxy Addr :{{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
SIP{{ line }} BakProxy Port :{{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Enable Failback :{{ _context['outbound_proxy2_' ~ line] is defined and _context['outbound_proxy2_' ~ line] != '' ? '1' : '0' }}
SIP{{ line }} Failback Interval :1800
SIP{{ line }} Signal Failback :0
SIP{{ line }} Signal Retry Counts:3
Expand Down
10 changes: 5 additions & 5 deletions data/templates/fanvil-X3.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ SIP{{ line }} Backup Transpo:0
SIP{{ line }} Backup TTL :3600
SIP{{ line }} Backup Mode :0
SIP{{ line }} Enable Reg :1
SIP{{ line }} Proxy Addr :
SIP{{ line }} Proxy Port :
SIP{{ line }} Proxy Addr :{{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
SIP{{ line }} Proxy Port :{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Proxy User :
SIP{{ line }} Proxy Pswd :
SIP{{ line }} BakProxy Addr :
SIP{{ line }} BakProxy Port :
SIP{{ line }} Enable Failbac:0
SIP{{ line }} BakProxy Addr :{{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
SIP{{ line }} BakProxy Port :{{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Enable Failbac:{{ _context['outbound_proxy2_' ~ line] is defined and _context['outbound_proxy2_' ~ line] != '' ? '1' : '0' }}
SIP{{ line }} Failback Hold :1
SIP{{ line }} Failback Inter:1800
SIP{{ line }} Signal Failbac:0
Expand Down
10 changes: 5 additions & 5 deletions data/templates/fanvil-X5.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ SIP{{ line }} Backup Port :
SIP{{ line }} Backup Transport :0
SIP{{ line }} Backup TTL :3600
SIP{{ line }} Enable Reg :1
SIP{{ line }} Proxy Addr :
SIP{{ line }} Proxy Port :
SIP{{ line }} Proxy Addr :{{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
SIP{{ line }} Proxy Port :{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Proxy User :
SIP{{ line }} Proxy Pswd :
SIP{{ line }} BakProxy Addr :
SIP{{ line }} BakProxy Port :
SIP{{ line }} Enable Failback :0
SIP{{ line }} BakProxy Addr :{{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
SIP{{ line }} BakProxy Port :{{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Enable Failback :{{ _context['outbound_proxy2_' ~ line] is defined and _context['outbound_proxy2_' ~ line] != '' ? '1' : '0' }}
SIP{{ line }} Failback Interval :1800
SIP{{ line }} Signal Failback :0
SIP{{ line }} Signal Retry Counts:3
Expand Down
8 changes: 8 additions & 0 deletions data/templates/gigaset-Maxwell.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,16 @@
<param name="SIP.Account.{{ idx }}.DisplayName" value="{{ _context['account_display_name_' ~ line] }}" />
<param name="SIP.Account.{{ idx }}.Username" value="{{ _context['account_username_' ~ line] }}" />
<param name="SIP.Account.{{ idx }}.Domain" value="{{ hostname }}" />
{% if _context['outbound_proxy_' ~ line] is defined and _context['outbound_proxy_' ~ line] != '' %}
<param name="SIP.Account.{{ idx }}.ProxyServer.Address" value="{{ _context['outbound_proxy_' ~ line] }}" />
<param name="SIP.Account.{{ idx }}.ProxyServer.Port" value="{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}" />
<param name="SIP.Account.{{ idx }}.OutboundProxy.Mode" value="1"/>
<param name="SIP.Account.{{ idx }}.OutboundProxy.Address" value="{{ _context['outbound_proxy_' ~ line] }}"/>
<param name="SIP.Account.{{ idx }}.OutboundProxy.Port" value="{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}"/>
{% else %}
<param name="SIP.Account.{{ idx }}.ProxyServer.Address" value="{{ hostname }}" />
<param name="SIP.Account.{{ idx }}.ProxyServer.Port" value="{{ _context['account_encryption_' ~ line] ? sip_tls_port : sip_udp_port }}" />
{% endif %}
<param name="SIP.Account.{{ idx }}.RegistrationServer.Address" value="{{ hostname }}" />
<param name="SIP.Account.{{ idx }}.RegistrationServer.Port" value="{{ _context['account_encryption_' ~ line] ? sip_tls_port : sip_udp_port }}" />
<param name="SIP.Account.{{ idx }}.DTMFTransmission" value="{{ gigaset.dtmf_map(_context['account_dtmf_type_' ~ line]) }}" />
Expand Down
10 changes: 5 additions & 5 deletions data/templates/nethesis.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ SIP{{ line }} Backup Port :
SIP{{ line }} Backup Transport :0
SIP{{ line }} Backup TTL :3600
SIP{{ line }} Enable Reg :1
SIP{{ line }} Proxy Addr :
SIP{{ line }} Proxy Port :
SIP{{ line }} Proxy Addr :{{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
SIP{{ line }} Proxy Port :{{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Proxy User :
SIP{{ line }} Proxy Pswd :
SIP{{ line }} BakProxy Addr :
SIP{{ line }} BakProxy Port :
SIP{{ line }} Enable Failback :0
SIP{{ line }} BakProxy Addr :{{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
SIP{{ line }} BakProxy Port :{{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
SIP{{ line }} Enable Failback :{{ _context['outbound_proxy2_' ~ line] is defined and _context['outbound_proxy2_' ~ line] != '' ? '1' : '0' }}
SIP{{ line }} Failback Interval :1800
SIP{{ line }} Signal Failback :0
SIP{{ line }} Signal Retry Counts:3
Expand Down
8 changes: 8 additions & 0 deletions data/templates/sangoma.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,16 @@
<P967 para="Account1.FailoverSipserver" />
<P8851 para="Account1.SecondFailoverSipserver" />
<P4567 para="Account1.PreferPrimaryServer">1</P4567>
{% if outbound_proxy_1 is defined and outbound_proxy_1 != '' %}
<P48 para="Account1.OutboundProxy">{{ outbound_proxy_1 }}:{{ outbound_proxy_port_1 is defined and outbound_proxy_port_1 != '' ? outbound_proxy_port_1 : account_encryption_1 ? '5061' : '5060' }}</P48>
{% else %}
<P48 para="Account1.OutboundProxy" />
{% endif %}
{% if outbound_proxy_1 is defined and outbound_proxy_1 != '' and outbound_proxy2_1 is defined and outbound_proxy2_1 != '' %}
<P20047 para="Account1.BackUpOutboundProxy">{{ outbound_proxy2_1 }}:{{ outbound_proxy2_port_1 is defined and outbound_proxy2_port_1 != '' ? outbound_proxy2_port_1 : account_encryption_1 ? '5061' : '5060' }}</P20047>
{% else %}
<P20047 para="Account1.BackUpOutboundProxy" />
{% endif %}
<P130 para="Account1.SipTransport">{{ account_encryption_1 ? '2' : '0' }}</P130>
<P52 para="Account1.NatTraversal">2</P52>
<P20000 para="Account1.Lable">{{ account_display_name_1 }}</P20000>
Expand Down
14 changes: 7 additions & 7 deletions data/templates/yealink.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1831,11 +1831,11 @@ account.{{ line }}.sip_server.1.transport_type = {{ _context['account_encryption
account.{{ line }}.sip_server.1.expires = 3600
account.{{ line }}.sip_server.1.retry_counts = 3

account.{{ line }}.outbound_proxy_enable = 0
account.{{ line }}.outbound_proxy.1.address =
account.{{ line }}.outbound_proxy.1.port = 5060
account.{{ line }}.outbound_proxy.2.address =
account.{{ line }}.outbound_proxy.2.port = 5060
account.{{ line }}.outbound_proxy_enable = {{ _context['outbound_proxy_' ~ line] is defined and _context['outbound_proxy_' ~ line] != '' ? '1' : '0' }}
account.{{ line }}.outbound_proxy.1.address = {{ _context['outbound_proxy_' ~ line] is defined ? _context['outbound_proxy_' ~ line] : '' }}
account.{{ line }}.outbound_proxy.1.port = {{ _context['outbound_proxy_port_' ~ line] is defined ? _context['outbound_proxy_port_' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
account.{{ line }}.outbound_proxy.2.address = {{ _context['outbound_proxy2_' ~ line] is defined ? _context['outbound_proxy2_' ~ line] : '' }}
account.{{ line }}.outbound_proxy.2.port = {{ _context['outbound_proxy2_port_' ~ line] is defined ? _context['outbound_proxy2_port' ~ line] : _context['account_encryption_' ~ line] ? '5061' : '5060' }}
account.{{ line }}.outbound_proxy_fallback_interval = 3600
account.{{ line }}.nat.nat_traversal = 0

Expand Down Expand Up @@ -1921,8 +1921,8 @@ account.{{ line }}.reg_failed_retry_min_time = 0
account.{{ line }}.redundancy_with_reg_fail.enable = 0

##V83 Add
account.{{ line }}.sip_server.1.outbound_proxy_enable = 0
account.{{ line }}.sip_server.2.outbound_proxy_enable = 0
account.{{ line }}.sip_server.1.outbound_proxy_enable = {{ _context['outbound_proxy_' ~ line] is defined ? '1' : '0' }}
account.{{ line }}.sip_server.2.outbound_proxy_enable = {{ _context['outbound_proxy2_' ~ line] is defined ? '1' : '0' }}

################################################################
# SIP Basic config ##
Expand Down
4 changes: 4 additions & 0 deletions docs/_data/variables.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ rw dss_transfer Call transfer mode. string one of `verify`,`attended`,`blind`
ro cap_dss_transfer_blacklist Comma separate list of [dss_transfer](#dss_transfer) modes that are not supported by the phone. string
rw adminpw Phone and web UI admin password. string
rw userpw Phone and web UI user password. string
rw outbound_proxy_$line string Outbound proxy IP/host name
rw outbound_proxy_port_$line integer Outbound proxy port
rw outbound_proxy2_$line string Backup outbound proxy IP/host name
rw outbound_proxy2_port_$line integer Backup outbound proxy port
ro provisioning_complete The provisioning is considered complete when the phone uses `tok2` for authentication. The temporary `tok1` token is invalidated. boolean
rw provisioning_url_scheme URI scheme to fetch the provisioning resources. string one of `http`, `https`
rw provisioning_url_path Basic URI path component, that is prefixed to the security token and file name components, e.g. `/provisioning/`. string
Expand Down

0 comments on commit 86ee608

Please sign in to comment.