SipCLI System Requirements

  • A Windows system with at least 2048 MBytes of RAM.
  • Microsoft.NET Framework v4.0 (Min.)

Installing and Uninstalling

To install sipcli, create a directory, extract sipcli.zip to that directory. To uninstall sipcli, simply remove the installation directory.

Running

Open a command line prompt and locate sipcli's installation directory:
SipCLI Command Line Parameters

  1. Create sipcli.ini in the installation directory. You can place sipcli.ini to a directory which is in search path of your environment. If you do not create sipcli.ini sipcli initialized with following default values:

     - Available first interface with IPv4 address with a default gateway will be
       selected as source IP address (ListenIP)
     - SIP port: 5070
     - Logging: Informative (0)
     - Timeout 30 seconds
     - SIP Domain: ListenIP:5060
     - Username: 5550000
     - Password: 'Blank'
     - Text to read: This is a test call made by SIP c l i

  2. Run sipcli from command line with the destination number (C:\sipcli 5551010).
  3. A message indicating result of the test call will be displayed to the console.
Here is a sample VB Script for running sipcli recursively to dial a series phone numbers. Script takes file name which contains phone numbers as command line argument. Phone numbers file must contain one phone number per line.

Set WshShell = WScript.CreateObject ("WScript.Shell") 
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "^\d+$"

Set FSOPath = CreateObject("Scripting.FileSystemObject")

FilePath = FSOPath.GetAbsolutePathName("") 

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set PhoneNumbersFile = objFSO.OpenTextFile(FilePath & "\" & WScript.Arguments(0))

Result = FilePath & "\test-results.txt"

strRun = "%comspec% /c echo Test Results: > " & Result
WshShell.Run strRun, 0, True

Do Until PhoneNumbersFile.AtEndOfStream
 PhoneNumber = PhoneNumbersFile.ReadLine
 Set colMatches = objRegEx.Execute(PhoneNumber)  
 If colMatches.Count Then
   strRun = "%comspec% /c " & FilePath & "\sipcli.exe " & PhoneNumber & " >> " & Result
   WshShell.Run strRun, 0, True
 End If
Loop

PhoneNumbersFile.Close

Test result will be written to "test-results.txt" file.

SipCLI.ini

You can find sipcli.ini parameters below:

    [CLI]
    ' You can specify an external IP address or alphanumeric address manually to be resolved
    ' to an IP address. This especially useful if your SIP destination is an external network
    ' and SipCLI is run behind a NAT gateway
    'EAddress='External IP address or alphanumeric address'
    ' ListenPort, you can set source UDP port, default: 5070
    ListenPort=5070
    ' You can specify SIP transport to be used, default is UDP. You can also set it to TCP or TLS.
    Transport=UDP
    ' You can set logging level
    ' 0: Informative, 1: Sessions, 2: Errors, 3: Debug
    ' Default: Informative (0)
    Logging=0
    ' You can set user codec, options: g711a, g711u, ilbc and g729. Default: g711a.
    Codec=g711a
    ' Use SRTP
    UseSRTP=0
    ' You can specify a wave file for playout. Wave file must be in 8 KHz, 16 bit sampled
    ' mono file. You must use command line switch -w to play specified file to remote
    ' SIP endpoint. Only G.711 A-Law and Mu-Law codecs are supported for playout.
    WavFile=C:\Test.wav
    ' Specify scenario file's absolute path. File must be in clear text format.
    ScenarioFile=C:\scenario.txt
    ' Specify a SIP endpoint Id or a SIP URI to transfer a successful call.
    ' Sample SIP URI sip:1234@192.168.10.1:5060
    Referto=7751010
    ' You can specify call establishment timeout. Default 30 seconds, maximum 180 seconds.
    Timeout=25
    ' You can specify text message to read when -t switch used at command line.
    ' You can also specify a text file with full path.
    TexttoRead=This is my test message.
    ' You can specify TTS voice profile (Gender). Run Sipcli with -v parameter to list
    ' available profiles and you can specify voice profile with -v  in
    ' the command line.
    VoiceProfile=0
    ' The Volume property sets the base volume (loudness) level of the TTS synthesized voice.
    ' Values for the Volume property range from 0 to 100, representing the minimum and
    ' maximum volume levels, respectively.
    TTSVolume=100
    ' You can specify text message to send when -m switch used at command line.
    TexttoSend=This is my test message.
    ' You can enable or disable ENUM lookup, disable by default.
    ENUM=0
    ' How many digits will be collected maximum
    ' (Used when you set WavFile/TexttoSend parameter or use -w/-t command line switch)
    DigitLength = 0
    ' How many second will be waited after last digit entered if user does not dial #
    ' (Used when you set WavFile/TexttoSend parameter or use -w/-t command line switch)
    DigitTimeout = 2
    ' How many times welcome message will be played if no user input (DTMF digits) detected
    ' (Used when you set WavFile/TexttoSend parameter or use -w/-t command line switch)
    LoopCount = 1
    ' DTMF can be received and detected inband (1) or send and received using SIP INFO method (2) in the commercial edition.
    ' RFC 2833 (0) method is used by default.
    DTMFTransport=0

    [Proxy]
    ' Specify SIP Proxy and optionaly UDP port. Default ListenIP:5060
    SIPProxy=192.168.10.10:5080
    ' Specify a SIP domain
    SIPDomain=kaplansoft.com
    ' Specify SIP username. Default: 5550000
    Username=5550000
    ' Specify SIP Authorization name if this is different than SIP username. Default: 5550000
    AUsername=5550000
    ' Specify password. Default is blank.
    Password=
    ' If remote system supports displaying alternative display name in From: header
    ' you can specify it here.
    DisplayName=02125550000
    ' You can force SipCLI to register itself prior to make a call, Default Register=0
    Register=1

You can overwrite ini file parameters using command line switches:

 C:\sipcli>sipcli 02135551122 -u 02135551010 -d 192.168.20.1:5090

SIP username will be set as 02135551010 and call request will be sent to SIP proxy 192.168.20.1 UDP port 5090. Command line switches;

 -u : Username
 -p : Password
-au : Specify SIP Authorization name if this is different than SIP username
 -n : Display Name (Called ID)
      Use double quotes if display name contains space ("Test User" e.g.)
 -d : SIP_Domain:Port
 -l : Logging [0|1|2|3]
 -c : Codec [g711a|g711u|g729]
 -o : Timeout
 -t : Text or text file to read. Use full path for text files.
      Sample : C:\Program Files\sipcli 02135551122 -u 5551010 -t "This is a test message"
      Sample : C:\Program Files\sipcli 02135551122 -u 5551010 -t "C:\Textfile.txt"
 -k : SIP transport, UDP, TCP or TLS
 -m : Text to send
      Sample : C:\Program Files\sipcli 02135551122 -u 5551010 -m "This is a test message"
 -w : Absolute path of playout file (8 KHz, 16 bit sampled mono wave file)
      Sample : C:\Program Files\sipcli 02135551122 -u 5551010 -w "C:\Program Files\sipcli\test.wav"
 -s : Absolute path of scenario file (See "Custom Scenarios")
      Sample : C:\Program Files\sipcli 02135551122 -u 5551010 -s "C:\Program Files\sipcli\scenario.txt"
 -r : SIP Endpoint Id or a SIP URI to transfer a successful call
 -f : Length of the digit string to be collected (Used with -w/-t)
 -g : Inter digit time out (Used with -w/-t)
 -h : Playout count (Used with -w/-t)
 -x : Use SRTP
 -v : Lists available TTS voice profiles in the system.

If you use -w switch without a wave file or no WavFile entry in sipcli.ini, built-in audio record will be played out.

You can make a call to an E.164 number using ENUM if the E.164 has an ENUM entry;

 C:\sipcli>sipcli 02135551122 -enum

If you run sipcli without any parameters you'll get quick help with Listen IP, SIP Port (UDP) and RTP Port (UDP) as shown below:

 IP Adr.: 192.168.10.1
 UDP P. : 5073
 RTP P. : 5074

Custom Scenarios

SipCli supports automated tasks defined in scenario scripts. You can execute scenarios defined in scenario files. Scenario files are text files consists of following sections and parameters. There are two sections in scenario files; [Prompts] and [Actions]. [Prompts] sections defines prompts can be used by Play action. A prompts can be a recorded audio file in wave format or a text can be synthesized by TTS engine. Every prompt must have a numeric Id associated with it. You must specify full path of wave file and wave files for the prompts must be in 16 bits, 8 KHz, mono format If wave file cannot be found or cannot be encoded by SipCli, the wave file will not be imported to the scenario.

 [Prompts]
 0=C:\sipcli\Welcome.wav
 1=C:\sipcli\Info-1.wav
 'TTS Text
 2="This is a test call"

[Actions] section contains actions to be executed. Every action has also a numeric Id and action identifier and parameters. Defined actions are Play, Exit, Send, Exec, Eval and Wait. Actions and their parameters are listed below with samples. Sipcli always starts scenario with action id = 0. Every actions' last parameter is the next actions' id except Exit which terminates the scenario. If you define an no-existent action as a next action SipCli will break the execution of the script. Script execution will also be terminated if the action step is not properly defined.

 [Actions]
 'Play Format
 'Step=Play-||||
 0=Play-0|3|1|1

 'Synthesise Format
 'Dynamically create audio prompt using Microsoft TTS
 'engine based on user text input. You can use internal variables
 '%called_number%, %calling_number%,  %received_digits%, %date%,  %sipdomain%,
 '%execout%  in prompt  text. You can not use pipe | character in prompt text.
 'Step=Synt-||||
 9=Play-Just a test made at %date%|3|1|1

 'Evaluate Format
 'Select next step bast on DTMF input
 'Step=Evaluate-|;|;..;|
 1=Evaluate-Default|7;23|2;24|3;25|7

 2=Play-1|3|7|3|3
 3=Play-2|3|7|3|4

 'Send Format
 'Step=Send-|
 4=Send-124124|5

 'Wait Format
 'Step=Wait-||
 5=Wait-0|30|6

 'Record Format
 'Step=Save-|||
 6=Save-0|30|C:\SipCli\Messages|7

 'Exec Format
 'Step=Exec-|||
 'Execute action executes the executable defined in ExecutablePath parameter. 
 'You must enter executable with full path. Valid predefined options for  the
 'command   line   parameters  (ExecutableParameters)  are   %called_number%,
 '%calling_number%,  %received_digits%,  %date%, %execout% and  %sipdomain%".
 'Predefined parameters are case sensitive. Leave ExecutableParameters blank
 'if no parameter will be used. Set WaitforCompletion = 1 if you wish SipCli
 'to wait completion of the execution of the  executable and SipCli will use
 'return value  (DOS Errorlevel)  of the executable as the  next  action  be
 'executed. You  must  also  define next  step after  the  action  completed
 '(NextAction).  If   you  set  WaitforCompletion = 1  SipCli   will   store 
 'executable's console  output  (if exists) to  %execout% variable  and will 
 'ignores return value (DOS Errorlevel) of executable.
 7=Exec-"C:\sipcli\test.bat"|"-u %called_number"|1|8

 'Exit Format
 'Step=Exit
 8=Exit

Scenario Editor

You can create your own scenario using SipCli Scenario Editor (SEditor.exe). Before creating your scenario you must define audio prompts to be used in your scenario. Prompt and Action definitions for the scenario are stored in text files.

SipCLI Scenario Editor SipCLI Scenario Editor

Follow us