From df643b0b26bb22dd77dbf90e8094fd10e7b83af6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 7 May 2013 10:07:56 +0200 Subject: [PATCH] Add compatibility with Asterisk 1.4 for the function "Open calling partner" (untested) --- 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 6520db5..4cd2406 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -290,6 +290,11 @@ class asterisk_server(osv.osv): logger.notifyChannel('click2dial', netsvc.LOG_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.notifyChannel('click2dial', netsvc.LOG_DEBUG, "Found a matching Event in 'Up' state") + calling_party_number = chan.get('CallerIDNum') + break except Exception, e: logger.notifyChannel('click2dial', netsvc.LOG_ERROR, "Error in the Status request to Asterisk server %s" % ast_server.ip_address) logger.notifyChannel('click2dial', netsvc.LOG_ERROR, "Here is the detail of the error : '%s'" % unicode(e))