[Asterisk-code-review] Get sip bye also test passing with Asterisk 11. (testsuite[master])
Mark Michelson
asteriskteam at digium.com
Thu Feb 18 15:11:37 CST 2016
Mark Michelson has uploaded a new change for review.
https://gerrit.asterisk.org/2278
Change subject: Get sip_bye_also test passing with Asterisk 11.
......................................................................
Get sip_bye_also test passing with Asterisk 11.
The test was recently altered to use the HangupMonitor to stop the test
when all channels had hung up. The problem is that in Asterisk 11, blind
transfers are done using channel masquerades. This causes problems
because <ZOMBIE> channels get hung up, and the HangupMonitor has no
record of those channels existing.
The fix is to have the HangupMonitor listen for Rename AMI events. This
way, we can tell when a channel has been renamed to be a zombie variant.
With this change, the test passes.
Change-Id: I1af60d6a0461d974a4269ca3782dd5b85ae619cb
---
M lib/python/asterisk/pluggable_modules.py
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/78/2278/1
diff --git a/lib/python/asterisk/pluggable_modules.py b/lib/python/asterisk/pluggable_modules.py
index d1265c2..65105e3 100755
--- a/lib/python/asterisk/pluggable_modules.py
+++ b/lib/python/asterisk/pluggable_modules.py
@@ -299,6 +299,7 @@
"""AMI connect handler"""
if str(ami.id) in self.config["ids"]:
ami.registerEvent('Newchannel', self.__new_channel_handler)
+ ami.registerEvent('Rename', self.__rename_handler)
ami.registerEvent('Hangup', self.__hangup_handler)
def __new_channel_handler(self, ami, event):
@@ -320,6 +321,12 @@
self.stop_test()
return (ami, event)
+ def __rename_handler(self, ami, event):
+ LOGGER.debug("Channel {0} renamed to {1}".format(event['channel'],
+ event['newname']))
+ self.channels.append(event['newname'])
+ self.channels.remove(event['channel'])
+
def stop_test(self):
"""Allow subclasses to take different actions to stop the test."""
self.test_object.stop_reactor()
--
To view, visit https://gerrit.asterisk.org/2278
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1af60d6a0461d974a4269ca3782dd5b85ae619cb
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-code-review
mailing list