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 db2be68 commit b8892c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sippy/b2bua_radius.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import sys
from functools import partial
from os.path import dirname, join as p_join
sys.path.append(p_join(dirname(sys.argv[0]), '..'))

Expand Down Expand Up @@ -151,7 +152,7 @@ def __init__(self, remote_ip, source, req_source, req_target, global_config, pas
if '_allowed_pts' in self.global_config:
self.uaA.on_remote_sdp_change = self.filter_SDP

def filter_SDP(self, body, done_cb):
def filter_SDP(self, body, done_cb, prev_orc = None):
try:
body.parse()
except Exception as ex:
Expand All @@ -171,6 +172,8 @@ def filter_SDP(self, body, done_cb):
raise SdpParseError()
if old_len > len(mbody.formats):
sect.optimize_a()
if prev_orc is not None:
return prev_orc(body, done_cb)
return body

def recvEvent(self, event, ua):
Expand Down Expand Up @@ -345,6 +348,9 @@ def placeOriginate(self, oroute):
if body is not None:
body = body.getCopy()
self.proxied = True
if '_allowed_pts' in self.global_config:
prev_orc = self.uaO.on_remote_sdp_change
self.uaO.on_remote_sdp_change = partial(self.filter_SDP, prev_orc=prev_orc)
self.uaO.kaInterval = self.global_config['keepalive_orig']
if 'group_timeout' in oroute.params:
timeout, skipto = oroute.params['group_timeout']
Expand Down

0 comments on commit b8892c7

Please sign in to comment.