Asterisk Security -- Logging all SIP connections?

Hi all! I wonder if it is possible to log the ip address of all sip connections (peers, users)?

This morning I woke up to an asterisk console with notifications that calls to international connections failed due to extension not found. There were several attempts throughout the night. None were successful. I still would like to know where these connections came from so I can figure out who is trying to breach my system.

you could add an “s” extension to whatever context they are falling into and access some of the SIP channel variables. I am not totally sure what all is available from the dialplan…

I ended up just installing snort and making a rule to catch this. If there is a way within asterisk to do this, I didn’t find it. I am more familiar with catching this type of thing through IDS anyways.