Linux Asterisk script for test call

I need to measure the MOS and quality of the VOIP service on the network. I want to create a script that simulates calls, and then measures network metrics.

I use an asterisk.

Do you have any suggestion on how to script and plan test calls with an asterisk?

I would like to make calls of different durations, possibly using some AVI files.

Obviously, I need to automate both outgoing and automatic answering outgoing calls.

+5
source share
2 answers

I would suggest using Asterisk Call Files

Create the file name /tmp/example.call , for example:

 Channel: SIP/peerdevice/1234 Application: Playback Data: silence/1&tt-weasels 

And then copy this file and move it to the outgoing asterisk coil, for example:

 cp /tmp/example.call /tmp/example.call.new mv /tmp/example.call.new /var/spool/asterisk/outgoing 

You will notice that a new call will be created on the Asterisk CLI.

You can make another asterisk field by answering a call automatically by saying the answer to it in the dialplan, for example. If you have another SIP/peerdevice device and you type 1234 for my example, in your dialplan:

 [somecontext] exten => 1234,1,Answer() same => n,Noop(Example call inbound) same => n,Playback(hello-world) same => n,Hangup() 

And you can create several extensions to do what you like, change the behavior of the call.

+5
source

You can also use the originate command, for example:

 ast*CLI> channel originate SIP/ 755XXXXX@sip-outbound extension s@context _name 

which can also be issued from the shell as:

 [ user@host ]$ asterisk -rx 'channel originate SIP/ 755XXXXX@sip-outbound extension s@context _name' 

SIP/ 755XXXXX@sip-outbound = Which device should be used when dialing, so it can be IAX., SIP, DAHDI after the slash and phone number

extension = Required for the team. You can also use the application , followed by the Asterisk application, a la channel originate SIP/device/1234 application playback tt-monkeys , which will play the sound file.

s = This is the extension to send in the context below

@context_name = What context to send to extensions.conf

Further information is available in this Asterisk manual.

+4
source

All Articles