Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Voice Namespace in Realtime-API #477

Merged
merged 24 commits into from
May 2, 2022
Merged

Voice Namespace in Realtime-API #477

merged 24 commits into from
May 2, 2022

Conversation

edolix
Copy link
Contributor

@edolix edolix commented Mar 30, 2022

This branch will includes all the other branches for each voice-feature.

  • Review arguments to be camelCase instead of snake_case

@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2022

🦋 Changeset detected

Latest commit: 9fe8d88

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@sw-internal/playground-realtime-api Minor
@signalwire/core Minor
@signalwire/realtime-api Minor
@signalwire/js Patch
@signalwire/react-native Patch
@signalwire/web-api Patch
@signalwire/webrtc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@edolix edolix force-pushed the eg/rt-api-voice-namespace branch 2 times, most recently from cd5d70b to 4a36870 Compare April 1, 2022 16:59
packages/realtime-api/src/voice/Call.ts Outdated Show resolved Hide resolved
node_id: this.nodeId,
state: 'playing',
}
this.emit(toLocalEvent('calling.playback.start'), startEvent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely not for this PR, but we should probably come up with an alternative for this in the future. Feels like a bit too much indirection and overhead for what we're looking after.

packages/realtime-api/src/voice/Call.ts Show resolved Hide resolved
})
}

waitUntilConnected() {
Copy link
Contributor

Choose a reason for hiding this comment

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

from our chat today: discussed having a generic waitFor(<event>) method.

packages/realtime-api/src/voice/CallPrompt.ts Outdated Show resolved Hide resolved
packages/realtime-api/src/voice/Call.ts Show resolved Hide resolved
@framini framini force-pushed the eg/rt-api-voice-namespace branch 2 times, most recently from da44c90 to 143b574 Compare April 20, 2022 08:55
edolix and others added 22 commits May 2, 2022 14:19
* Add call answer and update Voice workers

* voice playground with ENVs

* remove call.state handle from playground

* improve types

* remove types for created/ended voice events

* add changeset

* type voice worker
* Voice call is not a BaseConsumer anymore

* add voice play types and split workers on different files

* add play method on Call

* [ot] fix jest warnings and use room_session instead of room from room.subscribed event

* realtime-api jest fixes

* test coverage for CallPlayback

* improve types and remove ts-x notations

* add derived methods

* changeset
* fix import

* rename CallClient into VoiceClient

* types

* welcome AutoApplyTransformsConsumer

* move createCallObject to its own emitter transform
* add types

* CallRecording object

* add worker voiceCallRecordWorker

* implement record/recordAudio methods

* update playground example with record

* add changeset
* add prompt types

* CallPrompt object and specs

* add voiceCallPromptWorker

* add prompt method to Voice Call object

* improve CallPrompt public interface

* update playground with prompt example

* changeset

* passing tests

* add waitForResult in CallPrompt object
* add types for tap

* CallTap obj and specs

* add voiceCallTapWorker

* implement tap/tapAudio methods on Voice Call

* changeset

* tweaks
* add types for relay connect methods/events

* update toInternalDevices for sip case

* add voiceCallConnectWorker

* update voiceCallStateWorker to always dispatch an event and filter for state event by call_id

* add connect, disconnect and waitUntilConnected on the Call and provide a playground

* changeset

* move call.state listener on constructor
* add util for converting a record's props to snake_case

* export util from core

* update `record` method to use camelCase

* improve typings for toSnakeCaseProps

* rename function, update prompt method

* convert remaining prompt params

* use camelCase for devices and add conversion for the internal util

* convert digit props

* add util for checking typeof

* add ability to convert deeply nested arrays

* fix typeof

* fix condition

* remove need of the util
* rename var to match other workers

* split sagas into state and dial events

* wip for having the dialWorker handling dial events

* restore type

* remove call_state filter so the worker can update the instance with all the call.state events

* add ability to handle errors on dial, remove loop

* remove unused event

* remove handlers when the first event occurs

* type array

* remove unnecessary check
…496)

* add new apis for handling workers

* wip for moving to the new api, remove synthetic events

* add option to skip caching the base instance

* remove last call of attachWorkers

* add dirty debugging files

* fix hangup logic

* add logs for callId/tag in voiceCallStateWorker

* do override for "tag" in calling.call.state" events

* kill the voiceCallStateWorker on ended

* prettier

* fix params access

* remove todos

* update comment in voiceCalStateWorker

* add comment on voiceCallPlayWorker

* remove commented import

* fix casing

* format comments

* add changeset

Co-authored-by: Edoardo Gallo <edo91.gallo@gmail.com>
* change signature for the onError

* add types for sendDigits

* add sendDigits method

* add changeset

* update error message

* update types to allow passing an initialState, filter by controlid

* pr feedback
* initial proposal for voice createDialer

* move createDialer from VoiceClient to an util - moved tests

* remove from client and update playground

* change dialX with addX

* changeset

* add method to dialPhone and dialSip directly

* update playground with examples
* add createPlaylist and types

* update methods in Call and playground

* expose createPlaylist from the Voice namespace instead of the Client

* changeset

* move tests
* add types for detect

* CallDetect object

* add voiceCallDetectWorker

* initial implementation for voice call detect

* update detect method

* more detect types

* on vs once

* add waitForResult to Detect

* update voiceCallDetectWorker

* logger info to trace

* add trace debug on pubSubSaga

* make CallDetect work and expose Detector type

* update playground with detect

* derived methods for detect and snake_case vs camelCase params

* add method to call contract and update playground

* changeset

* update detect typing
* make api as internal

* move play to runWorker, fix play return type

* move record to runWorker

* move prompt to runWorker

* move tap to runWorker

* replace payload with initialState, change signature to give room for passing the params coming from the server

* move detect to runWorker

* move voiceCallReceiveWorker to runWorker

* add ability to pass custom types for worker hooks

* add proper typings to each of the onDone/onFail for all workers

* rollback changes for connect worker

* make generic optional for backwards compat

* prettier

* add changeset
* split types for CallingCallDialEventParams

* export ToExternalJSONResult

* return error on dial.failed

* add changeset
* create Dialer class

* move implementation to use new Dialer()

* add Playlist object

* update implementation to use the new Playlist constructor

* changeset

* fix VoicePlaylist add signature
* change on to once on CallPrompt

* add waitForEnded in CallPlayback

* dispatch proper event from worker to update CallPlayback

* update playground

* add changeset

* Update packages/realtime-api/src/voice/workers/voiceCallPlayWorker.ts

Co-authored-by: Francisco Ramini <framini@gmail.com>

Co-authored-by: Francisco Ramini <framini@gmail.com>
* add e2e for voice namespace

* update drone.yml

Co-authored-by: Edoardo Gallo <edo91.gallo@gmail.com>
@edolix edolix force-pushed the eg/rt-api-voice-namespace branch from 4c28396 to 9fe8d88 Compare May 2, 2022 12:20
@edolix edolix changed the title WIP: Voice Namespace in Realtime-API Voice Namespace in Realtime-API May 2, 2022
@edolix edolix merged commit c6beec6 into main May 2, 2022
@edolix edolix deleted the eg/rt-api-voice-namespace branch May 2, 2022 13:06
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