for incoming: use xlog to print $mb inside request_route{} for SIP
requests and inside reply_route{} for SIP responses.
for outgoing: use xlog to print $snd(buf) inside onsend_route{} -- you
have to enable a parameter to catch the SIP responses:
https://www.kamailio.org/wiki/cookbooks/4.4.x/core#onsend_route_reply