[FreeswitchCoreLib] bridge call with hangup_after_bridge=false #2862
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 received by the attendant its channel (ALeg) is wrongly hanged up by the Freeswitch so here is the bug. Studying your code I changed code 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
in the previous code ALeg channel call sometimes is hangedd up even with hangup_after_bridge set to false, our correction hangup channel only if hangup_after_bridge equal true or else it set ALeg call state to CS_EXECUTE see code changes in
switch_ivr_bridge.c
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.
in the previous code ALeg channel call sometimes is hanged up even with hangup_after_bridge set to false, with our corretion hangup channel only if hangup_after_bridge equal true see code changes in switch_ivr_originate.c