Debug Asterisk Functions

I have set up 3 clients (PJSUA) and an Asterisk Server. I want to debug and know which functions are being called for each request like INVITE, 100 Trying, Re-INVITE, REFER, NOTIFY, etc. in asterisk and pjsua command-line application (gnu). Can anyone guide me in this.

CLI: pjsip set logger {on|off|host|add|verbose|pcap} – Enable/Disable PJSIP Logger Output

I used this command to see the logger output or save as a log file. But in it, I can’t see or know that which functions is being called for which program for INVITE or Re-INVITE, etc. requests.

Have a look at: core set debug 42

This is really a developer question, but the only tool I know of that might help is the Doxygen documentation, that can be created when you build Asterisk. I don’t know if that extends to PJSIP. This will give static information, about what could be called, but would probably overestimate.

For a dynamic analysis, you would need to run the code interpretively, which would mean it would run orders of magnitude slower than normal. There is a tool, whose name I forgot, which was suggested for debugging memory management issues, which is, I believe, a more general interpretive debugger.

When I was working on parts of the code, I just just used manual code reading.

This may help you, although I haven’t evaluated it in detail:

https://fossies.org/dox/asterisk-17.9.4/index.html

gcc with -finstrument-functions is an option, but I’ve never used it for multi-threaded progs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.