The pcap file contains all of the network header information as well as the rtp stream data you want.  In order to convert the rtp data to a wave file, you will first  need to extract the rtp stream payload from your network capture (pcap) file.  See the following links for procedures to do this:

https://ask.wireshark.org/questions/35353/exporting-payload-data-in-binary-file
https://ask.wireshark.org/questions/14078/decapsulation-of-data


On 3/30/16 9:52 AM, amani mansour wrote:
Dear sir i will use this file in the freeswitch whenn i will make a call  i will playback this (file.wav) 
i am certain that this file contains only rtp captured from wireshark 

thanks
best regards 
amani

2016-03-30 17:41 GMT+01:00 Giovanni Maruzzelli <gmaruzz@gmail.com>:

Google around again, you will find something.
>From wireshark gui interface, you must save the rtp streams and then convert. You will probanly find a script to do exactly that.

You muat pay attention that your pcap file contains the rtp streams too (not only sip signaling).

Anyway, this is a question you would better asks to the wireshark mailing list, is not a quewtion related to FreeSWITCH.

-giovanni

sent from mobile
cell: +39 347 266 56 18
Giovanni Maruzzelli
OpenTelecom.IT

Il 30/Mar/2016 18:37, "amani mansour" <amani.mansour2@gmail.com> ha scritto:
Hello ,

Please i need to convert pcap file to wav file with comman linux in freeswitch 
to play back this file .wav

i found this :
1 step : write a script to convert  pcap to wav  wich is :
ssrc=$(tshark -n -r /home/amani/projet/PFE/test.pcap  -R rtp -T fields -e rtp.ssrc -Eseparator=, | sort -u | awk 'FNR ==1 {print}')

echo $ssrc

sudo tshark -n -r /home/amani/projet/PFE/test.pcap   -R  rtp -R  "rtp.ssrc == $ssrc" -T fields -e rtp.payload | tee payloads

for payload in `cat payloads`; do IFS=:; for byte in $payload; do printf "\\x$byte" >> /home/amani/projet/PFE/test.raw; done; done

echo ‘sox has converted pcap to wav file’


sox -t raw -r 8000 -v 4 -c 1 -e mu-law  /home/amani/projet/PFE/test.raw /home/amani/projet/PFE/test.wav


==> but when i run this script  the error is :
tshark: -R without -2 is deprecated. For single-pass filtering use -Y.
‘sox has converted pcap to wav file’
sox FAIL formats: can't open input file `/home/amani/projet/PFE/test.raw': No such file or directory



Rq: paylods file is empty  :( 

please can  you help me ??? 

thanks 
with regards 
amani 

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_________________________________________________________________________
Professional FreeSWITCH Consulting Services: 
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org