Win32::WindowsMedia - Base Module for Provisiong and control for Windows Media Services |
Win32::WindowsMedia - Base Module for Provisiong and control for Windows Media Services
Version 0.258
This is a module to control Windows Media services for a Windows 2003/2008 server. This is a complete change to the pre-alpha releases (0.15 and 0.16) as all functions are now in one module. To create a Windows Media control instance do the following
use Win32::WindowsMedia; use strict;
my $main =new Win32::WindowsMedia;
my $create_server = $main->Server_Create("127.0.0.1");
The $create_server variable should return 1 on success or 0 on failure. You can then call the other functions against the main object, an example would be
my $publishing_point = $main->Publishing_Point_Create( "127.0.0.1","andrew", "push:*", "broadcast" );
If you can create objects for multiple addresses (need to be in the same domain) you call the functions against the specific IPs. Most uses of the module will be against the local instance of Windows Media which should be 127.0.0.1
Server_Create
Server_Create( "<IP>" );
Example of Use
my $result = $main->Server_Create("127.0.0.1");
On success $result will return 1, on failure 0. If there is a failure error is set and can be retrieved.
Server_Destroy
Server_Destroy( "<IP>" );
Example of Use
my $result = $main->Server_Destroy("127.0.0.1");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Create
Publishing_Point_Create( "<IP>", "<publishing point name>", "<URL>", "<Type>" );
Publishing point name - Can be any alphanumeric and _ characters URL - can be one of push:* , or http://<ip>/<pub point> for relay Type - Can be one of OnDemand, Broadcast, CacheProxyOnDemand, CacheProxyBroadcast
Example of Use
my $result = $main->Publishing_Point_Create("127.0.0.1","andrew","push:*","broadcast");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Remove
Publishing_Point_Remove( "<IP>", "<publishing point name>" );
my $result = $main->Publishing_Point_Remove("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Start
Publishing_Point_Start( "<IP>", "<publishing point name>" );
Example of Use
my $result = $main->Publishing_Point_Start("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_Stop
Publishing_Point_Stop( "<IP>", "<publishing point name>" );
Example of Use
my $result = $main->Publishing_Point_Stop("127.0.0.1","andrew");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved.
Publishing_Point_List
Publishing_Point_List( "<IP>", "<partial match>" );
Example of Use
my @publishing_point = $main->Publishing_Point_List( "127.0.0.1", "*");
The above will return all publishing points defined.
Publishing_Point_Authorization_ACL_Add
Publishing_Point_Authorization_ACL_Add ("<IP>","<publishing point name>","<pointer to hash of users");
The <hash of users> is made up of a username as the key and their mask being comma seperated entries made up from UserAccessSettings function. The allowable entries are
ACCESSINIT ReadDeny WriteDeny CreateDeny AllDeny UNKNOWN ReadAllow WriteAllow CreateAllow AllAllow
To build an entry use the following
my %user_list = ( 'Username' => 'ReadAllow,WriteAllow' 'username2' => 'ReadAllow' );
This would allow the user 'Username' to read and write to the stream ( so push ), and also allow user 'username2' to read from the stream ( so listen ).
You must remember the server must have these usernames configured, or accessable otherwise it will fail (silently). You can specify a username in a domain, such if the server is configured in a domain, and do to so requires you to put the domain before the username. To change 'Username' to be part of a domain it should be changed to 'domain\\Username' where 'domain' is the name of the domain the user is in. Note the double \ is required.
There is a SPECIAL user called 'Everyone' ( well it is a user defined on the server by default ) and is configured so that if added to the publishing point it allows anyone to listen. If you do not want to use username/password for encoders to connect you need to remove and then re-add Everyone with permissions of ReadAllow,WriteAllow.
Example of Use
my %user_list = ( 'Everyone' => 'ReadAllow,WriteAllow'); $main->Publishing_Point_Authorization_ACL_Remove( "127.0.0.1", "publishing_point", \%user_list); $main->Publishing_Point_Authorization_ACL_Add( "127.0.0.1", "publishing_point", \%user_list);
This will remove the username Everyone from the ACL then add it back in with read and write permissions.
Publishing_Point_Authorization_ACL_Remove
Publishing_Point_Authorization_ACL_Remove ("<IP>","<publishing point name>","<pointer to hash of users");
Example of Use
my %user_list = ( 'Everyone' => 'ReadAllow,WriteAllow'); $main->Publishing_Point_Authorization_ACL_Remove( "127.0.0.1", "publishing_point", \%user_list);
Publishing_Point_Authorization_ACL_List
Publishing_Point_Authorization_ACL_List ("<IP>","<publishing point name>","<pointer to hash");
Example of Use
my %user_list; $main->Publishing_Point_Authorization_ACL_List( "127.0.0.1", "publishing_point", \%user_list);
Publishing_Point_Log_Set
Publishing_Point_Log_Set( "<IP>","<publishing point name>","<pointer to hash for template");
Example of Use
my %log_settings = ( 'Template' => 'D:\Andrew\logs-<Y><m><d>.log', 'Cycle' => 'Month', 'UseLocalTime' => 'Yes', 'UseBuffering' => 'Yes', 'UseUnicode' => 'Yes', 'V4Compat' => 'No', 'MaxSize' => 0, 'RoleFilter' => 'SHAMROCK', 'LoggedEvents' => 'Player,Local' );
$main->Publishing_Point_Log_Set("127.0.0.1","publishing_point",\%log_settings);
Cycle can be one of None Size Month Week Day Hour
MaxSize is in Mbytes and only used when Cycle is Size
LoggedEvents can be None Player Distribution Local Remote Filter seperated by a comma (,)
You can also use FreeSpaceQuota. This has a default of 10, which means 10Mbytes. The attribute means how much free space should be available for logging to work.
Publishing_Point_Log_Enable
Publishing_Point_Log_Enable("<IP>","<publishing point name>");
Example of Use
$main->Publishing_Point_Log_Enable("127.0.0.1","publishing_point");
Publishing_Point_Log_Disable
Publishing_Point_Log_Disable("<IP>","<publishing point name>");
Example of Use
$main->Publishing_Point_Log_Disable("127.0.0.1","publishing_point");
Publishing_Point_Log_Cycle
Publishing_Point_Log_Cycle("<IP>","<publishing point name>");
Example Of Use
$main->Publishing_Point_Log_Cycle("127.0.0.1","publishing_point");
Publishing_Point_Authorization_IPAddress_Add
Publishing_Point_Authorization_IPAddress_Remove
Publishing_Point_Authorization_IPAddress_Get
Publishing_Point_General_Set
Publishing_Point_General_Get
Publishing_Point_Players_Get
Server_CoreVariable_Get
Playlist_Jump_To_Event
Playlist_Jump_To_Event( "<IP>", "<publishing point name>", "<playlist position>" );
Example of Use
my $result = $main->Playlist_Jump_To_Event("127.0.0.1","andrew","position2");
On success $result will return 1, on failure 0. If there is a failure, error is set and can be retrieved. If an incorrect event, publishing point or IP are specified no error is usually returned.
Andrew S. Kennedy, <shamrock at cpan.org>
Please report any bugs or feature requests to
bug-win32-windowsmedia at rt.cpan.org
, or through the web interface at
http://rt.cpan.org/NoAuth/ReportBug.html.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.
http://rt.cpan.org/NoAuth/Bugs.html
Copyright 2008 Andrew S. Kennedy, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Win32::WindowsMedia - Base Module for Provisiong and control for Windows Media Services |