diff --git a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java index 96c44bdc5f..cb6123fdf7 100644 --- a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java +++ b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/VoiceInterpreter.java @@ -781,10 +781,6 @@ private void onMediaGroupResponse(Object message) throws TransitionFailedExcepti fsm.transition(message, ready); } else if (is(creatingRecording)) { fsm.transition(message, finishRecording); - } else if (is(forking)){ - // Moving to next verb since received confirmation from Stop, requested at checkDialBranch - final GetNextVerb next = new GetNextVerb(); - parser.tell(next, self()); } // This is either MMS collected digits or SIP INFO DTMF. If the DTMF is from SIP INFO, then more DTMF might // come later @@ -820,6 +816,11 @@ else if (is(gathering) || (is(finishGathering) && !super.dtmfReceived)) { // Finally proceed with call bridging final JoinCalls bridgeCalls = new JoinCalls(call, outboundCall); bridge.tell(bridgeCalls, self()); + } else if (is(forking)){ + if(dialBranches == null || dialBranches.size() == 0){ + final GetNextVerb next = new GetNextVerb(); + parser.tell(next, self()); + } } } else { fsm.transition(message, hangingUp); @@ -1167,6 +1168,10 @@ private void onCallStateChanged(Object message, ActorRef sender) throws Transiti removeDialBranch(message, sender); } checkDialBranch(message, sender, attribute); + if (dialBranches == null || dialBranches.size() == 0){ + final StopMediaGroup stop = new StopMediaGroup(); + call.tell(stop, sender); + } return; } } else { @@ -1335,12 +1340,7 @@ private void checkDialBranch(Object message, ActorRef sender, Attribute attribut if (sender != null && !sender.equals(call)) { callManager.tell(new DestroyCall(sender), self()); } - if(is(forking)){ - // Stop ringing from inbound call when all branches are BUSY - // Explicit Stop must be send before continue with VI - final StopMediaGroup stop = new StopMediaGroup(); - call.tell(stop, self()); - } else if (parser != null) { + if (parser != null && !is(forking)) { final GetNextVerb next = new GetNextVerb(); parser.tell(next, self()); }