From e4cf584dff918867a75549ed322776e795f53700 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 7 Jul 2011 11:42:00 +0000 Subject: [PATCH] Added ability to use AGENTEXT in AGENTDIRECT in-groups as a way to send dropped, no-agent-no-queue and other transferred calls to a specific dialplan number per-user defined in the User Custom Five field git-svn-id: svn://192.168.202.10@1688 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 4 + agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 83 ++++++++++++++++++- .../TO_BE_TRANSLATED_2.4.txt | 4 + agc_2-X/trunk/www/vicidial/admin.php | 17 ++-- 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 0cf53846..3be1f034 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -635,6 +635,10 @@ OTHER CHANGES: 142. Added ability to check for USA and Canada valid prefix and areacodes when loading leads into the web/cli/api lead loaders +143. Added ability to use AGENTEXT in AGENTDIRECT in-groups as a way to send + dropped, no-agent-no-queue and other transferred calls to a specific + dialplan number per-user defined in the User Custom Five field. + diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 9285cfc9..7de78056 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -151,6 +151,7 @@ # 110505-1620 - Fixed minor voicemail issue # 110525-1555 - Added CLOSER compatibility with outbound and in-group calls that went through Call Menu # 110626-2343 - Added queuemetrics_pe_phone_append +# 110707-0646 - Added AGENTEXT option in drop message to send to extension(user_custom_five) field # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -1028,7 +1029,6 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st { if ($after_hours_action =~ /EXTENSION/) { - $DROPexten = "$after_hours_exten"; $CIDcampaign_cid='0000000000'; ### Grab ID values from the database $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; @@ -1044,6 +1044,23 @@ if ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $ct_st } $sthA->finish(); + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($after_hours_exten =~ /AGENTEXT/) ) + { + ### Grab user's custom_five field from the database + $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $after_hours_exten = $aryA[0]; + } + $sthA->finish(); + } + $DROPexten = "$after_hours_exten"; + $newcallerid = "\"$callerid <$CIDcampaign_cid>\""; $AGI->set_callerid($newcallerid); print STDERR "Setting CID \"$newcallerid\"\n"; @@ -1172,6 +1189,7 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) $group_agents_count = $aryA[0]; } $sthA->finish(); + if ($AGILOG) {$agi_string = "-- NANQUE Check: |$group_agents_count|$stmtA"; &agi_output;} if ($group_agents_count < 1) { @@ -1223,6 +1241,22 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) $DROPexten = $EXno_agent_action_value[0]; $ext_context = $EXno_agent_action_value[1]; + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) + { + ### Grab user's custom_five field from the database + $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $DROPexten = $aryA[0]; + } + $sthA->finish(); + } + $CIDcampaign_cid='0000000000'; ### Grab ID values from the database $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; @@ -3283,6 +3317,22 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) ) { $DROPexten = "$wait_time_option_exten"; + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) + { + ### Grab user's custom_five field from the database + $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $DROPexten = $aryA[0]; + } + $sthA->finish(); + } + $CIDcampaign_cid='0000000000'; ### Grab ID values from the database $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; @@ -3689,6 +3739,22 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) ) { $DROPexten = "$hold_time_option_exten"; + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) + { + ### Grab user's custom_five field from the database + $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $DROPexten = $aryA[0]; + } + $sthA->finish(); + } + $CIDcampaign_cid='0000000000'; ### Grab ID values from the database $stmtA = "SELECT campaign_id,campaign_cid FROM vicidial_campaigns where closer_campaigns LIKE \"% $channel_group %\" and active='Y';"; @@ -4080,6 +4146,21 @@ if ($drop_timer > $DROP_TIME) { if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && (length($user_unavailable_action) > 1) ) { + if ($drop_exten =~ /AGENTEXT/) + { + ### Grab user's custom_five field from the database + $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $did_extension = $aryA[0]; + } + $sthA->finish(); + } $drop_exten = $did_extension; $ext_context = $did_exten_context; } diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index dcbcc7bd..408925c6 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -646,6 +646,10 @@ PLACE TEST CALL|| Test Outbound Call|| Agents Calls Reset|| This setting defines whether the logged-in agents and active phone calls records are to be reset at the timeclock end of day. Default is 1 for enabled|| +The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number|| +For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|| +For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number|| +You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number|| lead_report_export.php diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 582849ed..41e0fc0e 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2779,12 +2779,13 @@ else # 110624-2246 - Added Screen Labels subsection for Admin and status_display_fields feature # 110625-2338 - Added queuemetrics_pe_phone_append option # 110703-1400 - Added test_campaign_calls and agents_calls_reset features +# 110707-0725 - Added AGENTEXT notes for in-groups settings # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.4-322a'; -$build = '110703-1400'; +$admin_version = '2.4-323a'; +$build = '110707-0725'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -4008,7 +4009,7 @@ if ($ADD==99999)

- Custom User Fields - These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on. + Custom User Fields - These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on. The Custom 5 field can be used as a field to define a dialplan number to send a call to from an AGENTDIRECT in-group if the user is unavailable, you just need to put AGENTEXT in the MESSAGE or EXTENSION field in the AGENTDIRECT in-group and the system will look up the custom five field and send the call to that dialplan number.
@@ -5375,7 +5376,7 @@ if ($ADD==99999)

- Drop Exten - If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds. + Drop Exten - If Drop Action is set to MESSAGE, this is the dial plan extension that the call will be sent to if it reaches Drop Call Seconds. For AGENTDIRECT in-groups, if the user is unavailable, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
@@ -5405,7 +5406,7 @@ if ($ADD==99999)

- After Hours Extension - The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. + After Hours Extension - The dialplan extension to send the call to if the Action is set to EXTENSION. Default is 8300. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
@@ -5420,7 +5421,7 @@ if ($ADD==99999)

- No Agents No Queueing - If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use. + No Agents No Queueing - If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use. You can also put AGENTEXT in this field if it is set to EXTENSION and the system will look up the user custom five field and send the call to that dialplan number.
@@ -5520,7 +5521,7 @@ if ($ADD==99999)

- Wait Time Option Extension - If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. + Wait Time Option Extension - If Wait Time Option is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.
@@ -5595,7 +5596,7 @@ if ($ADD==99999)

- Hold Time Option Extension - If Hold Time Option is set to EXTENSION, this is the dialplan extension that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. + Hold Time Option Extension - If Hold Time Option is set to EXTENSION, this is the dialplan extension that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. For AGENTDIRECT in-groups, you can put AGENTEXT in this field and the system will look up the user custom five field and send the call to that dialplan number.