Browse Source

use missed opportunity to detect number

add 'ringing' state number detection on new asterisks versions
pull/49/head
Igor 10 years ago
parent
commit
2beb333dc9
  1. 7
      asterisk_click2dial/asterisk_click2dial.py

7
asterisk_click2dial/asterisk_click2dial.py

@ -253,6 +253,13 @@ class asterisk_server(orm.Model):
_logger.debug("Found a matching Event in 'Ring' state") _logger.debug("Found a matching Event in 'Ring' state")
calling_party_number = chan.get('CallerIDNum') calling_party_number = chan.get('CallerIDNum')
break break
# Compatibility with Asterisk 1.4
if (
chan.get('State') == 'Ringing' and
chan.get('ConnectedLineNum') == user.internal_number):
_logger.debug("Found a matching Event in 'Ring' state")
calling_party_number = chan.get('CallerIDNum')
break
# 6 = Up # 6 = Up
if ( if (
chan.get('ChannelState') == '6' chan.get('ChannelState') == '6'

Loading…
Cancel
Save