How to simulate incoming calls for testing


#1

Hi,

I want to simulate incoming calls on Asterisk server. The way I’m doing that is, I just connect an outgoing call from Asterisk to an incoming number.

Here is what I’m currently doing now to simulate a single connection.

*CLI> channel originate Local/123@simulateout extension 123@from-pstn

Here’s the snippet from my extensions.conf

[simulateout]
exten => 123,1,Answer() // The oubound call
exten => 123,n,Playback(vm-goodbye) // message
exten => 123,n,Wait(15)

[from-pstn]
exten => 123,1,Answer() // answer the inbound call
exten => 123,n,SynthAndRecog(…) //Call to MRCP server
exten => 123,n,Verbose(1, ${RECOG_RESULT})
exten => 123,n,Hangup()

Basically I’m trying to load test a MRCP server, and I need to simulate multiple incoming calls.
I preferably want a scripting solution where I can make and test the output of multiple simultaneous calls. Any pointers towards the right direction will be greatly appreciated.

Thanks


#2

I’d recommend using Sipp

http://sipp.sourceforge.net/


#3

Are you trying to simulate incoming analog or VOIP calls?


#4

Nice idea. I’ll check the usage more in-depth.


#5

@pilot2 - Either one of them will work. The ultimate aim of simulation is to try out multiple calls to MRCP server. In a typical scenario this is the architecture of my product.

User(SIP/Analog) -----> Asterisk -------------> MRCP Server
<----- <------------

So I don’t really care about the type of traffic.

In my case, this works as well.
*CLI> channel originate Local/123@simulateout extension 123@from-pstn

But ofcourse the drawback is that 1)I have to check the output manually and 2)I can’t test simultaneous connections. I just need a scripting format, where I can analyze the output of MRCP server.


#6

Hopefully this will help. I simulate incoming calls for an all analog development system as follows: I take a copy of the production dialplan and create the internal test extension I will use to generate the call. In the code below this is extension 300 in [from-internal]. When 300 is dialed, the call is routed to [testcontext] where it gets a CALLERID(name) and CALLERID(number) assigned. The call is then routed to the s extension in the [from-pstn] context which is typically the part of the dialplan that handles incoming analog calls. This is used to test call flow, but it would be easy to adapt it to load test. Generating multiple calls could be done by sending the initial call in [testcontext] to a script using the AGI interface where the script contains a loop that alters the CALLERID(name) and CALLERID(number) and returns a series of calls to the s extension (or in your case to your MRCP server) in rapid succession. You could also have the script add any content you want to test with the MRCP server.
If you did not want to use a handset or endpoint to start your call you could keep the channel originate method.

[from-pstn]
exten => s,1,Verbose(INCOMING CALL DIALPLAN)
same => n
same => n

[from-internal]
exten => 300,1,Goto(testcontext,300,1)

[testcontext]
exten => 300,1,NoOp()
same => n,Set(CALLERID(number)=1234567890)
same => n,Set(CALLERID(name)=“NewCaller”)
same => n,Goto(from-pstn,s,1)