[asterisk-users] URgent - capturing 'answered'

Steve Edwards asterisk.org at sedwards.com
Mon Jul 26 13:09:56 CDT 2010


On Mon, 26 Jul 2010, Andres wrote:

> When I troubleshoot AGI scripts, I output stuff to text files for 
> debugging purposes.  I suggest you output all your variables to a file 
> and then you will learn if the variables do have the info you need.
>
> Something like: $message="/bin/echo my variables are '$loc', 
> '$variable1', '$variable2', etc >> /tmp/variables.txt"; 
> system("$message");

I prefer syslog().

) You don't litter your system with little files.

) You get nicely timestamped messages you can centralize across servers.

) You can control how much "verbosity" you want by setting the logging 
priority.

) You can vary the logging priority at run time.

) You can leave the logging code in place in production.

I code all of my AGIs to recognize (via getopt_long()) --debug and 
--verbose command line options. When something weird starts to happen, I 
can enable debugging in the dialplan and debug the code that is running in 
production.

-- 
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards       sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                              Fax: +1-760-731-3000



More information about the asterisk-users mailing list