Raw packet logging with iptables and Wireshark

I've been doing a lot of work with Asterisk and SIP recently and have found that viewing the raw SIP packets in Wireshark is an incredibly useful tool when debugging. The logs that Asterisk and various phones provide tend to give fairly cryptic error messages that don't really resemble the issue, plus some problems are caused by a packet not arriving at all due to the other end sending an incorrect media address etc.