Commit cd400f3b authored by okhin's avatar okhin 🚴

Raising the exception for not in a bridge yet on hangup at the correct place

parent a99b6082
Pipeline #797 passed with stage
in 2 seconds
......@@ -286,6 +286,7 @@ class Call(object):
bridge_id = '-'.join(event['channel']['id'].split('-')[:-1])
try:
bridge = ari.Bridge(config['asterisk'], bridge_id, 'mixed')
results = json.loads(bridge.status())
except:
# Not in a bridge yet. Our channel has been destroyed.
# That or we're in moh.
......@@ -295,7 +296,6 @@ class Call(object):
, event['timestamp']))
return
results = json.loads(bridge.status())
if len(results['channels']) == 0:
# We were the last channel standing
phone_logger.info('Deleting bridge {}'.format(bridge_id))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment