Coder Social home page Coder Social logo

freeswitch-load-tester's Introduction

freeswitch-load-tester

Allows us at Cinchcast to use FreeSWITCH to do load testing of SIP applications.

The way this was designed was to be able to pass custom actions like passing DTMF or playing some audio after some specified amount of time.

It was designed to use the mod_conference function dial to be able to listen to what's going on in order to debug actions. This is useful sometimes when passing through IVRs and getting down the timing of when to send DTMF.

This version is somewhat opinionated. Meaning it will assume that you will be using the default dialplan and that the stock conferences exist. It also assumes to use conference 3000 and use the PCMU codec. All of this could be changed.

These scripts should be place in your script folder. The referenced scripts paths are hardcoded and not relative.

To execute these scripts you can really use any method. The way that we use utilize is via curl.

In the example below sip-from is just a caller id string to be passed (it can be anything), and sip-to is the full sip-uri to dial.

For actions you can specify several options. They are parsed as key:value (which are separated by colons ":"), and pair sets are separated by a pipe character |.

curl "http://<username>:<password@<host or ip>:8080/webapi/bgapi?lua summondialer.lua <sip-from> <sip-to> <actions>"

sleep - pause for n milliseconds dtmf - send the specified dtmf to called destination speak - transcode the specified text and play it back hangup - hangs up the call

Everything after the question mark (the querystring parameters), but be URL encoded. And example would be:

curl "http://freeswitch:[email protected]:8080/webapi/bgapi?lua summondialer.lua cinchcast-bot [email protected] sleep:5000|dtmf:1234"

This gets url encoded as:

curl "http://freeswitch:[email protected]:8080/webapi/bgapi?lua%20summondialer.lua%20cinchcast-bot%2015555551212%4012.345.67.89%20sleep%3A5000%7Cdtmf%3A1234%22"

Last but not least we have a shell function installed that allows us to loop through this n times. This is stored in .bash_profile, but could be used any way necessary.

function run() {
    	number=$1
    	shift
    	for i in `seq $number`; do
      		$@
    	done
}

Then you could simply run 100 times by doing the following:

run 100 curl "http://freeswitch:[email protected]:8080/webapi/bgapi?lua%20summondialer.lua%20cinchcast-bot%2015555551212%4012.345.67.89%20sleep%3A5000%7Cdtmf%3A1234%22"

freeswitch-load-tester's People

Contributors

dgershman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.