jambonz / jambonz-feature-server

Core telephony feature server for the jambones platform
MIT License
47 stars 38 forks source link

AMD cleanup listener issue #918

Open xquanluu opened 1 month ago

xquanluu commented 1 month ago

TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type function. Received undefined at checkListener (node:events:276:3) at Endpoint.removeListener (node:events:682:7) at TaskRestDial.stopAmd (/home/admin/apps/jambonz-feature-server/lib/utils/amd-utils.js:394:10) at TaskRestDial.turnOffAmd (/home/admin/apps/jambonz-feature-server/lib/tasks/rest_dial.js:51:62) at RestCallSession._hangup (/home/admin/apps/jambonz-feature-server/lib/session/rest-call-session.js:118:25) at RestCallSession._callerHungup (/home/admin/apps/jambonz-feature-server/lib/session/rest-call-session.js:109:10) at Dialog.emit (node:events:519:28) at Dialog.handle (/home/admin/apps/jambonz-feature-server/node_modules/drachtio-srf/lib/dialog.js:497:14) at Object.handle (/home/admin/apps/jambonz-feature-server/node_modules/drachtio-srf/lib/srf.js:136:46) at next (/home/admin/apps/jambonz-feature-server/node_modules/drachtio-srf/lib/proto.js:202:15)

https://github.com/jambonz/jambonz-feature-server/blob/main/lib/utils/amd-utils.js#L394
line 394: ep.removeListener(GoogleTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(GoogleTranscriptionEvents.EndOfUtterance, ep.amd.EndOfUtteranceHandler);
      ep.removeListener(AwsTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(AzureTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(AzureTranscriptionEvents.NoSpeechDetected, ep.amd.noSpeechHandler);
      ep.removeListener(NuanceTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(DeepgramTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(SonioxTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(IbmTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(NvidiaTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
      ep.removeListener(JambonzTranscriptionEvents.Transcription, ep.amd.transcriptionHandler);
davehorton commented 1 month ago

@xquanluu why was this closed?

xquanluu commented 1 month ago

Closed by misktake, sorry.