From 86a37a1b72c420f6f6b22d7010e4142244b08ea0 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 5 May 2013 18:41:38 +0200 Subject: [PATCH] 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). --- asterisk_click2dial/asterisk_click2dial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asterisk_click2dial/asterisk_click2dial.py b/asterisk_click2dial/asterisk_click2dial.py index 3caa407..6520db5 100644 --- a/asterisk_click2dial/asterisk_click2dial.py +++ b/asterisk_click2dial/asterisk_click2dial.py @@ -286,7 +286,7 @@ class asterisk_server(osv.osv): logger.notifyChannel('click2dial', netsvc.LOG_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.notifyChannel('click2dial', netsvc.LOG_DEBUG, "Found a matching Event in 'Up' state") calling_party_number = chan.get('CallerIDNum') break