Linux Asterisk script for test call
Asked Answered
D

3

6

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

I'm using asterisk.

Do you have any suggestion about how to script and schedulate test calls with asterisk?

I would like to make calls of different duration maybe using some avi files.

Obviously I need to automate both outgoing call and automatic answer to that outgoing calls.

Dogmatize answered 13/4, 2015 at 15:9 Comment(3)
Question too broad. What exactly not work for you? Have you checked asterisk book? Asterisk dialout article on voip-info.org wiki?Voile
I understood the automatic dialout for asterisk but not how to make automatic answer on other peers. I want to simulate a call between to person not just automatic dialout.Dogmatize
Sorry, that is out of topic here. You have show your effort and ask question. What is your question? answer on asterisk you can do by "Answer" dialplan command.Voile
L
7

I would suggest using Asterisk Call Files

Create a file name /tmp/example.call such as:

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

And then copy that file and move it into the asterisk outgoing spool, such as:

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

You'll notice at the Asterisk CLI it will originate a new call.

You can make another asterisk box answer the call automatically by saying to answer it in the dialplan, e.g. If you have another device SIP/peerdevice, and you're dialing 1234 per 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 could create multiple extensions to do what you like to vary the behavior of the call.

Limitative answered 14/4, 2015 at 14:45 Comment(0)
I
4

You can also use the originate command, such as:

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

Which can also be issued from a shell as:

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

SIP/755XXXXX@sip-outbound = Is what device to use when dialing out so this could be IAX.,SIP,DAHDI following a slash and phone number

extension = Is required for the command. You may also use application followed by an Asterisk application, a la channel originate SIP/device/1234 application playback tt-monkeys which would playback a sound file.

s = This is what extension to send to within the context specified below

@context_name = Which context to send to in extensions.conf

More information available in this Asterisk guide

Incorporating answered 16/4, 2015 at 12:15 Comment(0)
A
0

In case you will call a asterisk extension:

asterisk -rx "console dial extension@context"
Amniocentesis answered 3/4, 2020 at 20:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.