VoIP software

VoIP community

VoIP marketplace

logged in as
log out

Scripts for looped VoIP traffic generation

The scripts are used to send generated VoIP traffic to wholesale route provider(s) and receive the traffic back to same system. If the call goes to some other termination provider, it is dropped before or immediately after connection.
outgoing CallXML script (for call generator in StarTrinity softswitch)
 <assign var="receiverStatus" value="not received" />

 <switch> <!-- make calls to 3 countries with different probability distribution -->
  <case probability="30" > <assign var="cld" value="961$randdigits(9);" /> </case>
  <case probability="30" > <assign var="cld" value="962$randdigits(9);" /> </case>
  <case probability="40" > <assign var="cld" value="963$randdigits(9);" /> </case>

<!-- put correct terminator ID instead of XXX below: (terminators are configured in softswitch web UI) -->
 <call callerId="1$randdigits(9);" value="$cld;" maxringtime="45s" codec="G729" terminatorId="XXX" headers="Session-ID=testIfThisIsPassedViaRoute" />
 <on event="pr:183">
   <log value="$cld;: received 183" /> <!-- callxml log is accessible in Web UI, is used to see what happens in the script -->
   <wait value="7s" />
   <ifcallexists calledId="$cld;"> <assign var="receiverStatus" value="OK" /> </ifcallexists>
   <log value="$cld;: receiver status: $receiverStatus;" />
   <if test="$receiverStatus; != OK">
     <log value="$cld;: cancelling call: not received" />
     <exit />
 <on event="answer">
   <ifcallexists calledId="$cld;" considerThisCall="false"> <assign var="receiverStatus" value="OK" /> </ifcallexists>
   <log value="$cld;: connected call. receiver status: $receiverStatus;" />
   <if test="$receiverStatus; != OK">
     <log value="$cld;: dropping connected call: does not exist on receiver" />
     <exit />
  <playaudio value="music.wav" repeat="infinite" maxtime="$rand(25,60);m" /> <!-- play default music wav file, you can replace it with your own file -->
  <exit />
incoming CallXML script (for call receiver in StarTrinity softswitch)
 <performaaa/> <!-- note that you need to set up an originator in softswitch web UI to receive VoIP traffic -->
 <if test="$loop;"> <!-- the originator should have field "CallXML variables" set to "loop=true" -->
  <ifcallexists calledId="$calledId;" considerThisCall="false">
   <!-- call is generated by our system: terminate it by playing WAV audio file -->
   <accept value="183"/>
   <playaudio value="music.wav" maxtime="$rand(6,10);s" repeat="infinite"/> <!-- ringing time is random from 6 to 10 seconds -->
   <playaudio value="music.wav" maxtime="$rand(3,8);m" repeat="infinite"/> <!-- connected time is random from 3 to 8 minutes -->
<!-- calls from other sources: regular termination via switch to terminators (you need to set up routing groups) -->
 <transfer terminators="routed"/>
Copyright 2011-2018 | Blog | Contact lead developer via LinkedIn | Get support via TeamViewer