0x19 / goesl

Freeswitch Event Socket Library wrapper for Go
https://godoc.org/github.com/0x19/goesl
MIT License
126 stars 124 forks source link

GoESL Client Queues Calls Without Originating After 96 Attempts #40

Open Pierre35557 opened 1 year ago

Pierre35557 commented 1 year ago

Hello,

I've encountered a peculiar issue with the GoESL package during automation of dialing through FreeSWITCH. After successfully originating 96 calls, no further calls are processed. The FreeSWITCH CLI does not log any additional attempts, yet when I terminate the Go application, all the queued calls are suddenly processed.

My Environment Details:

Issue Description: My FreeSWITCH setup is configured to allow for 1,000 concurrent channels and 50 calls per second (CPS). Despite this, the system halts call processing after 96 calls. There are no errors or relevant logs in FreeSWITCH indicating why further calls are not being processed.

To rule out any conflicts with other packages, I created a minimal Go application with minimal dependencies. This application's sole function was to dial numbers to test the limits. The same issue occurred, which suggests that the problem is not related to other package dependencies.

A tcpdump on the server, filtered by my IP address, confirmed that the originate commands are reaching the server, but no further action is observed.

Steps to Reproduce:

  1. Set up FreeSWITCH to allow 1,000 concurrent channels and 50 CPS.
  2. Use the GoESL package to originate calls.
  3. Observe that after 96 successful calls, no further calls are processed.

Expected Behavior: The GoESL client should continue to originate calls until it reaches the configured limits of FreeSWITCH or has no more dials left.

Actual Behavior: The GoESL client stops originating calls after 96 attempts, with no further processing observed until the application is terminated.

Additional Information: A Stack Overflow post with more context can be found here: https://stackoverflow.com/questions/77428926/goesl-with-temporal-calls-not-originating-past-certain-point-in-freeswitch/77450560#77450560

I would appreciate any guidance on further debugging steps or insights into what might be causing this behaviour.

0x19 commented 1 year ago

Thank you for quite a extensive explanation on what is the issue. This whole library is done quite inefficiently, attempting to use channels and mutexes where it should not be. Problematic you are seeing is that mutex is not released resulting in stuck mode.

I won't be fixing this library, but instead am gathering time to rewrite this library entirely. Having bunch of work so not sure when I'll manage time.