Browse Source

Avoid a crash when the answer to the "Status" query doesn't contain what is expected.

Patch courtesy of Marcel van der Boom (HS-Development BV).
pull/7/head
Alexis de Lattre 12 years ago
parent
commit
992c1af600
  1. 2
      asterisk_click2dial/asterisk_click2dial.py

2
asterisk_click2dial/asterisk_click2dial.py

@ -299,7 +299,7 @@ class asterisk_server(osv.osv):
_logger.debug("Found a matching Event in 'Ring' state")
calling_party_number = chan.get('CallerIDNum')
break
if chan.get('ChannelState') == '6' and sip_account in chan.get('BridgedChannel'): # 6 = Up
if chan.get('ChannelState') == '6' and sip_account in chan.get('BridgedChannel', ''): # 6 = Up
_logger.debug("Found a matching Event in 'Up' state")
calling_party_number = chan.get('CallerIDNum')
break

Loading…
Cancel
Save