Deploying asterisk development and debug environment

Hi all! this is my first message on the asterisk community. I’ll keep it short:
What do you guys recommend to deploy an asterisk development and debugging environment.

For example:
which operating system, which IDE, which additional packages and if you could give a very short description on how to attach the debugger to a running asterisk.

PS:
I know these might be basic or noob questions, but please shed some light!

Thanks in advance

Hi!

Honestly, it’s each to their own, but a couple of points & packages that I would suggest that often help when developing on Asterisk:

Firstly, don’t fall down the pit that most people do that is try to containerise or run Asterisk in docker. Due to the networking requirements (especially RTP), you’ll need to open up a large range of UDP ports (10000-20000) and SIP (TCP/UDP 5060) which docker often has issues with when it comes to latency and even some memory leaks that i’m sure are now patched. Also due to it being containerised and completed abstracted away, asterisk sometimes can have some weird bugs that you’ll spend more time fruitlessly debugging. I often spin up a virtual machine that either is attached to my local network or host a network on the machine so it can communicate to any softphones on your computer.

Operating system - any linux distribution works within reason. I’ve run on Ubuntu, Debian and CentOS back in the day. Choose one that you’re familiar with and it’ll help

Tools - I would strongly advise using sipgrep or sngrep for packet captures live on your network for SIP ports so you see the call traces coming in and follow the flow and match it to your PJSIP and asterisk configurations. For more complex packet capturing, tshark and other tools are useful, but often heavyweight.

For debugging, it really depends on what you’re trying to debug. Could you give some examples of issues you’re facing to see? Worst comes to worst, you can use gdb to follow the code as it executes at a low level, but unless you know what you’re doing, it might be hard to follow. A good logging configuration is often enough with a SIP capture.

HTH

Thanks a lot for your reply!. I’ve worked with asterisk for some time now… I just want to get involved in the inner workings of asterisk by examining the C code.
GDB of course is a very good tool but very low level.
I was looking for something like Eclipse as an IDE (which I tried once to debug Asterisk and worked, but the source wasn’t getting correctly parsed by the IDE and couldn’t follow references).

Which IDE would you recommend as to inspect Asterisk’s source and correctly follow references and definitions, and if possible, to have a GUI to GDB like Eclipse does?
(Maybe saying which IDE is currently used to create Asterisk could be a good lead :slight_smile: )
Once again thanks for your time!

Hi ssherar, thanks for your reply… maybe you can recommend an IDE for asterisk C source development please?

Some use Eclipse, some use Sublime Text, some use VS Code, some use nano.