This document describes how to schedule regular restarts of the encoding channel with Cisco AnyResLive.
Cisco requires that you have:
- Administrator access to the Cisco AnyResLive Encoder
- Knowledge of how batch files and scripts work on Microsoft Windows
The information in this document is based on these software and hardware versions:
- Wget for Windows
- Windows batch script
- Windows Task Scheduler
- 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, make sure that you understand the potential impact of any command.
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 at a more flexible frequency.
- Download GNU Wget for Windows from the Internet and install it on the Encoder in this location:
- Create a Windows Environment Variable for the Wget folder path:
- On the Windows Start menu, right-click Computer and choose Properties on the context menu.
- Click Advanced System Properties.
- On the Advanced tab, click Environment Variables.
- In the System Variables area, choose the Path variable and click Edit.
- 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.
- Click OK in order to close the open windows.
- Enable the Message Service:
- Open the Encoder Management application and log in as an administrator.
- On the System tab, click Message Service.
- 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.
- Create this folder:
- With your preferred editor, create an XML file in the folder you created in Step 4. Name the file Restart_Channel1.xml and copy this code into the file:
<?xml version="1.0" encoding="UTF-8"?>
- Modify values in the XML code as needed:
- GUID: can be any value; use the default value in the code sample.
- Target: replace 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.
- If you need to restart other channels, repeat Steps 5 and 6 in order to create an XML file for each additional channel.
- Create a batch file in the folder you created in Step 4. Name the file Restart_Channels.bat and copy this code into the file:
for /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
wget http://<encoder ip>:8099/encNode/ --post-file="RestartChannel1.xml" --header=
"Content-Type: application/soap+xml" --output-document=Restart_Status_ch1_%mydate%.xml
- Modify the batch file as needed:
- <encoder_ip>: 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.
- Create an event in Windows Task Scheduler:
- On the Windows Start menu, click Control Panel.
- Locate Task Scheduler (or the "Schedule Task" option) under Administrative Tools.
- 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.
- When you are required to enter the username and password used to run the scheduled task, enter the administrator user and password.
Use this section to confirm that your configuration works properly.
- Check the Restart Status XML output files created in the folder C:\Schedule_Restart_Channels.
The XML file should contain this response result:
- Check the application log on the Encoder. The information type event "SMS Message Received" should be recorded.
There is currently no specific troubleshooting information available for this configuration.