Way too many moons ago (17 years!), I started working with Asterisk. While I knew nothin’ about nothin’, my client had confidence in me and, after an on-site visit with Jared Smith in Utah, had confidence in Asterisk.
I designed my first application (an adult chat service) as a series of AGIs. Since, at the time, my sharpest tool was C, I wrote the AGIs in C. I didn’t find any ‘AGI in C’ library so I wrote one.
I was used to developing in C and using GDB (in Emacs) for debugging. Initally, I felt lost and out of control debugging by peppering my code with printfs and syslogs.
Then one day I had an epiphany that I could capture the console output with AGI debugging enabled, massage it with a shell script, and feed the dialog back into my code (in GDB, in Emacs) so I could step through my bugs much more effectively. Setting breakpoints, examining variables, and setting variables beats the hell out of printf/syslog.
I’ve used the same technique with AGIs written in Perl (in perldb, in Emacs).
It occurs to me that I have never seen this technique ‘in print.’
Is this a commonly known technique that everybody uses or does everybody pepper with printf/syslog, grip it, and rip it?