<<

Schedule Encoding Channel Restarts with AnyResLive Encoder API

Document ID: 119018 Contributed by Kurt Ma and Frank Vercant, Cisco TAC Engineers. Aug 05, 2015

Contents

Introduction Prerequisites Requirements Components Used Background Information Configure Verify Troubleshoot Introduction

This document describes how to schedule regular restarts of the encoding channel with Cisco AnyResLive. Prerequisites

Requirements

Cisco requires that you have:

• Administrator access to the Cisco AnyResLive Encoder

• Knowledge of how batch files and scripts work on Windows

Components Used

The information in this document is based on these software and hardware versions:

• Wget for Windows

• Windows batch script

• Spinnaker Message Service API

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, sure that you understand the potential impact of any . Background Information

Sometimes the encoding channel/stream needs to be restarted on a regular basis. The scheduling capabilities of the Cisco AnyResLive encoder are limited to Daily annd Weekly scheduled events.

With Windows Task Scheduler and the Spinnaker Message Service API, you can restart the encoding channel a flexible frequency.

Note: The same procedure described in this article can also be applied to other functions provided by the Spinnaker Message Service API. Configure

Note: Your version of Windows might require different steps from those in this procedure in order to access Windows tools such as Advanced System Properties and the Task Scheduler.

1. Download GNU Wget for Windows from the Internet and it on the Encoder in this location:

C:\\GnuWin32\bin 2. Create a Windows for the Wget folder :

A. On the Windows menu, right-click Computer and choose Properties on the context menu.

B. Click Advanced System Properties.

C. On the Advanced tab, click Environment Variables.

D. In the System Variables area, choose the Path variable and click Edit.

E. In the Variable value box, place the cursor at the end of the existing values. Type a semicolon and then enter the path to the folder where you installed Wget in Step 1.

F. Click OK in order to close the open windows. 3. Enable the Message Service:

A. Open the Encoder Management application and log in as an administrator.

B. On the System tab, click Message Service.

C. Ensure that the Message Service is running and that all fields contain the correct values.

◊ Service Status: should be Running. If it is not running, click the Restart button to restart it.

◊ Service URL (Synchronous): the selected IP address must be reachable from the Windows server that will run the schedule task. If you change the interface for Service URL (Synchronous), click the Restart button to restart the message service in order for the change to take effect.

4. Create this folder:

C:\Schedule_Restart_Channels 5. With your preferred editor, create an XML in the folder you created in Step 4. Name the file Restart_Channel1.xml and this code into the file:

46140015-27b9-46ea-abfa-de980eae387te SPINNAKER 1 0 6. Modify values in the XML code as needed:

♦ GUID: can be any value; use the default value in the code sample.

♦ Target: with the computer name of the Encoder.

♦ Channel: replace with the number of the channel that needs to be restarted. (You might also want to rename the XML file to match this value, such as Restart_Channel2.xml if the Channel value is 2.)

♦ Stream: leave this value as 0 in order to restart all the streams under the channel.

7. If you need to restart other channels, repeat Steps 5 and 6 in order to create an XML file for each additional channel.

8. Create a in the folder you created in Step 4. Name the file Restart_Channels.bat and copy this code into the file:

@ off for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)

wget http://:8099/encNode/ --post-file="RestartChannel1.xml" --header= "Content-Type: application/soap+xml" --output-document=Restart_Status_ch1_%mydate%.xml 9. Modify the batch file as needed:

: replace with the IP address of the Encoder.

♦ --post-file=: ensure that this references the correct XML file name for the channel to restart.

♦ --output-document=: ensure that the "ch1" portion of the file name matches the channel number to be restarted. This output will be saved as an XML file in the same folder as the batch file.

♦ In order to make the batch file restart multiple channels, add a separate "wget" line to the batch file for each channel. Modify the values as appropriate for that channel.

10. Create an event in Windows Task Scheduler:

A. On the Windows Start menu, click Control Panel.

B. Task Scheduler (or the "Schedule Task" option) under Administrative Tools.

C. Open the Task Scheduler and create a task that runs the batch file you created in Steps 8 and 9. The steps to create a task depend on your version of Windows, and might involve a guided wizard or a tabbed window.

D. When you are required to enter the username and password used to run the scheduled task, enter the administrator and password. Verify

Use this section to confirm that your configuration works properly.

1. Check the Restart Status XML output files created in the folder C:\Schedule_Restart_Channels.

The XML file should contain this response result:

Restart successful 0 2. Check the application log on the Encoder. The information event "SMS Message Received" should be recorded. Troubleshoot

There is currently no specific troubleshooting information available for this configuration.

Updated: Aug 05, 2015 Document ID: 119018