From 2e994b98c9a9465ae8c3c77cd28211d3f4a8ca82 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 5 May 2011 20:22:21 +0000 Subject: [PATCH] Fixed minor voicemail issue git-svn-id: svn://192.168.202.10@1653 3d104415-ff17-0410-8863-d5cf3c621b8a --- agi/agi-VDAD_ALL_inbound.agi | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index 145a4225..9554d9b6 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -148,6 +148,7 @@ # 110303-2338 - Added on-hook agent compatibility and rewrote a few sections # 110324-2330 - Added recording of remote agent calls, per in-group and campaign recording settings # 110325-1409 - Added user recording override settings checking for remote agent recording +# 110505-1620 - Fixed minor voicemail issue # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -4027,21 +4028,27 @@ if ($drop_timer > $DROP_TIME) $drop_action = $user_unavailable_action; $drop_inbound_group = $did_in_group; } - $VDADvoicemail_ext = $did_voicemail_ext; if (length($did_voicemail_ext) < 1) { - ### Grab user's voicemail ID from the database - $stmtA = "SELECT voicemail_id 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='02130'; $MEL_aff_rows=$sthArows; &mysql_error_logging; - if ($sthArows > 0) + if ($VDADvoicemail_ext =~ /AGENTVMAIL/) { - @aryA = $sthA->fetchrow_array; - $VDADvoicemail_ext = $aryA[0]; + ### Grab user's voicemail ID from the database + $stmtA = "SELECT voicemail_id 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='02130'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $VDADvoicemail_ext = $aryA[0]; + } + $sthA->finish(); } - $sthA->finish(); + } + else + { + $VDADvoicemail_ext = $did_voicemail_ext; } }