Take network traces on your media gateway or and the node which proxy RTP packets through tcpdump or tshark. I prefer using tcpdump.
tcpdump -i any -s 0 -w amr-wb.pcap
Open amr-wb.pcap file using Wireshark.
Go to Telephony --> RTP --> RTP Streams.
and click Analyze. Save synchronized stream audio.
Name the file and save the AMR-WB stream in raw format.
now find an amr.py script from here or download. Open the terminal and execute the following command.
$ python amr.py -w -v amr-wb.raw
AMR-WB, bandwidth efficient, 1 channel(s)
Files: amr-wb.raw -> amr-wb.amr
Done, 1607 samples converted
This command will convert raw data to AMR format. now convert amr format to mp3 using ffmpeg library.
$ ffmpeg -i amr-wb.amr amr-wb.mp3
[amr @ 0x7fde98812800] Estimating duration from bitrate, this may be inaccurate
Input #0, amr, from 'amr-wb.amr':
Duration: 00:00:32.14, bitrate: 23 kb/s
Stream #0:0: Audio: amr_wb (sawb / 0x62776173), 16000 Hz, mono, flt
Stream mapping:
Stream #0:0 -> #0:0 (amr_wb (amrwb) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'amr-wb.mp3':
Metadata:
TSSE : Lavf58.45.100
Stream #0:0: Audio: mp3 (libmp3lame), 16000 Hz, mono, fltp
Metadata:
encoder : Lavc58.91.100 libmp3lame
size= 95kB time=00:00:32.15 bitrate= 24.1kbits/s speed= 207x
video:0kB audio:94kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.232775%
amr-wb.amr has been converted to amr-wb.mp3. You can listen to this file through any media player.
Enjoy ;)