-
Notifications
You must be signed in to change notification settings - Fork 1.6k
mod_callcenter: fix agent zombie call #2530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
mod_callcenter: fix agent zombie call #2530
Conversation
doing more test, i found a scenario that is not solved: callcenter strategy: ring-all , 2 agents. attache call log: I could in my lua script when calling the 1 agent, after the timeout, check if the call is already answered and hangup/cancel the originate. i think the best solution would be implemented in callcenter a way of detecting hangup or answered and cancel the originate if is not returning. any idea? Thanks |
I understood how the call is hangup when other agent answers the call: "switch_core_session_hupall_matching_var("cc_member_pre_answer_uuid", h->member_uuid, SWITCH_CAUSE_LOSE_RACE);" In this scenario the call is not canceled because there is not yet a channel to hangup... FS is waiting in the originate and when the sleep is over the originate continues the execution.. creating the channel and placing the call to the agent. |
with my last commit, it hangup the call if it is already connected. |
recently with this change i got another issue that could be related... but not sure. Using ring-all strategic sometimes the call is place twice to the same destination ignoring the agent dialstring.
Mod_callcenter is reading correctly the dial string, but in switch_originate i got the debug from my script with the same userid:
EDIT: directory and user.lua script:
Any idea on how can i trace this in switch_ivr_originate? Thanks. |
I think I found the root cause of the problem. I’m testing the following patch to see if it solves the issue.
|
The changes I made in mod_dptools are not working as expected. The channel variable gets replaced, and when the user dialstring is expanded, the dialed_user ends up using the previous (replaced) value, which is incorrect. I've put some logs to see the behaviour:
Any idea how to solve this and keep the session in the originate from mod_callcenter.c |
|
Using a global mutex this actually work, but it could be a bad idea... about using a new channel mutex, what do you think? I'm testing this version:
|
This new mutex looks safer (assuming the fix is actually correct). |
thanks. ` `From the log i see the look/unlock sequence ok. i couldn't detect any deadlock or race condition to replace the dialed_user variable. I test simultaneous group call and is the same behaviour without my changes, so i guess that is ok. In my test scenario i have: when calling 2001, the lua script simulates a delay of 5s. case 1: hangup before any agent answer: if the agent is ringing the call is canceled, and after the sleep the other agents don't received the zombie call. EDITED: case 2: hangup after an agent answer: the others agents in ring state are canceled, except the one that is in sleeping after the sleep the agents is called and it ring, it hangup immediately when the agent answer or on timeout. |
… and prevent user endpoint race condition when expanding dial-string dialed_user variable in same session
4a01bfe
to
eefa209
Compare
try to fix #2529
Passing the member_session to the originate, when the dialstring is return to the originate it hangups the call, not sure if is the right solution, but it solves the issue about making the call to the agent.
attach the call log after applying the change.
freeswitch_afterpatch.log
I notice in past commits that the member_session was included in the originate and then removed:
included:
b4ada1b
removed:
ec44f5a
i try to reproduce the issue "Do not kick member out on timeout if originating to an agent" after my change, and i couldn't, the call is ok.