Listening to UDP SIP port 5060 using Asterisk


I’m developping a C application that would allow me to create a socket and bind it to the port 5060 so that I can display all the messages that my Asterisk receives. So far, I can connect to 5060 but nothing is displayed.
First, is it possible to do what I’m trying to do? :smile:
If yes, is there any specific way to do that other than the traditional UDP listening port method?

Thank you very much for your help.


*CLI>sip set debug on does not do what you need ? If not I suggest picking a copy of ISBN 0201633469

Only one file descriptor can bind to any specific combination of port and interface at a time. If that file descriptor is read from one process, the message is read for all processes.

Most OSes have a diagnostic mode where all network traffic can be intercepted, as used by tcpdump and wireshark, and with lower level access with libraries like libpcap.