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

MatchLenOrTerminator Not waiting for all the DTMF #141

Open
avraham1 opened this issue Nov 9, 2022 · 3 comments
Open

MatchLenOrTerminator Not waiting for all the DTMF #141

avraham1 opened this issue Nov 9, 2022 · 3 comments

Comments

@avraham1
Copy link

avraham1 commented Nov 9, 2022

I want to receive a list of digits from the client, but the Play method returns immediately when the client clicks on the first digit.

This is my code:

func chooseLesson(ctx context.Context, h *ari.ChannelHandle, user *User) { res, _ := play.Play(ctx, h, play.URI(msgPath(msg)), play.MatchLenOrTerminator(10, "#")).Result() lessonId := res.DTMF // <<< Only first digit here }

where is my mistake?

@Ulexus
Copy link
Member

Ulexus commented Nov 9, 2022

I don't see a problem in your code... Is the caller perhaps expiring the inter-digit timer (default: 3s)?
Are you, perhaps, encountering an error and not seeing it?

@avraham1
Copy link
Author

Thanks for your response.

It happens instantly, not because of the timer.

As you can see in the picture, err is nil, and status is Cancelled

What it means? Why is it cancelled?

image

@Ulexus
Copy link
Member

Ulexus commented Nov 10, 2022

There aren't really that many things it could be: https://github.com/CyCoreSystems/ari/blob/master/ext/play/session.go#L186-L219

Context cancellation, overall timeout, or inter-digit timeout. Since you're not getting an Invalid result, it's not that.

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

No branches or pull requests

2 participants