Skip to content

Commit

Permalink
Allow '--accept_ips=WSS' to allow any call coming via WSS socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 22, 2024
1 parent 0d7e1c4 commit 4d23c85
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sippy/b2bua_radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,11 @@ def recvRequest(self, req, sip_t):

# First check if request comes from IP that
# we want to accept our traffic from
if '_accept_ips' in self.global_config and \
not source[0] in self.global_config['_accept_ips']:
resp = req.genResponse(403, 'Forbidden')
return (resp, None, None)
if (aips:=self.global_config.get('_accept_ips', None)) is not None:
req_source = source[0] if via.transport != 'WSS' else 'WSS'
if not req_source in aips:
resp = req.genResponse(403, 'Forbidden')
return (resp, None, None)

challenge = None
if self.global_config['auth_enable']:
Expand Down

0 comments on commit 4d23c85

Please sign in to comment.