[Asterisk-Users] how to debug perl agi

Juan J. Sierralta P. sierralta at gmail.com
Thu Jul 14 05:28:04 MST 2005


Hi,

> > syslog('info', 'hello Asterisk!');
> 
> That should go into the syslog for the facility "user". It may end up on
> /var/log/messages , /var/log/user.log or whereever your system sends
> such log entries.
> 
> But why not print to STDERR? IIRC the stderr of AGI scripts goes to the
> asterisk console.

     Dunno but at least ASTCC as lot of prints to STDERR but none of
these appeared on my console.
     BTW I had to patch last ASTCC CVS since it wasn't getting the call time:

--- /home/juanjo/voip/astcc/astcc.agi   2005-07-11 03:28:06.000000000 -0400
+++ astcc.agi   2005-07-12 01:48:41.000000000 -0400
@@ -329,9 +329,10 @@

 sub calccost() {
        my ($adjconn, $adjcost, $answeredtime, $increment) = @_;
-       eval { my $adjtime = int(($answeredtime + $increment - 1) /
$increment) * $increment };
+       my $adjtime = int(($answeredtime + $increment - 1) /
$increment) * $increment;
        my $cost;

I'm using Perl 5.8:

juanjo at vox:~$ perl -v

This is perl, v5.8.4 built for i386-linux-thread-multi
Copyright 1987-2004, Larry Wall



More information about the asterisk-users mailing list