[Freeswitch-users] FreeSWITCH Stops Responding

Shaun Stokes shaun at sysconfig.cloud
Tue Sep 7 06:43:09 UTC 2021


The following patch fixed an issue for us that we had with stuck calls\channels.
https://github.com/signalwire/freeswitch/pull/1256

We also used to get stuck call centre queue calls from time to time until implementing the below patch.

## FS Patch https://freeswitch.org/jira/projects/FS/issues/FS-11938 - mod_callcenter members not removed under certain conditions (calls stuck in queue)
# This can be triggered at the point the agent leg ANSWERS and immediately sends NORMAL_CLEARING, the member leg ends shortly after. In all instances this line has been encountered the member leg is ended shortly after the agent leg but remains stuck in the database, we need treat this as an ended call.
# Update member state to 'Waiting' is removed, set the correct channel variables to indicate the call was not bridged and end the call.
sed -i /usr/src/freeswitch/src/mod/applications/mod_callcenter/mod_callcenter.c -z -e s~'\d115\d113\d108\d32\d61\d32\d115\d119\d105\d116\d99\d104\d95\d109\d112\d114\d105\d110\d116\d102\d40\d34\d85\d80\d68\d65\d84\d69\d32\d109\d101\d109\d98\d101\d114\d115\d32\d83\d69\d84\d32\d115\d116\d97\d116\d101\d32\d61\d32\d39\d87\d97\d105\d116\d105\d110\d103\d39\d32\d87\d72\d69\d82\d69\d32\d117\d117\d105\d100\d32\d61\d32\d39\d37\d113\d39\d32\d65\d78\d68\d32\d105\d110\d115\d116\d97\d110\d99\d101\d95\d105\d100\d32\d61\d32\d39\d37\d113\d39\d34\d44\d32\d104\d45\d62\d109\d101\d109\d98\d101\d114\d95\d117\d117\d105\d100\d44\d32\d103\d108\d111\d98\d97\d108\d115\d46\d99\d99\d95\d105\d110\d115\d116\d97\d110\d99\d101\d95\d105\d100\d41\d59\d10\d9\d9\d9\d99\d99\d95\d101\d120\d101\d99\d117\d116\d101\d95\d115\d113\d108\d40\d78\d85\d76\d76\d44\d32\d115\d113\d108\d44\d32\d78\d85\d76\d76\d41\d59\d10\d9\d9\d9\d115\d119\d105\d116\d99\d104\d95\d115\d97\d102\d101\d95\d102\d114\d101\d101\d40\d115\d113\d108\d41\d59~\d115\d119\d105\d116\d99\d104\d95\d99\d104\d97\d110\d110\d101\d108\d95\d115\d101\d116\d95\d118\d97\d114\d105\d97\d98\d108\d101\d40\d97\d103\d101\d110\d116\d95\d99\d104\d97\d110\d110\d101\d108\d44\d32\d34\d99\d99\d95\d97\d103\d101\d110\d116\d95\d98\d114\d105\d100\d103\d101\d100\d34\d44\d32\d34\d102\d97\d108\d115\d101\d34\d41\d59\d10\d9\d9\d9\d115\d119\d105\d116\d99\d104\d95\d99\d104\d97\d110\d110\d101\d108\d95\d115\d101\d116\d95\d118\d97\d114\d105\d97\d98\d108\d101\d40\d109\d101\d109\d98\d101\d114\d95\d99\d104\d97\d110\d110\d101\d108\d44\d32\d34\d99\d99\d95\d97\d103\d101\d110\d116\d95\d98\d114\d105\d100\d103\d101\d100\d34\d44\d32\d34\d102\d97\d108\d115\d101\d34\d41\d59\d10\d9\d9\d9\d10\d9\d9\d9\d105\d102\d32\d40\d33\d115\d116\d114\d99\d97\d115\d101\d99\d109\d112\d40\d104\d45\d62\d97\d103\d101\d110\d116\d95\d116\d121\d112\d101\d44\d32\d67\d67\d95\d65\d71\d69\d78\d84\d95\d84\d89\d80\d69\d95\d67\d65\d76\d76\d66\d65\d67\d75\d41\d41\d32\d123\d10\d9\d9\d9\d9\d115\d119\d105\d116\d99\d104\d95\d99\d104\d97\d110\d110\d101\d108\d95\d104\d97\d110\d103\d117\d112\d40\d109\d101\d109\d98\d101\d114\d95\d99\d104\d97\d110\d110\d101\d108\d44\d32\d83\d87\d73\d84\d67\d72\d95\d67\d65\d85\d83\d69\d95\d68\d69\d83\d84\d73\d78\d65\d84\d73\d79\d78\d95\d79\d85\d84\d95\d79\d70\d95\d79\d82\d68\d69\d82\d41\d59\d10\d9\d9\d9\d125~'
# All legs have ended at this point, this needs to apply to both non-bridged and bridged calls to ensure the correct actions are completed and the member doesn't remain stuck in the database after the call has ended.
# If statement is removed and line indentation is corrected.
sed -i /usr/src/freeswitch/src/mod/applications/mod_callcenter/mod_callcenter.c -z -e s~'\d125\d10\d9\d9\d105\d102\d32\d40\d98\d114\d105\d100\d103\d101\d100\d41\d32\d123~\d125\d10\d9\d9\d105\d102\d32\d40\d98\d114\d105\d100\d103\d101\d100\d32\d124\d124\d32\d33\d98\d114\d105\d100\d103\d101\d100\d41\d32\d123~'

We have experienced more stuck calls\channels when using PostgreSQL for the coredb which we believe may have been a DB timing issue as David and Ken have suggested, using SQLite on a RAM disk is usually sufficient.

________________________________
From: FreeSWITCH-users <freeswitch-users-bounces at lists.freeswitch.org> on behalf of David Villasmil <david.villasmil.work at gmail.com>
Sent: 04 September 2021 19:30
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Subject: Re: [Freeswitch-users] FreeSWITCH Stops Responding

That is correct. But we who have worked with FS since around 2002 know this, newer people get all worked up until they’re told this :)

It’s a learning thing..

On Sat, 4 Sep 2021 at 17:31, Ken Rice <krice at freeswitch.org<mailto:krice at freeswitch.org>> wrote:
“stuck channels” usually arent stuck once you realize things like “show calls” and “show channels” are selects against the coredb. this usually happens on busy systems timing put waiting for db delete’s to run that fail or get skipped.

Sent from my iPhone

On Sep 4, 2021, at 05:22, David Villasmil <david.villasmil.work at gmail.com<mailto:david.villasmil.work at gmail.com>> wrote:


Hello all,

Interesting point about Gentoo, but I highly doubt it’s OS related. I’ve been living this issue (about those “stuck channels”, not a frozen FS, that’s indeed weird) for year and years. I’ve seen in on CentOS, Debian, Ubuntu, etc.

In my experience this became an issue with the rise of VM. Back in the day you would see this every now and then, like months apart (this, or a crashed MySQL database), but wasn’t big enough to be a critical problem. Today day it’s basically an everyday thing if you have enough nodes.


On Sat, 4 Sep 2021 at 00:15, Ken Rice <krice at freeswitch.org<mailto:krice at freeswitch.org>> wrote:
Having massive experience here, you might try replacing your linux distro.

 (Yes i know some people are going to take this as brushing off the problem or trying to start a distro war. If this starts a distro war I will moderate you and only allow replies are not headed to a flame war.)

However, as someone who has ran an extremely large Gentoo based cluster, we had to abandon gentoo due to random crashes, unexplainable bugs that could not be reproduced or explained.

If you can not replace the distro I VERY HiGHLY recommend running vanilla libc and other libs without the gentoo portage included patches. (hint the use flag: vanilla)

Ken
Sent from my iPhone

On Sep 3, 2021, at 14:49, Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:



 We have not been able to reproduce this in testing. It only happens in our production environment.
 Are there any other debug options that could be enabled, or is there any code in FreeSWITCH that you think may be causing this that we could look into.  We could get you access to a server if that would help.
Server Details:
Gentoo-5.10.27
RAM: 15GB
CPU: 4
FreeSWITCH-1-.10.6
Sqlite-3.34.1

On Thu, Sep 2, 2021 at 7:24 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
And these exhibit the issue on command?

On Wed, Sep 1, 2021 at 5:06 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:
Here are two originate samples.

https://pastebin.com/YKRKrJLu

https://pastebin.com/TEX3yfX6



On Wed, Sep 1, 2021 at 8:00 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
Can you try to create one where this happens without all this mess?

On Wed, Sep 1, 2021 at 2:41 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:
Here is the LUA code regarding creating sessions and bridging. It is broken up into 5 sections.
The top part is the common functions, and the 4 sections below are different call scenarios.
https://pastebin.com/qqGw3tms


On Wed, Sep 1, 2021 at 3:53 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
I you do sessions from your lua, I need to see how you do that.

On Tue, Aug 31, 2021 at 4:20 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:

Yes, it bridges the inbound call to an outbound one.


(ProxyOutbound.luac)
https://pastebin.com/RDUMy473

On Tue, Aug 31, 2021 at 8:39 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
Guessing you create sessions in lua? ProxyOutbound.luac?

On Tue, Aug 31, 2021 at 3:33 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
and to make sure when you uuid kill one it says it didn't exist but show channels had it still listed correct?

On Tue, Aug 31, 2021 at 2:58 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:
Hello,

We have got the logs for a few calls that were stuck.
(Show channels fe8f206c-2bd9-4af2-b329-35f53228a38a)
https://pastebin.com/NTnte7J7

(Extracted from logs fe8f206c-2bd9-4af2-b329-35f53228a38a)
https://pastebin.com/sAhFiGjY

(Show channels 46c6e04b-a58e-4b82-9968-fb0e9c2c0fb3)
https://pastebin.com/bmcdjzAr

(Extracted from logs 46c6e04b-a58e-4b82-9968-fb0e9c2c0fb3)
https://pastebin.com/aGyY3m9F

(Show channels 624cac90-0a7b-11ec-b7d0-6f543a588268)
https://pastebin.com/0cnQaRhC

(Extracted from logs 624cac90-0a7b-11ec-b7d0-6f543a588268)
https://pastebin.com/atX0VXdZ

Please let us know if there is anything else we can provide that would be useful. Thank you.


On Mon, Aug 30, 2021 at 8:20 PM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
Check the UUID of the session in question, and extract its logs, and let's diagnose it

On Mon, Aug 30, 2021 at 12:39 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:
 Yes, that is what we are seeing when running uuid_kill.  We cannot "replicate" the issue, but it happens multiple times a day for us across our servers.   We have looked through logs across multiple systems, taken SIP traces to see if that showed anything.  Last we got a Core dump of the running process after the failure. Nothing seems to stand out as the cause.



 Are there any other debug steps you can think of or what other information to look at?  We could capture all traffic on the server, or recompile with special debug flags whatever it is that might help.



Steps we have taken:

sofia loglevel all 9

sofia global siptrace on

fsctl loglevel 7

# Set environment variable

TPORT_LOG=1


On Sat, Aug 28, 2021 at 12:54 AM Brian West <brian at freeswitch.com<mailto:brian at freeswitch.com>> wrote:
It's an issue we've been searching for, if you uuid_kill it, and it says no session, it only means the record was NOT removed from the sqlite database.

Nobody can seem to replicate the steps required to get into that condition, maybe you could look thru the logs and see if you can replicate what ever happened on that lingering UUID

/b


On Fri, Aug 27, 2021 at 5:40 PM Cary Shouse <cary at ytel.com<mailto:cary at ytel.com>> wrote:
 We recently started having a problem with our FreeSWITCH servers where calls are working well, with about 200 calls operating sometimes for a couple of days, and then something happens and all call progress stops. Then any new inbound calls that come into the server get stuck in initial status, new inbound get stuck at RINGING. This happens until the max sessions are hit and of course nothing else works from there. Our thought is something is creating a lock and stopping anything else from progressing.
 We are seeing the stuck sessions using "show channels". Doing a uuid_kill on the calls seems to make no difference to the output of "show channels", but we have noticed in the logs that some events do happen to some of the calls.
 We had ran into a similar issue when writing a custom C module and made some mistakes with session_rwlock etc. But in this case, all of this is using LUA.
Some general information:
FreeSWITCH Versions 1.10.6 and 1.10.1
Modules used:
LUA, xml_curl(dialplan), event_socket,

 Most of this is just application playing audio files and or creating a new call to bridge to.

 Really looking for some help on what debugging we can enable to help identify what is getting stuck to identify where a bug might be on our usage or possible issue with FreeSWITCH.

 We have captured a core dump of the running process when it got into the bad state as well, if that is helpful, we can send it in.

Thank you for your help.
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>


--


Brian West | Co-founder and Developer

Need Commercial support? email sales at freeswitch.com<mailto:sales at freeswitch.com>

FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045<https://maps.google.com/?q=17345+Civic+Drive+%232531+Brookfield,+WI+53045&entry=gmail&source=g>

Email: brian at freeswitch.com<mailto:brian at freeswitch.com>

Mobile: 918-424-9378

Website: https://www.FreeSWITCH.com<https://www.freeswitch.com/>

[https://www.facebook.com/signalwireinc?src=email]<https://www.facebook.com/freeswitch> [https://twitter.com/freeswitch] <https://twitter.com/freeswitch>

_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
--
Regards,

David Villasmil
email: david.villasmil.work at gmail.com<mailto:david.villasmil.work at gmail.com>
phone: +34669448337
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales at freeswitch.com<mailto:sales at freeswitch.com>
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
--
Regards,

David Villasmil
email: david.villasmil.work at gmail.com<mailto:david.villasmil.work at gmail.com>
phone: +34669448337
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20210907/311781bd/attachment-0001.html>


More information about the FreeSWITCH-users mailing list