Skip to content

Commit

Permalink
refactor (Voice): Remove unused event processing related to 'respond …
Browse files Browse the repository at this point in the history
…to incoming call' getting started
  • Loading branch information
JPPortier committed Sep 24, 2024
1 parent 6f9a898 commit 75f97b1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

import com.sinch.sdk.SinchClient;
import com.sinch.sdk.domains.voice.WebHooksService;
import com.sinch.sdk.domains.voice.models.webhooks.AnsweredCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.DisconnectCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.IncomingCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.NotifyEvent;
import com.sinch.sdk.domains.voice.models.webhooks.PromptInputEvent;
import java.util.Map;
import java.util.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -65,19 +62,10 @@ public ResponseEntity<String> VoiceEvent(
var response =
switch (event) {
case IncomingCallEvent e -> webhooksBusinessLogic.incoming(e);
case AnsweredCallEvent e -> webhooksBusinessLogic.answered(e);
case DisconnectCallEvent e -> {
webhooksBusinessLogic.disconnect(e);
yield null;
}
case PromptInputEvent e -> {
webhooksBusinessLogic.prompt(e);
yield null;
}
case NotifyEvent e -> {
webhooksBusinessLogic.notify(e);
yield null;
}
default -> throw new IllegalStateException("Unexpected value: " + event);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import com.sinch.sdk.domains.voice.models.svaml.ActionHangUp;
import com.sinch.sdk.domains.voice.models.svaml.InstructionSay;
import com.sinch.sdk.domains.voice.models.svaml.SVAMLControl;
import com.sinch.sdk.domains.voice.models.webhooks.AnsweredCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.DisconnectCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.IncomingCallEvent;
import com.sinch.sdk.domains.voice.models.webhooks.NotifyEvent;
import com.sinch.sdk.domains.voice.models.webhooks.PromptInputEvent;
import java.util.Collections;
import java.util.logging.Logger;
import org.springframework.stereotype.Component;
Expand All @@ -31,25 +28,8 @@ public SVAMLControl incoming(IncomingCallEvent event) {
.build();
}

public SVAMLControl answered(AnsweredCallEvent event) {

LOGGER.info("Handle event: " + event);

return SVAMLControl.builder().build();
}

public void disconnect(DisconnectCallEvent event) {

LOGGER.info("Handle event: " + event);
}

public void prompt(PromptInputEvent event) {

LOGGER.info("Handle event: " + event);
}

public void notify(NotifyEvent event) {

LOGGER.info("Handle event: " + event);
}
}

0 comments on commit 75f97b1

Please sign in to comment.