Can I save rtp media using asterisk?

I use asterisk transfer RTP packets using SIP. Is there any way to save the input and output RTP media data into wav file for check? or such of things.
Does asterisk or some tools support this?
Thanks!

For diagnostic purposes, use wireshark.

Asterisk decomposes RTP and reconstructs it at either side of the call. There are Monitor functions that will capture the audio payload, but not in the exact over the wire format.

Thanks for your quick reply.
I’m using the asterisk as a call agent to hand over rtp media data(only voice data) between a analog sending device and a IP IP receiving device(SIP). Sending device play a pcm file when transmitting and the receiving side pick it from rtp media and save as wave file.
I found the receiving missed some tones. I want to locate on which leg the tone is dropped throughout the process(sending, receiving or asterisk). Since the receiving app report no packet discarded and the sending seems OK, I doubt maybe the asterisk or the networks make the mistakes. I’m not sure. The transmitting lasts 72 hours long.

Wireshark shows every RTP packet, but I can’t see by eye from the packet. I mean at the receiving server, my app has parsed and construct all packet into a wave file and I can use audio tools open and SEE the audio wave picture. Wireshark seems not explicit. The packets is very huge in number.
Do you have any idea what I should do to find out the root cause? or any one can provide some idea?

Thanks.

Wireshark can play the files as audio, or export them to standard audio formats.

Missing tones may be the result of spoofing DTMF (or in the more general network, legacy network signalling tones).

Sending pure tones accurately requires that you use nothing more complicated than mu- or A-law codecs.