Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Jul 28, 2024
1 parent a710fee commit 30d9409
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions sippy/b2bua_radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,11 @@ def __init__(self, remote_ip, source, req_source, req_target, global_config, pas
def filter_SDP(self, body, done_cb):
try:
body.parse()
except SdpParseError as ex:
done_cb(None, ex=ex)
return
except Exception as ex:
exx = SdpParseError(f'{ex}')
exx.msg = 'Malformed SDP body'
exx.code = 400
exx.__cause__ = ex
done_cb(None, ex=exx)
return
raise exx from ex
allowed_pts = self.global_config['_allowed_pts']
for sect in body.content.sections:
mbody = sect.m_header
Expand All @@ -173,12 +168,10 @@ def filter_SDP(self, body, done_cb):
_allowed_pts = [x if isinstance(x, int) else sect.getPTbyName(x) for x in allowed_pts]
mbody.formats = [x for x in mbody.formats if x in _allowed_pts]
if len(mbody.formats) == 0:
ex = SdpParseError()
done_cb(None, ex=ex)
return
raise SdpParseError()
if old_len > len(mbody.formats):
sect.optimize_a()
done_cb(body)
return body

def recvEvent(self, event, ua):
print(f'CallController.recvEvent: {event=}, {ua=}, {self.state=}')
Expand Down

0 comments on commit 30d9409

Please sign in to comment.