BLOG     |     FORUM
Welcome, Guest
Username: Password: Remember me
All your questions answered real quick by Unleash Networks Engineers.

TOPIC: Scripting

Re:Scripting 17 years 8 months ago #50

  • netscript
  • netscript's Avatar
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 :
  1. First it imports the CAP file into Unsniff format (which is a scriptable format)
  2. 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.
  3. Each RTP audio object is saved to file
  4. 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]
The administrator has disabled public write access.

Re:Scripting 17 years 8 months ago #51

  • netscript
  • netscript's Avatar
Hi Will

We decided to put up our new build online for download.

Please download from:
www.unleashnetworks.com/unsniff/unsniff.html

It has several new features for RTP mixing. For each VoIP call Unsniff will generate three \"user objects\".

1. For the forward leg
2. For the reverse leg
3. Both legs mixed so you can hear both ends of the conversation.

The mixing is very unique compared to all other products. We have three options.

1. Generates a WAV file in stereo (with caller on left and callee on right speakers). We found this useful while dealing with a noisy direction. You can just turn the speaker balance down to focus on a particular channel.

2. Generates an interleaved WAV file

3. Merges both call legs into a Mono WAV file (Use this if you want to save disk space)

The scripting interface is unchanged, the same scripts will work with these new features.

Enjoy!

Best Regards,
Vivek Rajan
The administrator has disabled public write access.

Re:Scripting 17 years 8 months ago #52

Vivek - Thanks - I shall test over the coming days - Great response as every !!

Ill let you know how I get on !

Cheers

Will Hunter
The administrator has disabled public write access.

Re:Scripting 16 years 4 months ago #161

Hi Will/Vivek,

Could i get your help in unsniffing this file (see attachment) so i can play the audio file.

I already doing the steps that you had earlier like, checking the UDP port number and doing the plugin->manage access points but i still could not get anything on the user object tab

Thanks for your help,
Rey
The administrator has disabled public write access.

Re:Scripting 16 years 4 months ago #162

  • netscript
  • netscript's Avatar
Hi Rey,

We disabled file uploads due to major spamming a while ago. We are trying to find a good replacement for this forum software.

Please send your attachment to me by email to : vivek at unleashnetworks dot com.

We can then continue the discussion here.

Sorry for the inconvenience.

Regards,
Vivek Rajan<br><br>Post edited by: netscript, at: 2007/11/20 21:13
The administrator has disabled public write access.
Moderators: vivek [unleash]
Time to create page: 0.034 seconds