VoIP software

Here are some open-source examples of VoIP autodialer implementation in CallXML language. The scripts are executed by StarTrinity softswitch.

VoIP autodialer script #1

  • Make calls according to schedule - during daytime
  • Enumerate N destination GSM gateways (GoIP, DINSTAR, any SIP-compatible)
  • Play audio file when call is answered
  • Don't make second call to the same number at one time
  • Count attempts, make maximum N attempts. Make a pause before redialing
  <span weekdays="mon,tue,wed,thu,fri,sat,sun" daystart="09:00" daystop="13:00" /> <!-- work days, 9AM ... 1PM -->
  <span weekdays="mon,tue,wed,thu,fri,sat,sun" daystart="14:00" daystop="23:00" /> <!-- work days, 2PM ... 6PM -->
 <on event="time_matches" >
  <assign var="file" value="C:\Users\Public\Music\Sample Music\Sleep Away.mp3" /> <!-- file name in 1 place for all 3 attempts -->
  <assign var="destinationIp" values=";;" /> <!-- enumerate gateway IP's -->
  <readcsv value="C:\StarTrinity\numbers.csv" repeat="infinite" var0="number" />
  <log value="read number from csv: $number;" />
  <assign var="attempt" value="1" />

  <log label="make_call" value="going to make call... $number;@$destinationIp; attempt #$attempt;" />
  <ifcallexists calledId="$number;" >
   <log value="not making call to $number; - some other call already in progress" />
   <exit />

  <call maxringtime="60s" callerId="test" value="sip:$number;@$destinationIp;" />
 <on event="answer">
  <log value="number $number;@$destinationIp; answered (attempt #$attempt;)" />
  <playaudio value="$file;" repeat="10000" maxtime="120s" />
  <exit />
 <on event="callfailure;maxringtime">
  <log value="call to $number;@$destinationIp; failed (attempt #$attempt;) with status $lastError;" />
  <assign var="attempt" mathvalue="$attempt;+1" />
  <if test="$attempt; &lt; 4">
   <log value="waiting some time and retrying (attempt #$attempt;)...." />
   <wait value="30s" />
   <goto value="make_call" />

VoIP autodialer script #2

  • Read A and B number from CSV file
  • Make a call to VoIP trunk, use G.729 codec
  • Save result of dialing to MySQL database via ODBC driver
  • When call is answered, play sound file and busy signal
 <readcsv value="C:\list.csv" var0="a" var1="b" />
 <call callerId="$a;" value="sip:$b;@" codec="G729" maxringtime="10s" maxansweredtime="$rand(1000,10000);s" />
 <on event="maxansweredtime">
  <requestdb odbcConnection="Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=voipswitch; User=root; Password=xxxyyyyzzz;">
    insert into `answered_numbers` (`number`) values ($calledId;)
  <exit />
 <on event="answer">
  <playaudio value="c:\sound.mp3" />
  <playaudio value="c:\busy.mp3" repeat="infinite" />
Copyright 2011-2017 | Blog | Contact lead developer via LinkedIn | Support tool