Archives

Archives / 2011 / January
  • Testing UCMA Applications

    One of the first things you notice when you start developing UCMA is the lack of an integrated SIP Phone for testing your applications. Speech Server made it trivial to test out your application, simply press F5 and everything was ready to go. UCMA lacks the integrated environment so you'll need a software phone of some kind to try out your app. I have been using one called PhonerLite for years. It is freely downloadable from http://www.phonerlite.de/index_en.htm and works like a charm. The key reasons I like it is that it supports UDP/TCP/TLS is extremely simply to use and has a build-in debugger that shows you the SIP messaging (something that is extremely useful when your application simply doesn't answer your call). I would recommend going with the beta version (currently 1.85) at http://www.phoner.de/PhonerLiteBeta.zip. Unzip it someplace and run the PhonerLite executable. image Select "manual configuration" image Give yourself a user name (I always use "1234") image image Take the defaults for the next two screens image Select the "Configuration" tab and then the "Network" sub-tab image Change your Port to something unused and your connection type to TCP image Enter the SIP address for your app in the "Destination name" field and click the green phone icon and you're off.

  • UCMA 3 How-To: Decline A Call

    In Speech Server we had an activity for declining a call. Typically this was used when you wanted to pull your application "off-line" for some reason. UCMA 3.0 doesn't have this activity, but the Core API still has support for it. Rather than declining the call within the Workflow, we'll be declining the call prior to the Workflow starting. I'll show how to do this using the out-of-the-box code you get when creating a new CommunicationWorkflow. If you look inside Program.cs you'll find the StartWorkflow() method. When we reach this point in the application we already have a "call" object which makes it trivial to Decline the call. The default code looks like this:

       1: private static void StartWorkflow(Call call, SipRequestData requestData)
       2: {
       3:   Debug.Assert(call != null, "call != null");
       4:   Debug.Assert(call is AudioVideoCall || call is InstantMessagingCall,
       5:       "Only AudioVideoCall and InstantMessagingCall are subscribed to above.");
       6:
       7:   WorkflowInstance workflowInstance = _workflowRuntime.CreateWorkflow(typeof(Workflow1));

    We'll insert our code starting at line 6, we'll also add some intelligence so that it allows me to call from my developer line while rejecting everyone else.

       1: private static void StartWorkflow(Call call, SipRequestData requestData)
       2: {
       3:     Debug.Assert(call != null, "call != null");
       4:     Debug.Assert(call is AudioVideoCall || call is InstantMessagingCall,
       5:      "Only AudioVideoCall and InstantMessagingCall are subscribed to above.");
       6:
       7:     if (!call.RemoteEndpoint.Participant.UserAtHost.StartsWith("1234@"))
       8:     {
       9:      call.Decline(new CallDeclineOptions(503));
      10:      return;
      11:     }
      12:
      13:     WorkflowInstance workflowInstance = _workflowRuntime.CreateWorkflow(typeof(Workflow1));
      14: ...

    A couple of tips:

    1. Take a look at the call object. It has a lot of interesting properties that let you make intelligent decisions about the call before your workflow has started.
    2. Make sure you use a SIP code (CallDeclineOptions) that your gateways understand and make sense. You don't want to toss a BUSY HERE if it isn't in fact BUSY.

  • Workflow Differences in UCMA 3.0

    The following is a list of activities from Speech Server 2007 and UCMA 3.0. UCMA brings with it a number of new activities (due mostly to UCMA handling both Speech and Instant Messaging) but it also drops a number of activities we've become used to having in Speech Server.

    Speech Server 2007 UCMA 3.0
    AnswerCall AcceptCall
    BlindTransfer BlindTransfer
    Command SpeechCommand
    ConsecutiveNoInputsSpeechEvent ConsecutiveNoInputsSpeechEvent
    ConsecutiveNoRecognitionsSpeechEvent ConsecutiveNoRecognitionsSpeechEvent
    ConsecutiveSilencesSpeechEvent ConsecutiveSilencesSpeechEvent
    DeclineCall

    -

    DetectAnsweringMachine

    -

    DisconnectCall DisconnectCall
    FormFillingDialog

    -

    GetAndConfirm

    -

    GoTo GoTo
    HelpCommand SpeechHelpCommand
    InvokeWorkflow

    -

    MakeCall OutboundCall
    Menu

    -

    NavigableList

    -

    QuestionAnswer SpeechQuestionAnswer
    RecordAudio

    -

    RecordMessage

    -

    RepeatCommand SpeechRepeatCommand
    SaltInterpreter

    -

    SetTaskStatus

    -

    SpeechSequence CommunicationsSquence
    Statement SpeechStatement
    Validator

    -

    VoiceXmlInterpreter

    -

    -

    CallDisconnectedEvent

    -

    CallOnHoldEvent

    -

    CallOnHoldTimeoutEvent

    -

    CallRetrievedEvent

    -

    GetPresence

    -

    InstantMessagingStatement

    -

    InstantMessagingQuestioNAnswer

    -

    InstantMessagingCommand

    -

    InstantMessagingCommand

    -

    InstantMessagingHelpCommand

    -

    ConsecutiveNoInputsInstantMessageEvent

    -

    ConsecutiveSilencesInstantMessagingEvent

    -

    ConsecutiveNoRecognitionsInstantMessagingEvent

    In the coming weeks I'll be covering some workarounds to the missing activities.