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

Response with content type "text/rude-rejection" freezes opts.Dial function #14

Closed
Stratoff opened this issue Dec 15, 2021 · 1 comment

Comments

@Stratoff
Copy link

When FreeSwitch returns a "text/rude-rejection" Response the opts.Dial function keeps waiting a message from channel forever in:
<-connection.responseChannels[TypeAuthRequest]

I created a temporary fix adding a new response and an anonymous go routine before the line of the mentioned above

go func () {
  <-connection.responseChannels[TypeRude]
  connection.ExitAndClose()
}()

// First auth
<-connection.responseChannels[TypeAuthRequest]

Tell me if you want me to make a pull request or to find another cleaner solution (I'm sure there's a better way)

Regards.

@winsock
Copy link
Contributor

winsock commented Dec 15, 2021

Hi @Stratoff, thanks for this report!

Your first pass solution certainly looks like it could work for this and shouldn't hurt anything/cause issues with the library. However I think some more research may be needed/looking at FS source code to ensure when this can be thrown. Documentation seems sparse for this particular response type, do you have anymore insight into what can produce this type of response?

From initial searching it seems to happen when FS blocks your connection explicitly instead of just a normal authentication failure? If that is the case and we can assume the connection is dead when receiving that response I can rework the disconnect handler to also catch this case. That would give the advantage that we can let the user of the library know the connection is dead and they can choose what do do from there.

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

3 participants