Skip to content

fixed transcription is not received when call is terminated#1259

Merged
davehorton merged 10 commits intomainfrom
fix/gh_1246
Jul 9, 2025
Merged

fixed transcription is not received when call is terminated#1259
davehorton merged 10 commits intomainfrom
fix/gh_1246

Conversation

@xquanluu
Copy link
Copy Markdown
Contributor

@xquanluu xquanluu commented Jun 25, 2025

@xquanluu
Copy link
Copy Markdown
Contributor Author

Hi @davehorton @vdharashive @rammohan-y

My solution is for fixing transcription is not received when call is terminated by:
1/ in media-endpoint.js: which is a utils for creating new endpoint, feature server will have a common place to create Freeswitch endpoint, the endpoint is configured for all needed features.

The transcription issue are:
1/ feature server sends stopTranscription command too soon that we missed the transcription
2/ feature server destroys endpoint too soon that we missed the transcription

To fix above issue, If JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS is enabled, this PR does graceful shutdown for the endpoint by:
1/ override endpoint startTranscription: to let the endpoint know if the ep is in transcribe task
2/ override endpoint stopTranscription: if the endpoint is in transcribe task, the stopTranscription will be delayed until one of condition is matched: transcription is received or JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS timeout is passed.

3/ override endpoint destroy: if the endpoint is in transcribe task, the destroy will be delayed until one of condition is matched: transcription is received or JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS timeout is passed.

Please help me to review the PR and let me know if something need to be fixed

@rammohan-y
Copy link
Copy Markdown
Contributor

@xquanluu we found two cases in which the stopTranscription should stop immediately even if the JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS is set, one is when stopTranscription is invoked during ASR fallback and stopTranscription invoked when the call transcription_status is paused

Can you address these scenarios

As the PR is big, it will take some time to test

Comment thread lib/session/call-session.js
@rammohan-y
Copy link
Copy Markdown
Contributor

This PR fixes all the issues, delayed termination and delayed stopTranscription when JAMBONES_TRANSCRIBE_EP_DESTROY_DELAY_MS is specified.
There is no delay for pause transcription, ASR fallback and stopAmd

@xquanluu @vdharashive @davehorton

@xquanluu xquanluu marked this pull request as ready for review July 7, 2025 06:26
@davehorton davehorton merged commit 337c1cd into main Jul 9, 2025
3 checks passed
@davehorton davehorton deleted the fix/gh_1246 branch July 9, 2025 14:20
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.

3 participants