# 90415-0925 - Fixed rare division by zero bug - questions

Discussions about development of VICIDIAL and astGUIclient

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

# 90415-0925 - Fixed rare division by zero bug - questions

Postby bobbymc » Mon Jun 10, 2013 7:59 pm

in AST_VDadapt.pl can you point out where int he code this fix was made please?
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby DomeDan » Wed Jun 12, 2013 5:20 am

It was easy to find using git and tig
Code: Select all
diff --git a/bin/AST_VDadapt.pl b/bin/AST_VDadapt.pl
index 7bae877..58fd250 100644
--- a/bin/AST_VDadapt.pl
+++ b/bin/AST_VDadapt.pl
@@ -27,6 +27,7 @@
 # 81021-2201 - Deactivated queue_log QUEUESTART event
 # 81022-0713 - Added gathering of vicidial_inbound_groups stats(day only)
 # 81108-0808 - Added more inbound stats with some debug output and added campaign agent non-pause time
+# 90415-0925 - Fixed rare division by zero bug
 #

 # constants
@@ -1497,8 +1498,16 @@ if ( ($dial_method[$i] =~ /ADAPT_HARD_LIMIT|ADAPT_AVERAGE|ADAPT_TAPERED/) || ($f
        {
        # Calculate the optimal dial_level differential for the past minute
        $differential_target[$i] = ($differential_onemin[$i] + $adaptive_dl_diff_target[$i]);
-       $differential_mul[$i] = ($differential_target[$i] / $agents_average_onemin[$i]);
-       $differential_pct_raw[$i] = ($differential_mul[$i] * 100);
+       if ( ($differential_target[$i] != 0) && ($agents_average_onemin[$i] != 0) )
+               {
+               $differential_mul[$i] = ($differential_target[$i] / $agents_average_onemin[$i]);
+               $differential_pct_raw[$i] = ($differential_mul[$i] * 100);
+               }
+       else
+               {
+               $differential_mul[$i] = 0;
+               $differential_pct_raw[$i] = 0;
+               }
        $differential_pct[$i] = sprintf("%.2f", $differential_pct_raw[$i]);

        # Factor in the intensity setting
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby bobbymc » Sat Jun 15, 2013 3:42 pm

the repo is a svn repo. how did you know what revision to check out and how did u check out the revision? im very familiar with git and hg but no svn =(
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby DomeDan » Mon Jun 17, 2013 3:46 am

git works with svn too :)
Code: Select all
git svn clone svn://svn.eflo.net:3690/agc_2-X/trunk
tig #browse commits
git svn rebase #check for updates in trunk

and when I was looking for #90415-0925 I just checked the commits committed after 2009-04-15 09:25 using tig
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby bobbymc » Mon Jun 17, 2013 5:51 am

sorry for the newb question but git apparently doesn't know about the svn command:

git: 'svn' is not a git-command. See 'git --help'.
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby bobbymc » Mon Jun 17, 2013 5:53 am

sorry found it.. apt-get install git-svn
bobbymc
 
Posts: 425
Joined: Fri Jan 05, 2007 12:26 am

Re: # 90415-0925 - Fixed rare division by zero bug - questio

Postby DomeDan » Mon Jun 17, 2013 5:56 am

oh yeah forgot that you need to install that package
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden


Return to Development

Who is online

Users browsing this forum: No registered users and 26 guests