From 9592f3ee7c07e52786fd4853ce73ab86ce84b2c1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 7 May 2013 22:40:30 +0200 Subject: [PATCH] Add compatibility with Asterisk 1.4 for the function "Open calling partner" --- asterisk_click2dial/asterisk_click2dial.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asterisk_click2dial/asterisk_click2dial.py b/asterisk_click2dial/asterisk_click2dial.py index ed37590..31696ca 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -303,6 +303,11 @@ class asterisk_server(osv.osv): _logger.debug("Found a matching Event in 'Up' state") calling_party_number = chan.get('CallerIDNum') 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: _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))