Skip to content

Post voice traffic only to WebSocket and not via http#445

Open
pranavjoshi001 wants to merge 3 commits intomicrosoft:masterfrom
pranavjoshi001:post-voice-traffic-via-websocket
Open

Post voice traffic only to WebSocket and not via http#445
pranavjoshi001 wants to merge 3 commits intomicrosoft:masterfrom
pranavjoshi001:post-voice-traffic-via-websocket

Conversation

@pranavjoshi001
Copy link
Contributor

Description:
This change enables voice event activities to be sent through WebSocket connections instead of HTTP POST in the Direct Line

Background

  • DirectLineJS routes all activities through HTTP POST and not directly to WebSocket because of limitation on ABS side, ABS does not process incoming web socket traffic and only server to client push is handled.
  • Voice traffic does not support over HTTP POST hence it should go through web socket and not via API call
  • Once ABS handles client to server push, we can send all traffic to web socket directly
  • This is interim solution until ABS handles that.

Changes in this PR

  • Added voice activity detection: isVoiceEventActivity() method identifies activities with voiceLiveEvent properties
  • Enhanced activity routing: Modified postActivity() to route voice events through WebSocket while maintaining HTTP POST for other activities
  • Added test coverage: Tests for WebSocket routing, error handling, activity detection, and invalid structures

Backward Compatibility

  • No breaking changes: Existing activity posting behavior unchanged for non-voice activities
  • Automatic detection: Voice routing based on activity structure - no configuration needed

Copy link
Collaborator

@compulim compulim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants