Page 1 of 1

need help debugging AST_VDauto_dial.pl

PostPosted: Wed Apr 27, 2016 2:06 am
by bobbymc
im trying to understand what the reason for this is. why do we check if the caller id is bigger then 17 characters and has x digits in a row and below if we check calls unique id is bigger then 11 and the CLuniqueid if ever fetched from the call log table is less then 12 we override the epoch and unique id identifier?

matt any light you can shed on this would be greatly appreciated.

thank you

Code: Select all

                                if ( (length($KLcalleridCHECK[$kill_vac]) > 17) && ($KLcalleridCHECK[$kill_vac] =~ /\d\d\d\d\d\d\d\d\d\d\d\d\d\d/) )
                                        {
                                        $stmtA = "SELECT end_epoch,uniqueid,start_epoch FROM call_log where caller_code='$KLcallerid[$kill_vac]' and server_ip='$KLserver_ip[$kill_vac]' order by end_epoch, start_time desc limit 1;";
                                        $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
                                        $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
                                        $sthArows=$sthA->rows;
                                        $rec_count=0;
                                        $rec_countCUSTDATA=0;
                                        while ($sthArows > $rec_count)
                                                {
                                                @aryA = $sthA->fetchrow_array;
                                                $end_epoch              = $aryA[0];
                                                $CLuniqueid             = $aryA[1];
                                                $start_epoch    = $aryA[2];
                                                $rec_count++;
                                                }
                                        $sthA->finish();
                                        }

                                if ( (length($KLuniqueid[$kill_vac]) > 11) && (length($CLuniqueid) < 12) )
                                        {
                                        $stmtA = "SELECT end_epoch,uniqueid,start_epoch FROM call_log where uniqueid='$KLuniqueid[$kill_vac]' and server_ip='$KLserver_ip[$kill_vac]' order by end_epoch, start_time desc limit 1;";
                                        $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
                                        $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
                                        $sthArows=$sthA->rows;
                                        $rec_count=0;
                                        $rec_countCUSTDATA=0;
                                        while ($sthArows > $rec_count)
                                                {
                                                @aryA = $sthA->fetchrow_array;
                                                $end_epoch              = $aryA[0];
                                                $CLuniqueid             = $aryA[1];
                                                $start_epoch    = $aryA[2];
                                                $rec_count++;
                                                }
                                        $sthA->finish();
                                        }


Re: need help debugging AST_VDauto_dial.pl

PostPosted: Wed Apr 27, 2016 5:46 am
by mflorell
Can't think of a reason off the top of my head, but that script was mostly written 10 years ago, so I would have to go through all of the code in that script to figure out why it's doing that. My guess is that's in the validation of vicidial_auto_calls section, so it's probably searching for the proper call_log record to use(since there can be more than one.)

Re: need help debugging AST_VDauto_dial.pl

PostPosted: Thu Apr 28, 2016 2:23 am
by bobbymc
thank you for the feedback