Showing results for 
Search instead for 
Did you mean: 

How to Configure Schedule Task to Invoke Cisco AnyResLive API via WGET



Sometimes we need to restart the encoding channel in a regular basis, i.e daily or weekly.
On the CMP encoder, this can be done through configuring some schedule events. But the schedule could happen in the 2 recurring types: Daily & Weekly.

This document will introduce the steps to configure Schedule Task to invoke API to restart the encoding channel/stream in a more flexible frequency.


The same procedures can be applied to invoke any other functions provided by the Cisco AnyResLive (Spinnaker Message Service) API.





- Administrator access to the Cisco AnyResLive encoder

- Understanding of how the Batch file and script work on Windows


Components Used

- wget

- windows batch script

- windows task scheduler

-  Spinnaker Message Service API



Configuration Steps


1, Download the wget from and install it on the Audio encoder, the application will be installed under C:\Program Files\GnuWin32\bin

2,  After installing wget on the encoder, add the path  “C:\Program Files\GnuWin32\bin” to the system Variable



3, Enable the Message Service from the Encoder management GUI: System-->Message Service




4, Create a folder C:\Schedule_Restart_Channels under C drive.
Under folder created, create XML file named: Restart_Channel1.xml (more xml files could be created if needed) copy the below content into the files, the only thing need to change for each channel is the <Channel> item below:

<?xml version="1.0" encoding="UTF-8"?>

<GUID> could be any value, the default one in the file should be fine
<Traget> please use the computer name of the Encoder
<Channel> Put the channel number for which needs to be restarted
<Stream> Put 0 here so it will restart all the streams under the channel


5, Under folder created in step 3, create a batch file Restart_Channels.bat with the below content

@echo off
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


- Please change the ip address of the encoder accordingly.

- The --post-file option needs to use the XML file created in step 4, if there are more than 1 XML file to be used then please create more lines to run wget accordinly
- The restart status will be saved under the same folder in XML file named: Restart_Status_ch<x>_<date>.xml


6, Create a Windows schedule event:
    Control Panel —> Scheduled Task, select the batch file created in step 5 to execute (now it can be scheduled to happen once a weekly only).
    When it requires to enter the password, please input the password for the admin user.




1) Check the restart status XML files created under the folder: C:\Schedule_Restart_Channels, the XML file will have the response result:
       <Result>Restart successful</Result>


2) Check the application log on the encoder, the following information type event (SMS Message Received) will be recorded:  






WGET to post XML file and get the output:

Please download the sample script and XML files in the attachment below

If you need more assistance on AnyResLive API please contact Cisco TAC

Content for Community-Ad

This widget could not be displayed.