[Freeswitch-users] Stale channels with mod_callcenter in uuid-standby mode
Saumar Hajjar
saumar at uol.com.br
Thu Apr 23 20:37:12 MSD 2015
(Reposting: the 1st "version" didn't reach the list for some reason)
After a mod_callcenter member hangs up, its channel is still present in
the system, and its uuid is unkillable.
I believe FS team calls it a "stale channel".
The uuid-standby agent won't receive any more calls, until he/she hangs
up - what would make uuid-standby a "agent hangup and call again" mode.
What I'm trying to do, is nothing fancy. Basically I'm following the
mod_callcenter documentation without much tweaking.
Here's the test case setup:
- Freeswitch with default config, mod_callcenter enabled also with
default config
Tested with the following versions:
1.4.18+git~20150312T185523Z~4eed221b69~64bit (git 4eed221 2015-03-12
18:55:23Z 64bit)
1.5.15b+git~20150117T062211Z~46cf8a4dce~64bit (git 46cf8a4 2015-01-17
06:22:11Z 64bit)
1.5.15b+git~20150421T235828Z~a4d877c189~64bit (git a4d877c 2015-04-21
23:58:28Z 64bit)
- Dialplan mod_callcenter entries:
<!-- Member dials *91 to enter queue support at default -->
<extension>
<condition field="destination_number" expression="^\*91$">
<action application="callcenter" data="support at default"/>
</condition>
</extension>
<!-- Agent dials 4099 to wait for uuid-standby calls -->
<extension>
<condition field="destination_number" expression="^(4099)$">
<action application="set" data="transfer_after_bridge=4099"/>
<!-- Remove this if you just want to get a single call -->
<action application="sleep" data="300"/> <!-- Small delay for
safety needs -->
<action application="set" data="res=${callcenter_config(agent
set uuid ${caller_id_number}@default '${uuid}')}" />
<action application="set" data="res=${callcenter_config(agent
set type ${caller_id_number}@default 'uuid-standby')}" />
<action application="set" data="res=${callcenter_config(agent
set status ${caller_id_number}@default 'Available (On Demand)')}" />
<action application="set" data="res=${callcenter_config(agent
set state ${caller_id_number}@default 'Waiting')}" />
<action application="set"
data="cc_warning_tone=tone_stream://%(200,0,500,600,700)"/>
<action application="answer" />
<action application="playback" data="$${hold_music}"/>
</condition>
</extension>
- Start FS and add a test agent:
callcenter_config agent add 1002 at default uuid-standby
- Agent (extension 1002) dials 4099:
The agent starts hearing music on hold.
show channels
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,dialplan,context,read_codec,read_rate,read_bit_rate,write_codec,write_rate,write_bit_rate,secure,hostname,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,sent_callee_name,sent_callee_num,initial_cid_name,initial_cid_num,initial_ip_addr,initial_dest,initial_dialplan,initial_context
a1c9b1a4-7926-4da9-9041-100df3d1bbbb,inbound,2015-04-22
18:01:46,1429736506,sofia/internal/1002 at 192.168.0.136,CS_EXECUTE,1002,1002,192.168.0.103,4099,playback,local_stream://moh,XML,default,PCMU,8000,64000,PCMU,8000,64000,,hajjar-notebook,1002@192.168.0.136,,ACTIVE,,,,,,,1002,1002,192.168.0.103,4099,XML,default
callcenter_config agent list
name|system|uuid|type|contact|status|state|max_no_answer|wrap_up_time|reject_delay_time|busy_delay_time|no_answer_delay_time|last_bridge_start|last_bridge_end|last_offered_call|last_status_change|no_answer_count|calls_answered|talk_time|ready_time
1002 at default|single_box|a1c9b1a4-7926-4da9-9041-100df3d1bbbb|uuid-standby||Available
(On
Demand)|Waiting|1|5|0|5|5|1429734669|1429735319|1429734669|1429736506|0|0|0|0
- Member (extension 1000) dials *91:
The member gets bridged to the uuid-stand by agent. Great.
show channels
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,dialplan,context,read_codec,read_rate,read_bit_rate,write_codec,write_rate,write_bit_rate,secure,hostname,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,sent_callee_name,sent_callee_num,initial_cid_name,initial_cid_num,initial_ip_addr,initial_dest,initial_dialplan,initial_context
a1c9b1a4-7926-4da9-9041-100df3d1bbbb,inbound,2015-04-22
18:01:46,1429736506,sofia/internal/1002 at 192.168.0.136,CS_EXCHANGE_MEDIA,1000,1000,192.168.0.103,4099,uuid_bridge,d298fa41-b855-4027-ba4a-ac112df641d5,XML,default,PCMU,8000,64000,PCMU,8000,64000,,hajjar-notebook,1002 at 192.168.0.136,,ACTIVE,1002,1002,SEND,d298fa41-b855-4027-ba4a-ac112df641d5,1000,1000,1002,1002,192.168.0.103,4099,XML,default
d298fa41-b855-4027-ba4a-ac112df641d5,inbound,2015-04-22
18:04:47,1429736687,sofia/internal/1000 at 192.168.0.136,CS_SOFT_EXECUTE,1000,1000,192.168.0.120,*91,uuid_bridge,a1c9b1a4-7926-4da9-9041-100df3d1bbbb,XML,default,PCMU,8000,64000,PCMU,8000,64000,,hajjar-notebook,1000 at 192.168.0.136,,ACTIVE,1002,1002,SEND,d298fa41-b855-4027-ba4a-ac112df641d5,1002,1002,1000,1000,192.168.0.120,*91,XML,default
2 total.
show calls
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,hostname,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_presence_id,b_presence_data,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_sent_callee_name,b_sent_callee_num,call_created_epoch
d298fa41-b855-4027-ba4a-ac112df641d5,inbound,2015-04-22
18:04:47,1429736687,sofia/internal/1000 at 192.168.0.136,CS_SOFT_EXECUTE,1000,1000,192.168.0.120,*91,1000 at 192.168.0.136,,ACTIVE,1002,1002,SEND,d298fa41-b855-4027-ba4a-ac112df641d5,hajjar-notebook,1002,1002,a1c9b1a4-7926-4da9-9041-100df3d1bbbb,inbound,2015-04-22
18:01:46,1429736506,sofia/internal/1002 at 192.168.0.136,CS_EXCHANGE_MEDIA,1000,1000,192.168.0.103,4099,1002 at 192.168.0.136,,ACTIVE,1002,1002,SEND,1000,1000,1429736687
1 total.
callcenter_config agent list
name|system|uuid|type|contact|status|state|max_no_answer|wrap_up_time|reject_delay_time|busy_delay_time|no_answer_delay_time|last_bridge_start|last_bridge_end|last_offered_call|last_status_change|no_answer_count|calls_answered|talk_time|ready_time
1002 at default|single_box|a1c9b1a4-7926-4da9-9041-100df3d1bbbb|uuid-standby||Available
(On Demand)|In a queue
call|1|5|0|5|5|1429736687|1429735319|1429736687|1429736506|0|1|0|0
- Member hangs up
show channels
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,dialplan,context,read_codec,read_rate,read_bit_rate,write_codec,write_rate,write_bit_rate,secure,hostname,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,sent_callee_name,sent_callee_num,initial_cid_name,initial_cid_num,initial_ip_addr,initial_dest,initial_dialplan,initial_context
a1c9b1a4-7926-4da9-9041-100df3d1bbbb,inbound,2015-04-22
18:01:46,1429736506,sofia/internal/1002 at 192.168.0.136,CS_EXECUTE,1002,1002,192.168.0.103,4099,playback,local_stream://moh,XML,default,PCMU,8000,64000,PCMU,8000,64000,,hajjar-notebook,1002@192.168.0.136,,ACTIVE,1000,1000,RECV,d298fa41-b855-4027-ba4a-ac112df641d5,,,1002,1002,192.168.0.103,4099,XML,default
d298fa41-b855-4027-ba4a-ac112df641d5,inbound,2015-04-22
18:04:47,1429736687,sofia/internal/1000 at 192.168.0.136,CS_SOFT_EXECUTE,1000,1000,192.168.0.120,*91,uuid_bridge,a1c9b1a4-7926-4da9-9041-100df3d1bbbb,XML,default,PCMU,8000,64000,PCMU,8000,64000,,hajjar-notebook,1000 at 192.168.0.136,,ACTIVE,1002,1002,SEND,d298fa41-b855-4027-ba4a-ac112df641d5,1002,1002,1000,1000,192.168.0.120,*91,XML,default
2 total.
show calls
uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,hostname,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_presence_id,b_presence_data,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_sent_callee_name,b_sent_callee_num,call_created_epoch
d298fa41-b855-4027-ba4a-ac112df641d5,inbound,2015-04-22
18:04:47,1429736687,sofia/internal/1000 at 192.168.0.136,CS_SOFT_EXECUTE,1000,1000,192.168.0.120,*91,1000 at 192.168.0.136,,ACTIVE,1002,1002,SEND,d298fa41-b855-4027-ba4a-ac112df641d5,hajjar-notebook,1002,1002,a1c9b1a4-7926-4da9-9041-100df3d1bbbb,inbound,2015-04-22
18:01:46,1429736506,sofia/internal/1002 at 192.168.0.136,CS_EXECUTE,1002,1002,192.168.0.103,4099,1002 at 192.168.0.136,,ACTIVE,1000,1000,RECV,,,1429736687
1 total.
callcenter_config agent list
name|system|uuid|type|contact|status|state|max_no_answer|wrap_up_time|reject_delay_time|busy_delay_time|no_answer_delay_time|last_bridge_start|last_bridge_end|last_offered_call|last_status_change|no_answer_count|calls_answered|talk_time|ready_time
1002 at default|single_box|a1c9b1a4-7926-4da9-9041-100df3d1bbbb|uuid-standby||Available
(On
Demand)|Waiting|1|5|0|5|5|1429736687|1429735319|1429736687|1429736990|0|1|0|0
Here the agent gets transfered back to uuid-standby extension and
restarts hearing moh.
Its state is "Waiting" - but he/she won't answer new calls. But the
state is "Waiting" only because it got overridden by the dialplan.
In my tests, removing the callcenter_config(agent set state..) from
dialplan (and controlling agent state via CLI), I've noticed that the
agent state never gets back to "Idle" (if On Demand) or "Waiting". It
gets stuck in "In a queue call".
Trying to uuid_kill the member uuid, results in -ERR No such channel!
- When agent finally hangs up:
2015-04-22 18:21:56.804183 [NOTICE] sofia.c:952 Hangup
sofia/internal/1002 at 192.168.0.136 [CS_EXECUTE] [NORMAL_CLEARING]
2015-04-22 18:21:56.824219 [NOTICE] switch_core_session.c:1641 Session 6
(sofia/internal/1000 at 192.168.0.136) Ended
2015-04-22 18:21:56.824219 [NOTICE] switch_core_session.c:1645 Close
Channel sofia/internal/1000 at 192.168.0.136 [CS_DESTROY]
2015-04-22 18:21:57.104198 [NOTICE] switch_core_session.c:1641 Session 4
(sofia/internal/1002 at 192.168.0.136) Ended
2015-04-22 18:21:57.104198 [NOTICE] switch_core_session.c:1645 Close
Channel sofia/internal/1002 at 192.168.0.136 [CS_DESTROY]
show channels, show calls return 0
If callcenter_config(agent set state...) is commented out in dialplan,
callcenter_config agent list shows the agent as "Idle". Meaning
mod_callcenter only perceives the call has been disconnected, after the
agent hangs up...
I'm not blaming mod_callcenter - maybe it's related to
transfer_after_bridge.
I already tried using exec_after_bridge_app/arg to a script that sleeps
and transfer back to 4099. I also tried increasing the dialplan sleep.
I'd appreciate any advice on how to make uuid-standby work.
Thanks in advance,
Saumar
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list