set dlg_req_swap_direction based on call direction#3072
Conversation
|
We've encountered a FreeSWITCH call recovery issue. The reproduction steps are below. @andywolk @morbit85 Could you please help to review and confirm whether this issue, Thanks! 1. FreeSwitch sends an outbound INVITE2. FreeSwitch receives a re-INVITE from the remote party and responds with 200 OKAt this point, 3. FreeSwitch failover and start to recover the callThe call is recovered successfully in this step. 4. FreeSWITCH fails over again but fails to recover the callAt this point, Since It looks like resetting |
|
The fix looks correct, and it's not only subsequent recoveries. Because the flag was only ever set and never reset, a call re-INVITEd in both directions before the first recovery already stores a stale value and recovers wrong on the first attempt. |
Description
This PR fixes a call recovery issue during FreeSWITCH failover.
Background
FreeSWITCH uses the channel variable
dlg_req_swap_directionto determine whether theFromandToheaders should be swapped when sending a re-INVITE for call recovery.The variable is set to
truewhen:an outbound channel receives a
nua_i_ackevent, oran inbound channel receives a
nua_r_inviteevent.Problem
Once
dlg_req_swap_directionis set totrue, there is no clear logic to reset or update it. As a result, subsequent SIP events may leave the variable in an incorrect state, eg: an outbound channel receives anua_r_inviteevent later, causing invalidFrom/Toheader handling during call recovery after a FreeSWITCH failover.Solution
This PR updates the handling of
dlg_req_swap_directionso that its value correctly reflects the current SIP dialog state during call recovery.Type of Change
Related Issues
Testing
Checklist
Additional Notes