Skip to content

Commit b5b82f4

Browse files
committed
Patch for VoiceInterpreter callback doesn't execute when timedout call completed
This close #2301
1 parent 99263fd commit b5b82f4

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

Diff for: restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ public final class VoiceInterpreter extends BaseVoiceInterpreter {
193193
private ActorRef confSubVoiceInterpreter;
194194
private Attribute dialRecordAttribute;
195195
private boolean dialActionExecuted = false;
196-
private boolean dialCompletedStatusCallBackExecuted = false;
197196
private ActorRef sender;
198197
private boolean liveCallModification = false;
199198
private boolean recordingCall = true;
@@ -2526,7 +2525,6 @@ public void execute(final Object message) throws Exception {
25262525
}
25272526
dialChildren = null;
25282527
callback();
2529-
dialCompletedStatusCallBackExecuted = true;
25302528
return;
25312529
} else if (dialBranches != null && dialBranches.contains(sender)) {
25322530
if (logger.isInfoEnabled()) {
@@ -3000,13 +2998,10 @@ public void execute(final Object message) throws Exception {
30002998
}
30012999
if (!dialActionExecuted) {
30023000
executeDialAction(message, outboundCall);
3003-
callback(true);
3004-
dialCompletedStatusCallBackExecuted = true;
30053001
}
30063002

3007-
if (!dialCompletedStatusCallBackExecuted) {
3008-
callback();
3009-
}
3003+
callback(true);
3004+
30103005
// XXX review bridge cleanup!!
30113006

30123007
// Cleanup bridge

Diff for: restcomm/restcomm.testsuite/src/test/java/org/restcomm/connect/testsuite/telephony/TestDialVerbPartTwo.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -1484,10 +1484,10 @@ public synchronized void testDialNumberRejectBusyRcml() throws InterruptedExcept
14841484
assertTrue(bobCall.waitOutgoingCallResponse(5 * 1000));
14851485
assertEquals(Response.BUSY_HERE, bobCall.getLastReceivedResponse().getStatusCode());
14861486
}
1487-
1487+
14881488
private String dialClientWithActionRcml = "<Response><Dial action=\"http://127.0.0.1:8090/action\" method=\"GET\"><Client>alice</Client></Dial></Response>";
14891489
private String hangupActionRcml = "<Response><Hangup /></Response>";
1490-
1490+
14911491
@Test // (customised from testDialClientAliceWithRecordAndStatusCallbackForApp)
14921492
public synchronized void testDialClientAliceWithActionAndStatusCallbackForApp() throws InterruptedException, ParseException {
14931493
stubFor(get(urlPathEqualTo("/1111"))
@@ -1543,7 +1543,7 @@ public synchronized void testDialClientAliceWithActionAndStatusCallbackForApp()
15431543
Thread.sleep(3000);
15441544

15451545
// hangup (must be as alice, the callee, hanging up in order to test the specific issue found)
1546-
1546+
15471547
aliceCall.disconnect();
15481548
bobCall.listenForDisconnect();
15491549
assertTrue(bobCall.waitForDisconnect(3 * 1000));
@@ -1559,9 +1559,9 @@ public synchronized void testDialClientAliceWithActionAndStatusCallbackForApp()
15591559
}
15601560
assertTrue(requests.size()==3);
15611561
}
1562-
1562+
15631563
private String dialTimeOutClientWithActionRcml = "<Response><Dial timeout=\"3\" action=\"http://127.0.0.1:8090/action\" method=\"GET\"><Client>alice</Client></Dial></Response>";
1564-
1564+
15651565
@Test // (customised from testDialClientAliceWithRecordAndStatusCallbackForApp)
15661566
public synchronized void testDialTimeOutClientAliceWithActionAndStatusCallbackForApp() throws InterruptedException, ParseException {
15671567
stubFor(get(urlPathEqualTo("/1111"))
@@ -1609,7 +1609,6 @@ public synchronized void testDialTimeOutClientAliceWithActionAndStatusCallbackFo
16091609

16101610
assertTrue(aliceCall.waitForIncomingCall(3 * 1000));
16111611
assertTrue(aliceCall.sendIncomingCallResponse(Response.RINGING, "Ringing-Alice", 3600));
1612-
String receivedBody = new String(aliceCall.getLastReceivedRequest().getRawContent());
16131612

16141613
aliceCall.listenForCancel();
16151614

@@ -1618,7 +1617,7 @@ public synchronized void testDialTimeOutClientAliceWithActionAndStatusCallbackFo
16181617
assertTrue(aliceCall.respondToCancel(cancelTransaction, Response.OK, "Alice-OK-2-Cancel", 3600));
16191618

16201619
// hangup (must be as alice, the callee, hanging up in order to test the specific issue found)
1621-
1620+
16221621
bobCall.listenForDisconnect();
16231622
assertTrue(bobCall.waitForDisconnect(3 * 1000));
16241623
assertTrue(bobCall.respondToDisconnect());
@@ -1631,7 +1630,7 @@ public synchronized void testDialTimeOutClientAliceWithActionAndStatusCallbackFo
16311630
for (LoggedRequest loggedRequest : requests) {
16321631
logger.info("Status callback received: " + loggedRequest.getUrl());
16331632
}
1634-
assertTrue(requests.size()==4);
1633+
assertEquals(4, requests.size());
16351634
}
16361635

16371636
@Deployment(name = "TestDialVerbPartTwo", managed = true, testable = false)

0 commit comments

Comments
 (0)