[Freeswitch-users] Convert pcap file to wav file

amani mansour amani.mansour2 at gmail.com
Wed Mar 30 20:36:16 MSD 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160330/735c2110/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list