Browse Source

Add compatibility with Asterisk 1.4 for the function "Open calling partner"

pull/7/head
Alexis de Lattre 12 years ago
parent
commit
9592f3ee7c
  1. 5
      asterisk_click2dial/asterisk_click2dial.py

5
asterisk_click2dial/asterisk_click2dial.py

@ -303,6 +303,11 @@ class asterisk_server(osv.osv):
_logger.debug("Found a matching Event in 'Up' state") _logger.debug("Found a matching Event in 'Up' state")
calling_party_number = chan.get('CallerIDNum') calling_party_number = chan.get('CallerIDNum')
break break
# Compatibility with Asterisk 1.4
if chan.get('State') == 'Up' and sip_account in chan.get('Link', ''):
_logger.debug("Found a matching Event in 'Up' state")
calling_party_number = chan.get('CallerIDNum')
break
except Exception, e: except Exception, e:
_logger.error("Error in the Status request to Asterisk server %s" % ast_server.ip_address) _logger.error("Error in the Status request to Asterisk server %s" % ast_server.ip_address)
_logger.error("Here is the detail of the error : '%s'" % unicode(e)) _logger.error("Here is the detail of the error : '%s'" % unicode(e))

Loading…
Cancel
Save