Partager via


OutboundCalls (Managed Code Sample)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The OutboundCalls sample illustrates how to create an outbound voice response application. The sample initiates outbound calls to a list of phone numbers stored in an XML file. If a call is answered, a message plays. When the current call completes, the sample initiates an outbound call to the next number listed in the XML file.

  • Making a series of sequential outbound calls
  • Using an ASP.NET Web page to start outbound calling
  • Using an XML data file

Setting Up the Sample

Before you can run the sample, you must set up a message queue and create a virtual directory for this application.

To set up a message queue

  1. Open Computer Management:

    1. On Microsoft Windows Server 2003, click Start on the taskbar, point to Administrative Tools, and then click Computer Management.
    2. On Microsoft Windows XP, click Start on the taskbar, click Control Panel, click Administrative Tools, and then click Computer Management.
  2. In the left pane, expand Services and Applications, and then select Message Queuing.

  3. Right-click Private Queues, click New, and then click Private Queue.

  4. In the New Private Queue dialog box, enter a name for the queue (for example, MSMQTriggersNotifications) in the Queue name box, and then click OK.

  5. Under Private Queues, right-click the queue whose name you created in the previous step, and then click Properties.

  6. Click the Security tab, and then click Add.

  7. In the Select Users, Computers, or Groups dialog box:

    1. On Microsoft Windows Server 2003, enter NETWORK SERVICE, and then click OK.
    2. On Microsoft Windows XP, enter ASPNET, and then click OK.
  8. On the private queue property page in the lower pane, select the Allow permissions check boxes for Receive Message and Peek Message.

    The Send Message check box should already be selected.

  9. Click OK.

Next, you must create a virtual directory for the application. This action entails the use of Administrator console to create a virtual directory for the application and the use of Internet Information Systems (IIS) Manager to set directory security for the virtual directory.

To create a virtual directory for the application

  1. Click Start on the taskbar, point to All Programs, point to Microsoft Office Communications Server 2007 Speech Server, and then click Administrator Console.

  2. In the left pane, expand Default, and then select Applications.

  3. Right-click Applications, click New, and then click Application.

  4. In the Create new application dialog box, enter OutboundCalls in the Application name box.

    The URL box is automatically filled as you type the application's name.

  5. In the Deployment Location box, enter the directory path to application's files.

    If you installed the application on the C: drive, the directory path is the Samples\Workflow\OutboundCalls\OutboundCalls\ directory of the Speech Server installation directory.

  6. In the Manifest (optional, specifies resources to preload) box, enter http://localhost/OutboundCalls/manifest.xml, which is the path to the OutboundCalls application's manifest file.

  7. In the Message queue box, enter .\private$\ followed by the name you created for your message queue in the previous procedure.

    For example, if you named your message queue MSMQTriggersNotifications, enter .\private$\MSMQTriggersNotifications.

  8. Click OK.

  9. In the Select Servers dialog box, select the server on which to create the application, and then click OK.

The next procedure provides details about setting directory security for the virtual directory for OutboundCalls on Microsoft Windows Server 2003 and Windows XP.

To set directory security on the virtual directory (Windows Server 2003 and Windows XP)

  1. Open Internet Information Services Manager:

    1. On Microsoft Windows Server 2003, click Start on the taskbar, point to Administrative Tools, point to Internet Information Services (IIS) Manager, and then click Administrator Console.
    2. On Microsoft Windows XP, click Start on the taskbar, click Control Panel, click Administrative Tools, and then click Internet Information Services.
  2. In the left pane, expand ServerName, expand Web Sites, and then select Default Web Site.

  3. Right-click Default Web Site, and then click Refresh.

    If you expand Default Web Site, you should see an entry for OutboundCalls.

  4. Right-click OutboundCalls, and then click Properties.

  5. On the OutboundCalls property page, click the Directory Security tab.

  6. On the Authentication and access control pane, click Edit.

  7. In the Authentication Methods dialog box, select the Enable anonymous access check box, and then enter your user name (in the form domain\user_name) and your password.

  8. Click OK.

  9. Re-enter your password, and click OK twice.

The steps for setting directory security for the virtual directory for OutboundCalls on Windows Vista differ from those for Windows Server 2003 and Windows XP.

To set directory security on the virtual directory (Windows Vista)

  1. Open Internet Information Services Manager:

    1. On the Start menu, click Control Panel, and then double-click Administrative Tools.
    2. In Administrative Tools, double-click Internet Information Services (IIS) Manager.
    3. In User Account Control, click Continue.
  2. In the left pane, expand ServerName, expand Web Sites, and then select Default Web Site.

  3. Expand Default Web Site, and then select OutboundCalls.

  4. In the right pane, click the Features View tab.

  5. In the right pane, double-click Authentication in the IIS group.

  6. Right-click Anonymous Authentication, and then click Edit.

  7. In the Edit Anonymous Authentication Credentials dialog box, click Specific user, and then click Set.

  8. In the Set Credentials dialog box, enter your user name (in the form domain\user_name) and your password.

  9. Re-enter your password to confirm it, and then click OK.

  10. In the Edit Anonymous Authentication Credentials dialog box, click OK.

Running the Sample

To run the sample

  1. In the Samples\Workflow\OutboundCalls\ directory of the Speech Server installation directory, open the sample solution file.

  2. To start debugging, press F5.

  3. In the Voice Response Debugging Window dialog box, click the SIP Phone tab, and then click Outbound Trigger.

  4. On the OutboundCalls Trigger page, click Send Trigger.

  5. Minimize the OutboundCalls Trigger page.

  6. In the Incoming Call Control dialog box, click Answer.

    The application plays a greeting and says "goodbye."

Remarks

This code sample is intended to demonstrate specific Speech Server features. It does not necessarily reflect best practices with respect to security and privacy. You should carefully review any code that you deploy in production for potential security risks and privacy issues.