Will,
To start off scripting visit the scripting resources at
www.unleashnetworks.com/scripting.html
There are several Ruby and VBScript samples in the scripting library at
www.unleashnetworks.com/script-contents.html
Scripting requires a basic knowledge of VBScript or Ruby.
Here is a small script that can convert a cap file and spit out many wav files (one for each leg of the call). The output files are named \"Call_Leg_1.wav, Call_Leg_2.wav, .. and so forth\". You can build it from here to match your specific requirements.
The way it works is :
- First it imports the CAP file into Unsniff format (which is a scriptable format)
- Next it scans through all the user objects looking for \"RTP Audio\" objects. Note, Unsniff supports many other object types such as HTML, Files, Images, and so forth.
- Each RTP audio object is saved to file
- Finally it cleans uh p the Unsniff format file
To run this, save the code below into a file called xcalls.vbs. Put the file in the same directory as the capture file and type:
cscript xcalls.vbs <capfilename>
GOod luck
[code:1]
'
' Check usage & arguments
'
Set Stdout = WScript.StdOut
if WScript.Arguments.Count <> 1 then
Stdout.WriteLine \"Usage: xcalls <cap-filename>\"
WScript.Quit
end if
Set UnsniffDB = CreateObject(\"Unsniff.Database\"«»)
' Import from libpcap file into a temp Unsniff format
FromFile = WScript.Arguments.Item(0)
UnsniffDB.New(\"TempFile.USNF\"«»)
UnsniffDB.Import \"libpcap\", FromFile
OutCount = 1
Dim UOIndex
Set UOIndex = UnsniffDB.UserObjectsIndex
For Each UO In UOIndex
With UO
If Not .HasError Then
StdOut.WriteLine .ID & vbTab & .Type & vbTab &_
.SenderAddress & vbTab & .ReceiverAddress & vbTab &_
.Length & vbTab & .Name & vbTab & .Description
If .Type = \"RTP Media\" Then
OutFileName = \"Call_Leg_\" & OutCount & \".WAV\"
.SaveToFile(OutFileName)
OutCount = OutCount + 1
End If
End If
End With
Next
UnsniffDB.Close()
Dim fso
Set fso = CreateObject(\"Scripting.FileSystemObject\"«»)
fso.GetFile(\"TempFile.USNF\"«»).Delete
[/code:1]