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 API with new interface #855

Merged
merged 52 commits into from
Sep 8, 2023
Merged

Voice API with new interface #855

merged 52 commits into from
Sep 8, 2023

Conversation

iAmmar7
Copy link
Collaborator

@iAmmar7 iAmmar7 commented Aug 9, 2023

Description

New interface for Voice API.

ref: https://github.com/signalwire/cloud-product/issues/7684

Type of change

  • Internal refactoring
  • Bug fix (bugfix - non-breaking)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Code snippets

import { SignalWire } from '@signalwire/realtime-api'

(async () => {
  const client = await SignalWire({
    host: process.env.HOST,
    project: process.env.PROJECT,
    token: process.env.TOKEN,
  })

const unsubVoiceOffice = await client.voice.listen({
  topics: ['office'],
  onCallReceived: async (call) => {
    try {
      await call.answer()

      const unsubCall = await call.listen({
        onStateChanged: (call) => {},
        onPlaybackUpdated: (playback) => {},
        onRecordingStarted: (recording) => {},
        onCollectInputStarted: (collect) => {},
        onDetectStarted: (detect) => {},
        onTapStarted: (tap) => {},
        onPromptEnded: (prompt) => {},
        // ... more call listeners can be attached here
      })
      // ...
      await unsubCall()
    } catch (error) {
      console.error('Error answering inbound call', error)
    }
  },
})

const call = await client.voice.dialPhone({
  to: process.env.VOICE_DIAL_TO_NUMBER as string,
  from: process.env.VOICE_DIAL_FROM_NUMBER as string,
  timeout: 30,
  listen: {
    onStateChanged: async (call) => {
      // When call ends; unsubscribe all listeners and disconnect the client
      if (call.state === 'ended') {
        await unsubVoiceOffice()

        await unsubVoiceHome()
 
        await unsubPlay()

        client.disconnect()
      }
    },
    onPlaybackStarted: (playback) => {},
  },
})

const unsubCall = await call.listen({
  onPlaybackStarted: (playback) => {},
  onPlaybackEnded: (playback) => {
    // This will never run since we unsubscribe this listener before the playback stops
  },
})

// Play an audio
const play = await call.playAudio({
  url: 'https://cdn.signalwire.com/default-music/welcome.mp3',
  listen: {
    onStarted: async (playback) => {
       await unsubCall()

       await play.stop()
    },
  },
})

const unsubPlay = await play.listen({
  onStarted: (playback) => {
    // This will never run since this listener is attached after the call.play has started
  },
  onEnded: async (playback) => {
    await call.hangup()
  },
})

@changeset-bot
Copy link

changeset-bot bot commented Aug 9, 2023

🦋 Changeset detected

Latest commit: 802f5a2

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

This PR includes changesets to release 6 packages
Name Type
@signalwire/realtime-api Major
@signalwire/core Major
@signalwire/node Patch
@signalwire/js 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

@iAmmar7 iAmmar7 changed the title WIP: Voice API with new interface Voice API with new interface Aug 29, 2023
@iAmmar7 iAmmar7 requested a review from edolix August 29, 2023 11:10
packages/realtime-api/src/BaseNamespace.ts Outdated Show resolved Hide resolved
packages/realtime-api/src/ListenSubscriber.ts Outdated Show resolved Hide resolved
packages/realtime-api/src/ListenSubscriber.ts Show resolved Hide resolved
packages/realtime-api/src/task/Task.ts Outdated Show resolved Hide resolved
onPromptFailed?: (prompt: CallPrompt) => unknown
onPromptEnded?: (prompt: CallPrompt) => unknown
onCollectStarted?: (collect: CallCollect) => unknown
onCollectInputStarted?: (collect: CallCollect) => unknown
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we can merge/include this event into onCollectUpdated ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think we could do that.

Instead of this

case 'start_of_input': {
        if (eventPrefix === 'prompt') return false
        callInstance.emit(`${eventPrefix}.startOfInput`, actionInstance)
        actionInstance.emit(
          `${eventPrefix}.startOfInput` as never,
          actionInstance
        )
        return false
      }

We can simply change the event name here

case 'start_of_input': {
        if (eventPrefix === 'prompt') return false
        callInstance.emit(`${eventPrefix}.updated`, actionInstance)
        actionInstance.emit(`${eventPrefix}.updated` as never, actionInstance)
        return false
      }

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed: since start_of_input is a specific event we should have the handler. Let's discuss the name onCollectInputStarted w/ Product.

packages/realtime-api/src/voice/CallCollect.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@edolix edolix left a comment

Choose a reason for hiding this comment

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

🥇 🥇

@iAmmar7 iAmmar7 merged commit be780da into dev Sep 8, 2023
11 checks passed
@iAmmar7 iAmmar7 deleted the aa/voice-api branch September 8, 2023 15:43
iAmmar7 added a commit that referenced this pull request Sep 14, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Sep 18, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Nov 14, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Dec 5, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Dec 5, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Dec 5, 2023
* Task namespace with new interface (#807)

* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* stack test update for Task

* changeset include

* refactor and e2e test case

* rename task emitter

* listen function public explicitly

* index worker file

* utility function to prefix the event

* correct type of taskworker

* PubSub and Chat namespace with new interface (#814)

* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* utility function to prefix the event

* PubSub namespace with new interface

* new interface for the Chat API

* fix stack tests

* include e2e test for PubSub API

* e2e test case for Chat interface

* test disconnected client

* unit tests for Base classes

* Unit tests for the Task class

* fix TS for the Task class unit test

* unit tests for PubSub and Chat API classes

* include changeset

* Update packages/realtime-api/src/chat/workers/chatWorker.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/chat/workers/chatWorker.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/pubSub/workers/pubSubWorker.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* fix typo

* type in changeset

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Voice API with new interface (#855)

* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Messaging namespace with new interface (#812)

* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* e2e test cases for call prompt

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* improve base and listener class for instances

* call connect implement with e2e test case

* improve call state events logic

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* Messaging namespace with new interface

* message worker to handle the events

* handle events through messaging api

* fix typescript types

* e2e test case for messagin api

* fix stack test

* unit test for messaging api

* include changeset

* promisify client disconnect

* fix unit test cases

* fix disconnect emitter

* fix unit test

* rebased with the dev

* fix base name space class

* connect payload fallback

* Update internal/playground-realtime-api/src/voice/index.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* fix unit tests

* fix e2e test cases

* Decorated promise for Voice Call APIs (#880)

* Decorated promise for Voice Call APIs

* decorate recording promise

* unit tests for decorated playback and recording promises

* decorate prompt promise

* generic decorate promise function

* decorated promise for detect and tap

* decorated call collect api promise

* more unit test cases

* generic decorate promise function with unit tests

* e2e test cases update

* update voice playgrounds

* include changeset

* prevent methods to be run if the action has ended

* promisify action ended properties

* Realtime Video SDK with new interface (#886)

* Realtime Video SDK with new interface

* room session with the new interface

* remove auto subscribe consumer

* fix unit tests for video and room session

* room member instance

* unit tests for room session member

* fix stack test

* room session playback realtime-api instance

* room session recording realtime-api instance

* room session stream realtime-api instance

* explicit methods for the realtime-api

* fix build issue

* separate workers for playback, recording and stream

* video playground with the new interface

* decorated promise for room session playback api

* decorated promise for room session recording api

* decorated promise for room session stream api

* fix unit test cases

* unit tests for decorated promises

* update video play ground with decorated promise

* fix e2e test case for the video

* fix unit test

* do not unsubscribe events

* fix unit test

* include changeset

* streaming getter for room session

* rename types

* fix playwright e2e test cases

* fix call fabric relay application test

* include log level debug for task e2e test

* Fix e2e test cases with v4 SDK (#916)

* fail test if error code is null

* increase timeout limit for pubsub e2e test

* unsub chat event

* update node version in github actions

* debug enable for prompt tests

* remove logs from the SDK

* send digits once prompt starts

* end the call when caller ends the prompt

* fix action onStarted promise

* update voice speech test with v4 interface

* enable logs for chat test

* kill all node process before running tests

* run only realtime tests

* debug the ci

* child.stderr.write remove

* remove process.stderr in voiceSpeechCollect

* enable all the tests

* categorize tests by action type

* voice collect speech test with continuous true and partial results false

* voice collect speech test with continuous true and partial results true

* more simplified collect speech tests

* include changeset

* increase tap timeout and fix race conditions in voice.test.ts

* increase tap timeout

* update possible results for collect

* tap setTimeout update

* Release 2023-11-23 (#913)

* Expose Chat types from the JS SDK (#919)

* Expose Chat types from the JS SDK

* include changeset

* Release 2023-12-05 (#920)

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Dec 11, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
iAmmar7 added a commit that referenced this pull request Dec 25, 2023
* Task namespace with new interface

* taskworker include

* extend task from applyeventlisteners

* base namespace class to handle the listen method

* topic attach to event name

* type update

* remove older Task api

* refactor and e2e test case

* Voice API with new interface

* handle call.playback listeners with all the methods

* run workers through methods

* playback events with e2e test cases

* remove old call playback class

* fix test file names

* improve playback tests

* rename voice playback tests

* voice call record events with e2e test cases

* fix playback and record types

* implement call.prompt with playback

* test utility add

* e2e test cases for call prompt

* call collect with e2e test cases

* Call tap with e2e test cases

* Call Detect API with e2e test cases

* remove old voice detect test

* voice call connect api

* update voice pass test with new interface

* improve base and listener class for instances

* include unit test cases for call apis

* voice stack test update

* call connect implement with e2e test case

* enable ws logs for task test

* update voice playground with the new interface

* minimize race condition in playback and recording e2e test cases

* minimize race condition for collect and detect e2e

* improve call state events logic

* fix voice unit test

* enable ws logs for voice test

* fix call connect bug

* remove unused voice calling worker

* enable ws logs for voice call collect

* improve collect and detect e2e test cases

* include changeset

* Update packages/realtime-api/src/BaseNamespace.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/ListenSubscriber.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* Update packages/realtime-api/src/task/Task.ts

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>

* add addToListenerMap method for consistency

* Revert "Update packages/realtime-api/src/ListenSubscriber.ts"

This reverts commit 69df536.

* update payload set and extends base calls with EventEmitter

* protect event emitter methods

* improve call collect test

* improve voice record e2e test

---------

Co-authored-by: Edoardo Gallo <edoardo@signalwire.com>
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