Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


RTP Reassembly

No description

Brian Warner

on 12 May 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of RTP Reassembly

RTP Reassembly Rebuilding the Stream
and Validating a Call by
Human Speech Packet Capture Can we do more? It turns out Google will transcode audio Filtering Output Sending the Flac tshark -a duration:20 -w sip_1call.pcap How about we transcribe the human
speech in that wav, to text. Then
compare the transcription to the
expected text. So we just need to convert the file
to something Google likes: We use wget to send this to Google
and get a respones back: RTP Stream selector Assign a variable to find the stream
indicators (ssrc): ssrc=$(sudo tshark -n -r sip_1call.pcap -R rtp -T fields -e rtp.ssrc -Eseparator=, | sort -u | awk 'FNR ==1 {print}') This provides us with the SSRC indicator
value. Now lets search for that SSRC value: tshark -n -r sip_1call.pcap -R rtp -R "rtp.ssrc == $ssrc" -T fields -e rtp.payload | tee payloads We've assigned this to a variable
payloads We loop over the results and drop all
occurances to a file (raw audio): for payload in `cat payloads`; do IFS=:; for byte in $payload; do printf "\\x$byte" >> sip_1call.raw; done; done Next, SOX is used to convert the raw audio
to a wav file: sox -t raw -r 8000 -v 4 -c 1 -U sip_1call.raw sip_1call.wav Now we have our wav... but we can do
so much more... Now that we have a wav we can
take some statistics off the audio
file: sox sip_audio_1call.wav -n stat It appears that similar audio
retains the same value for max
Amplitude and for Rough
Frequency Samples read: 15680
Length (seconds): 1.960000
Scaled by: 2147483647.0
Maximum amplitude: 0.425659
Minimum amplitude: -0.285034
Midline amplitude: 0.070313
Mean norm: 0.043354
Mean amplitude: -0.000055
RMS amplitude: 0.070984
Maximum delta: 0.243896
Minimum delta: 0.000000
Mean delta: 0.019919
RMS delta: 0.034190
Rough frequency: 613
Volume adjustment: 2.349 Extra Credit:
Spectrograms sox sip_1udio_call.wav -n spectrogram -y 2 -l -o sip_1call.png Maintenance The shell script now copies
all important files (pcaps,png's, wav's)
and inserts date/time into the file

All raw data is deleted YES! sox sip_audio_1call.wav input.flac rate 16k wget -q -U "Mozilla/5.0" --post-file input.flac --header="Content-Type: audio/x-flac; rate=16000" -O - "http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium" > output.ret Saved in a file output.ret The script next runs some filtering to get
the answer we want: cat output.ret | sed 's/.*utterance":"//' | sed 's/","confidence.*//' > output.txt
a=`cat output.txt` I.e the human speech is
actually validated I run Wireshark for 20 sec (duration of the call) from the command line & output a pcap file: Jenkins starts this shell script
At the same time it makes the call
If the script fails the job fails
The audio and PNG are saved Compare Strings Finally the shell script sets a var equal
to the expected value (i.e. "tollfreeforwarding.com") and compares the output from Google: if [ "$a" = "tollfreeforwarding.com" ];
echo "Verified audio is tollfreeforwarding.com"
echo "FAIL audio is not tollfreeforwarding.com"
exit 777
fi; Jenkins Places SIP Call Starts the Packet Capture TEST ENVIRONMENT Analysis of Audio The test starts with a SIP call and a packet capture occuring simultaneously. The packet capture is timed to last 2x longer then the call length.

The Packet is then converted to Audio again and we perform analysis to see if the audio is correct.

In other words we can validate the actual words "Welcome to Bank of America." Goal: to Verify SIP calls Call a Voice Mail Box and Validate Voicemail2MyEmail
Verify data points of the Phone Call's Audio
Transform the Phone Call Audio to Text and verify it against an expected value PASS FAIL Tools Used SIPP
SOX Using an automated shell script, each
tool is utilized to transform the audio phone call SSRC identifies the Audio Stream Source
Full transcript