So this is the process we use:

Write a small shell script.
If the perl AGI is foo.pl, our script would be:
        #!/bin/bash

        ulimit -t 30

        if [ -f /tmp/debug_tty ]
        then
            TTY=`cat /tmp/debug_tty`
            export PERLDB_OPTS="TTY=$TTY ReadLine=0"
            DEBUG=5 perl -d foo.pl $* 2> $TTY
            exit $?
        else
            perl foo.pl $* 2> /tmp/foo-stderr-$$.log
            exit $?
        fi

To use the debugger replace this in the dialplan as your AGI.
with no special operation this will run just like the perl script does.

However if you log in to a shell on the server, and run:

echo `tty` > /tmp/debug_tty && chmod 666 `tty` && \
chmod 644 /tmp/debug_tty && sleep 12341234; rm -f /tmp/debug_tty

The next time the AGI launches it start in the debugger inside this
terminal that's in "sleep".  Now you need to remember to remove
the /tmp/debug_tty file or you'll get rather undesirable behavior.

Also, just to be safe, delete the /tmp/debug_tty and above command
between each instance.  If 2 people try to use the same AGI at once, the
behavior is not fun.

Good luck.

On Tue, 2005-07-12 at 18:23 +0500, danish moosa wrote:
> try verbose
> 
> On 7/12/05, Kamran Ahmad <[EMAIL PROTECTED]> wrote:
> > hello
> > 
> > i am trying to develop perl application for asterisk
> > with radius accounting how can i debug that weather
> > callback is working when call is stoped.
> > 
> > how can i check this
> > 
> > syslog('info', 'hello Asterisk!');
> > 
> > thanks
> > Kamran
> > 
> > 
> > 
> > ____________________________________________________
> > Sell on Yahoo! Auctions – no fees. Bid on great items.
> > http://auctions.yahoo.com/
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> > 
> 
> 

Reply via email to