Page 1 of 1

AST_VDremote_agents.pl bug on 2.0.4?

PostPosted: Mon Dec 17, 2007 7:33 am
by gardo
I'm getting this error running /usr/share/astguiclient/AST_VDremote_agents.pl:

/usr/share/astguiclient/AST_VDremote_agents.pl --debugX
String found where operator expected at /usr/share/astguiclient/AST_VDremote_agents.pl line 245, near "echo "$stmt\n""
(Do you need to predeclare echo?)

Astguiclient 2.0.4
CentOS 5
Asterisk 1.2.24

As a side note, running the same /usr/share/astguiclient/AST_VDremote_agents.pl on Astguiclient 2.0.3 doesn't give out any errors and runs fine.

PostPosted: Thu Dec 20, 2007 1:26 am
by mflorell
looks like an echo command snuck into a perl script, I have changed it and committed it to SVN. It should only have made problems if you were running with the --debug flag.

Thanks for the bug catch!

PostPosted: Thu Dec 20, 2007 10:30 am
by seaq
Hi Matt, gardo, i run on this error, but after checking out svn i changed the echo for a print but now i'm getting this error

/usr/share/astguiclient/AST_VDremote_agents.pl
no command line options set
Undefined subroutine &main::mysql_query called at /usr/share/astguiclient/AST_VDremote_agents.pl line 245.

I'm using RHEL5 or CENTOS5.

i did install Net:MySQL...

perl -c /usr/share/astguiclient/AST_VDremote_agents.pl
/usr/share/astguiclient/AST_VDremote_agents.pl syntax OK
[root@asterisk0 ~]# perl -c /usr/lib/perl5/site_perl/5.8.8/Net/MySQL.pm
/usr/lib/perl5/site_perl/5.8.8/Net/MySQL.pm syntax OK

what could be the problem???

PostPosted: Thu Dec 20, 2007 10:33 am
by seaq
right now i've replaced the AST_VDremote_agents.pl script with the 2.0.3 version but i'm not sure about problems doing this....

PostPosted: Thu Dec 20, 2007 3:15 pm
by gardo
I haven't had the chance to try the SVN script for the remote agents yet. However, if I understood Matt correctly, you don't need to edit anything anymore on the script.

PostPosted: Fri Dec 21, 2007 2:41 am
by mflorell
and Net::MySQL is not used by VICIDIAL anymore...

PostPosted: Fri Dec 21, 2007 8:40 am
by gardo
Matt,

Any plans on having a scheduler for remote agents to automatically start dialing? Say for broadcast type campaigns. Something that looks like the agent callback option where one can choose which date to do the callbacks. Another option is to have it integrated in the "Call Times" section. Instead of just having days, starting and ending hours, a specific date can be chosen when the campaign will start and end.

Is this on the todo list? If not can you give some pointers on how to start with this feature.

PostPosted: Fri Dec 21, 2007 11:58 am
by mflorell
Sounds like a good thing to put in as a feature request into the issue tracker :)

PostPosted: Thu Jan 03, 2008 11:40 am
by ekaftan
seaq wrote:right now i've replaced the AST_VDremote_agents.pl script with the 2.0.3 version but i'm not sure about problems doing this....


Andres,

Thanks for this post, I did the same as you did and now its working.

PostPosted: Thu Jan 03, 2008 12:34 pm
by ekaftan
ekaftan wrote:
seaq wrote:right now i've replaced the AST_VDremote_agents.pl script with the 2.0.3 version but i'm not sure about problems doing this....


Andres,

Thanks for this post, I did the same as you did and now its working.


Following up to myself... I tried the script from 2.0.3 but dial statuses on leads were not updated (they got marked called, but stayed as NEW).

I then fixed AST_VDremote script with this patch:

diff -u AST_VDremote_agents.pl /usr/share/astguiclient/AST_VDremote_agents.pl
--- AST_VDremote_agents.pl 2007-12-07 08:04:41.000000000 -0300
+++ /usr/share/astguiclient/AST_VDremote_agents.pl 2008-01-03 14:20:15.000000000 -0300
@@ -241,12 +241,14 @@

##### grab number of calls today in this campaign and increment
$stmt="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE "R/%";";
- $rslt=mysql_query($stmt, $link);
- if ($DB) {echo "$stmt\n";}
- $vla_cc_ct = mysql_num_rows($rslt);
+ $sthA = $dbhA->prepare($stmt) or die "preparing: ",$dbhA->errstr;
+ $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
+ $sthArows=$sthA->rows;
+ if ($DB) { print "$stmt\n";}
+ $vla_cc_ct = $sthArows;
if ($vla_cc_ct > 0)
{
- $row=mysql_fetch_row($rslt);
+ $row = $sthA->fetchrow;
$calls_today =$row[0];
}
else


Remote agents now work, but call status on the list still dont get updated. What script should update the status?

thanks.

PostPosted: Thu Jan 24, 2008 7:15 pm
by ekaftan
ekaftan wrote:
ekaftan wrote:
seaq wrote:right now i've replaced the AST_VDremote_agents.pl script with the 2.0.3 version but i'm not sure about problems doing this....


Andres,

Thanks for this post, I did the same as you did and now its working.


Following up to myself... I tried the script from 2.0.3 but dial statuses on leads were not updated (they got marked called, but stayed as NEW).

I then fixed AST_VDremote script with this patch:

diff -u AST_VDremote_agents.pl /usr/share/astguiclient/AST_VDremote_agents.pl
--- AST_VDremote_agents.pl 2007-12-07 08:04:41.000000000 -0300
+++ /usr/share/astguiclient/AST_VDremote_agents.pl 2008-01-03 14:20:15.000000000 -0300
@@ -241,12 +241,14 @@

##### grab number of calls today in this campaign and increment
$stmt="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE "R/%";";
- $rslt=mysql_query($stmt, $link);
- if ($DB) {echo "$stmt\n";}
- $vla_cc_ct = mysql_num_rows($rslt);
+ $sthA = $dbhA->prepare($stmt) or die "preparing: ",$dbhA->errstr;
+ $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
+ $sthArows=$sthA->rows;
+ if ($DB) { print "$stmt\n";}
+ $vla_cc_ct = $sthArows;
if ($vla_cc_ct > 0)
{
- $row=mysql_fetch_row($rslt);
+ $row = $sthA->fetchrow;
$calls_today =$row[0];
}
else


Remote agents now work, but call status on the list still dont get updated. What script should update the status?

thanks.


Following up to myself again. The patch I made is working and call status do get updated (that was a different error, I had not installed FastAgi correctly.)

PostPosted: Fri Jan 25, 2008 8:10 am
by seaq
i haven't had the chance yet to check remote agents with 2.0.4 and 2.0.3, as soon as i get the chance i'll be testing this.

tnks

A patch of the solution that works for me - for now.

PostPosted: Mon Feb 04, 2008 12:35 pm
by sirevilknight
Guys,

I grabbed the copy of this file from the svn trunk and it is still broken.
The echo statement is patched in the trunk version but there is a section
of the code using the NET::MySQL API calls, apparently overlooked in the
rewrite? Anyway, I hope mflorell would be able to look at this issue and
patch the versions in the distribution.


Code: Select all
--- /usr/share/astguiclient/AST_VDremote_agents.pl      2008-02-04 09:46:36.000000000 -0500
+++ astguiclient-trunk/trunk/bin/AST_VDremote_agents.pl 2008-02-04 06:33:43.000000000 -0500
@@ -241,28 +241,16 @@
 
                ##### grab number of calls today in this campaign and increment
                $stmt="SELECT calls_today FROM vicidial_live_agents WHERE extension LIKE \"R/%\";";
-               ### $rslt=mysql_query($stmt, $link);
-
-               # if ($DB) { print "$stmt\n";}
-               # $vla_cc_ct = mysql_num_rows($rslt);
-               # if ($vla_cc_ct > 0)
-               #       {
-               #       $row=mysql_fetch_row($rslt);
-               #       $calls_today =$row[0];
-               #       }
-               #else
-               #       {$calls_today ='0';}
-
-               $sthAX = $dbhA->prepare($stmt) or die "preparing: ",$dbhA->errstr;
-                $sthAX->execute or die "executing: $stmt ", $dbhA->errstr;
-                $vla_cc_ct=$sthAX->rows;
+               $rslt=mysql_query($stmt, $link);
+               if ($DB) {print "$stmt\n";}
+               $vla_cc_ct = mysql_num_rows($rslt);
                if ($vla_cc_ct > 0)
-               {       # @rowAX = $sthAX->fetchrow_array;
-                       #$calls_today = "$rowAX[0]";
-               }else
-               {       $calls_today ='0';                      }
-                $sthAX->finish();
-
+                       {
+                       $row=mysql_fetch_row($rslt);
+                       $calls_today =$row[0];
+                       }
+               else
+                       {$calls_today ='0';}
                $calls_today++;
 
                $stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE',calls_today='$calls_today' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";";

Note on the solution above..

PostPosted: Mon Feb 04, 2008 12:46 pm
by sirevilknight
The code posted is a diff of my changes to the AST_VDremote_agents.pl file and the version in the 2.04 release and current svn trunk.

Anyone with this same issue should be able to copy the code and above
and use it to patch their copy of AST_VDremote_agents.pl.

Anyone with better knowledge of PEAR and DBI database API should can review the code changes for accuracy, they are made in a hurry and based on my best guess to get the system working... I am in no way a PEAR programmer.

PostPosted: Tue Feb 05, 2008 4:33 pm
by seaq
that explains this message after trying to run the script

/usr/share/astguiclient/AST_VDremote_agents.pl
no command line options set
Undefined subroutine &main::mysql_query called at /usr/share/astguiclient/AST_VDremote_agents.pl line 245.

it seems to be asking for Net::mysql