From: Italo Rossi Date: Mon, 22 Jun 2015 20:51:08 +0000 (-0300) Subject: FS-7467: mod_callcenter - Fixing uuid-standby agents. X-Git-Tag: v1.6.2~406 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be3c8686555a134389abdfd89ddf5d8bffd06d30;p=thirdparty%2Ffreeswitch.git FS-7467: mod_callcenter - Fixing uuid-standby agents. --- diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index f1ce9651e5..c9681993b0 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1773,15 +1773,19 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa playback_array(agent_session, o_announce); } - switch_ivr_uuid_bridge(h->member_session_uuid, switch_core_session_get_uuid(agent_session)); - - switch_channel_set_variable(member_channel, "cc_agent_uuid", agent_uuid); - /* This is used for the waiting caller to quit waiting for a agent */ switch_channel_set_variable(member_channel, "cc_agent_found", "true"); + switch_channel_set_variable(member_channel, "cc_agent_uuid", agent_uuid); + switch_ivr_uuid_bridge(h->member_session_uuid, switch_core_session_get_uuid(agent_session)); + switch_channel_wait_for_flag(agent_channel, CF_BRIDGED, SWITCH_TRUE, 1000, NULL); /* Wait until the agent hangup. This will quit also if the agent transfer the call */ while(switch_channel_up(agent_channel) && globals.running) { + if (!strcasecmp(h->agent_type, CC_AGENT_TYPE_UUID_STANDBY)) { + if (!switch_channel_test_flag(agent_channel, CF_BRIDGED)) { + break; + } + } switch_yield(100000); } tiers_state = CC_TIER_STATE_READY;