-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Pull Requet #2862
Bug description
We developed a Call Center application built on a PABX that uses Freeswitch as a Telecom stack.
The bug occurs when an Attendant of the Call center is permannentely logged in a voice channel (ALeg).
A CRM (Customer Relationship Management) stack that is part of the Call Center commands this PABX to make outbound calls to customers.
These calls (one at a time - BLeg) will be bridge with the attendant's (ALeg) call.
At the end of the call the connection with the customer (BLeg) is disconnected and the attendant's connection (ALeg) is kept since the variable hangup_after_bridge is set as false in the dialplan.
The Call Center repeats this process for the next customers.
The attendant's channel (ALeg) is kept continously up. Most of the time this setup works well but sometimes after 1500 calls moreless received by the attendant its channel (ALeg) is wrongly hanged up by the Freeswitch so here is the bug.
Studying your code I changed it in 2 points at the switch_ivr_bridge.c file and 1 at the switch_ivr_originate.c file that I think would fix this issue.
2 cases possible
-
Problem occurs when two legs were bridged and the remote side in BLeg issues a BYE.
Assume Bleg call completed , uuid_bridge issued , received BYE in BLeg with ALeg Transfer bit flag equal false , ALeg and BLeg in CS_SOFT_EXECUTE
ALeg channel call sometimes is hangedd up even with hangup_after_bridge set to false -
Problem occurs when two legs were bridged and the remote side in BLeg issues a BYE.
Bleg call was complete , uuid_bridge issued , received BYE in BLeg when ALeg has Transfer flag bit value equal true.
ALeg channel call sometimes is hanged up even with hangup_after_bridge set to false
To reproduce the bug :
Built a test system with a softphone and 2 instances of FreeSWITCH.
The softphone is for the "attendant" , one freeswitch is our target in the test (FS1) the one that will behaves like the Call Center , the second freeswitch (FS2) will receives the calls originated by the Call Center and will answer then like a customer would do.
This answer call play a short voice file and hangup emulating a customer behavior.
The softphone will dial a sip address in FS1 (incr) - see dialplan robot.xml at the FS1 conf directory - that will established the ALeg and hits a dialplan that will continuosly originate calls to FS2 (BLeg) bridge it , waits the answer , play the voice file and hangup - see dialplan robot.xml at the FS2 conf directory.
This emulate the behavior of our Call Center for our test purpose.
With variable hangup_after_bridge=false for the attendant's channel (ALeg) this process should run indefinitely.
-
Using this example configuration
/-------bridge------\ (ALeg) +---+ (BLeg) +---+
(Softphone) -----------> !FS1! ------------>!FS2!
ext. 1000 <----------- +---+ <------------ +---+
- Dial into conference using incr (SoftPhone)
We attached file Issue_Hangup_After_Bridge_False.zip with all necessary files to create this test.
Directory \conf_FS1_Notebook_Windows is FS1 conf directory.
Directory \conf_FS2_Notebook_debian is FS2 conf directory.
File freeswitch_master.log was generated running the test with FreeSwitchConsole.exe in FS1 compiled with code of master branch so without our corrections.
You can see at this line
8bad57cf-7907-4fcb-8428-e70109341d23 2025-07-23 09:58:48.688547 65.89% [NOTICE] switch_ivr_bridge.c:1270
Hangup sofia/robot/[email protected] [CS_SOFT_EXECUTE] [DESTINATION_OUT_OF_ORDER]
File freeswitch_bugfix.log was generated running the test with FreeSwitchConsole.exe in FS1 compiled with code of the bug hangup the ALeg call after 1112 calls.
bugfix/hangup_after_bridge_false branch with our corrections and after 2600+ calls the call was not hangup ,
I did it in the softphone to finish the test.
Package Version for the Test
Softfone : MicroSIP
extension 1000 at IP 10.15.0.82
FS1 : Windows 11Pro Version 24H2 (OS build 26100.4652) 64bit
FreeSWITCH Version 1.10.13-dev-6258ac9b8c664bit (ac9b8c6 64bit)
IP 10.15.0.82
FS2 : Debian GNU/Linux 12 (Bookworm)
FreeSWITCH Versi on 1.10.12-release+git20240802T210227Za88d069~64bit
IP 10.15.0.125
Our Pull request #2862 is at
https://github.com/renatoluizbracco27/freeswitch/pulls