locked
Create anti-app to test speech application? RRS feed

  • Question

  • Hi!

     

    After some input from Anthony, I am trying to build an application to load test our real application. The applications will run on seperate servers.

     

    To keep things as simple as possible, the anti-app only has to connect to our real app and then wait until it disconnects. To accomplish this, I am using the OutboundCalls sample and modifiying it so it doesn't hang up until the called applications hangs up. I have added a while-activity between MakeCall and DisconnectCall so that it will keep on going until a CallDisconnected error is received.

     

    Have you designed your test apps the same way or is there a better approach?

     

    I am very grateful for your input, I am still lost in this world...

     

    Tuesday, May 29, 2007 9:37 AM

Answers

  • If you're going to use a while loop, you need some way to busy wait after the MakeCall which doesn't block the serialized callback thread.  The Delay activity should do this, though it's not working for me (I'm looking into why).  In theory you don't need the DisconnectCall activity since you can rely on the CallDisconnected fault handler.  

     

    It's simple enough to do at the Core API, without using workflow at all.  Replace OutboundCallsHost with the following.

     

    Code Snippet

    public class OutboundCallsHost : IHostedSpeechApplication

    {

    private IApplicationHost _host;

     

    public OutboundCallsHost()

    {

    }

     

    public void Start(IApplicationHost host)

    {

    _host = host;

    _host.TelephonySession.OpenCompleted += TelephonySession_OpenCompleted;

    _host.TelephonySession.Closing += TelephonySession_Closing;

    // Put your telephony number in here. This can be extracted from host.Url.Query, if that is how you'll be passing it in

    _host.TelephonySession.OpenAsync("123456789");

    }

     

    void TelephonySession_OpenCompleted(object sender, AsyncCompletedEventArgs e)

    {

    if (e.Error != null)

    {

    _host.OnCompleted();

    }

    }

     

    void TelephonySession_Closing(object sender, ClosingEventArgs e)

    {

    _host.OnCompleted();

    }

     

    public void Stop(bool immediate)

    {

    _host.OnCompleted();

    }

     

    public void OnUnhandledException(Exception exception)

    {

    if (exception != null)

    {

    _host.TelephonySession.LoggingManager.LogApplicationError(100, "An unexpected exception occurred: {0}", exception.Message);

    }

    else

    {

    _host.TelephonySession.LoggingManager.LogApplicationError(100, "An unknown exception occurred: {0}", System.Environment.StackTrace);

    }

    _host.OnCompleted();

    }

    }

     

     

     

    If you want the anti-app to do reco / prompts, I'd switch back to using workflow.

    Wednesday, May 30, 2007 11:25 AM