From caf6cccc5c75c310f0eedbd5b01b5d6751681e0d Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Tue, 7 Jun 2016 20:45:37 -0300 Subject: cel: Ensure only one dial status per channel exists. CEL wrongly assumed that a channel would only have a single dial event on it. This is incorrect. Particularly in a queue each call attempt to a member will result in a dial event, adding a new dial status in CEL without removing the old one. This would cause the container to grow with only one dial status being removed when the channel went away. The other dial status entries would remain leaking memory. This change fixes the memory leak by ensuring that only one dial status will only ever exist for each channel. The behavior during the scenario where multiple events are received has also been improved. For failure cases the first failure will be the dial status. If an answer dial status is received, though, it will take priority and the dial status for the channel will be answer. Memory usage has also been decreased by storing the minimal amount of information and the code has been cleaned up slightly. ASTERISK-25262 #close Change-Id: I5944eb923db17b6a0faa7317ff6abc9307c009fe --- tests/test_cel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_cel.c b/tests/test_cel.c index 03e243c78..9a3dc8114 100644 --- a/tests/test_cel.c +++ b/tests/test_cel.c @@ -1610,7 +1610,7 @@ AST_TEST_DEFINE(test_cel_dial_pickup) ast_channel_publish_dial(chan_caller, chan_callee, NULL, "ANSWER"); - HANGUP_CHANNEL(chan_caller, AST_CAUSE_NORMAL, "CANCEL"); + HANGUP_CHANNEL(chan_caller, AST_CAUSE_NORMAL, "ANSWER"); HANGUP_CHANNEL(chan_callee, AST_CAUSE_NORMAL, ""); return AST_TEST_PASS; -- cgit v1.2.3