[Asterisk-Dev] Does anyone know how to get a perl debugger to launch when a perl AGI gets called

James Golovich james at wwnet.net
Thu Sep 25 09:49:46 MST 2003


On Thu, 25 Sep 2003, Fats Neutron wrote:

> I have been trying to figure this one out and decided ask the list as you
> probably have an answer.
> 
> What I am trying to do is setup a perl dev environment so that I can write
> an AGI script for interfacing with Asterisk. Before I get started I want to
> ensure I can launch the debugger when the script gets run from asterisk so
> that I can step through the code during testing.
> 
> I have been looking at maybe using the perl environment called Komodo on
> Linux from Active State. It's a pretty straight format IDE and relatively
> cheap.
> 
> Have anyone managed to do boot the debuggers on entry top the agi and what
> tools do you use for perl development.
> 
> Thanks in advance for your help.

Unfortunately there is no good way to use perl's built in debugger on an
AGI script unless you play the part of asterisk and respond to all the AGI
commands like asterisk would.

but there is hope

There is a really great debugger out there for perl (it requires X and
the Tk modules for perl) called Devel::ptkdb (should be available on cpan
or search on google).

Just change the first line of your code to
#!/usr/bin/perl -d:ptkdb

Ideally you shouldn't be running X on your asterisk server anyways, so you
should set the DISPLAY environment variable to go to a remote X console
(or use ssh with X forwarding enabled which sets all that up for you)

James




More information about the asterisk-dev mailing list