public string Create(string channelName, MediaEncoding channelEncoding, MediaProtocol inputProtocol, string inputAddressAuthorized, int?inputSubnetPrefixLength, string previewAddressAuthorized, int?previewSubnetPrefixLength, int?archiveWindowMinutes, bool?archiveEncryption) { if (!archiveEncryption.HasValue) { archiveEncryption = false; } string channelId = string.Empty; string authToken = homeController.GetAuthToken(this.Request, this.Response); if (!string.IsNullOrEmpty(authToken)) { MediaClient mediaClient = new MediaClient(authToken); channelId = mediaClient.CreateChannel(channelName, channelEncoding, inputProtocol, inputAddressAuthorized, inputSubnetPrefixLength, previewAddressAuthorized, previewSubnetPrefixLength, archiveWindowMinutes, archiveEncryption.Value); } return(channelId); }
public JsonResult command(string commandId, int parameterId, string parameterName, bool parameterFlag) { string authToken = GetAuthToken(this.Request, this.Response); MediaClient mediaClient = new MediaClient(authToken); switch (commandId) { case "channelCreate": mediaClient.CreateChannel(parameterName); break; case "channelSignal": mediaClient.SignalChannel(parameterName, parameterId); break; case "accountClear": Account.ClearAccount(mediaClient, parameterFlag); break; } string[][] entityCounts = Account.GetEntityCounts(mediaClient); return(Json(entityCounts)); }