/* * * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callDoDeviceLogin(AXLAPIService axlApiService) { //metadata please fill your data and use it. String strDeviceName = ""; String strLoginDuration = ""; String strUserId = ""; String strProfileName = ""; DoDeviceLoginReq request = new DoDeviceLoginReq(); XFkType xfkType = new XFkType(); xfkType.Value = strDeviceName; request.deviceName = xfkType; request.loginDuration = strLoginDuration; xfkType = new XFkType(); xfkType.Value = strProfileName; request.profileName = xfkType; request.userId = strUserId; DoDeviceLoginRes response = axlApiService.doDeviceLogin(request); Console.WriteLine("Successfully executed by AXL using DoDeviceLoginRequest" + response.@return); }
/* Add Phone API * Associating a line with the phone. * ( mandatory tags only used to add a phone) * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callAddPhone(AXLAPIService axlApiService) { AddPhoneReq addPhoneReq = new AddPhoneReq(); addPhoneReq.phone = new XPhone(); addPhoneReq.phone.name = "SEP170000100002"; addPhoneReq.phone.description = "Adding Phone thru .Net Client"; addPhoneReq.phone.product = "Cisco 7960"; addPhoneReq.phone.@class = "Phone"; addPhoneReq.phone.protocol = "SCCP"; addPhoneReq.phone.protocolSide = "User"; XFkType xfktype = new XFkType(); xfktype.Value = "Default"; addPhoneReq.phone.devicePoolName = xfktype; xfktype = new XFkType(); xfktype.Value = "Standard Common Phone Profile"; addPhoneReq.phone.commonPhoneConfigName = xfktype; xfktype = new XFkType(); xfktype.Value = "Hub_None"; addPhoneReq.phone.locationName = xfktype; addPhoneReq.phone.useTrustedRelayPoint = "Default"; addPhoneReq.phone.lines = new XPhoneLines(); addPhoneReq.phone.lines.Items = new XPhoneLine[1]; XPhoneLine line = new XPhoneLine(); line.index = "5"; line.display = "Line1"; //existing directory number line.dirn = new XDirn(); line.dirn.pattern = "11233"; xfktype = new XFkType(); xfktype.Value = "AXL-RP"; line.dirn.routePartitionName = xfktype; addPhoneReq.phone.lines.Items.SetValue(line, 0); StandardResponse res2 = axlApiService.addPhone(addPhoneReq); Console.WriteLine("end of the addPhoneReq" + res2.@return); }
/* AddLine API * Simple Adding of a line with mandatory tags * * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callAddLine(AXLAPIService axlApiService) { AddLineReq addLineReq = new AddLineReq(); addLineReq.line = new XLine(); addLineReq.line.pattern = "9999"; addLineReq.line.description = "Adding a line from .NetClient"; addLineReq.line.usage = "Device"; XFkType xfktype = new XFkType(); //routepartion value xfktype.Value = ""; addLineReq.line.routePartitionName = xfktype; StandardResponse res2 = axlApiService.addLine(addLineReq); Console.WriteLine("Successfully added an Line using of AddLineRequest" + res2.@return); }
/* * A simple AddEndUser request with only mandatory tags * ##Values in the method are hardcoded please modify accordingly to make it work## */ private static void callAddEndUser(AXLAPIService axlApiService) { AddUserReq addUserReq = new AddUserReq(); addUserReq.user = new XUser(); addUserReq.user.userid = "DotNetuser"; addUserReq.user.lastName = "Visual Studio"; XFkType xfktype = new XFkType(); //presenceGroup Name value xfktype.Value = "Standard Presence group"; //Or the UUID //xfktype.uuid="" addUserReq.user.presenceGroupName = xfktype; StandardResponse res2 = axlApiService.addUser(addUserReq); Console.WriteLine("Successfully added an User using AddEndUserRequest" + res2.@return); }
/* AddDeviceProfile * * A simple AddDevice Profile request with only mandatory tags * * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callAddDeviceProfile(AXLAPIService axlApiService) { AddDeviceProfileReq addDeviceProfileReq = new AddDeviceProfileReq(); addDeviceProfileReq.deviceProfile = new XDeviceProfile(); addDeviceProfileReq.deviceProfile.name = "DeviceNet"; addDeviceProfileReq.deviceProfile.product = "Cisco 7960"; addDeviceProfileReq.deviceProfile.protocol = "SCCP"; addDeviceProfileReq.deviceProfile.protocolSide = "User"; addDeviceProfileReq.deviceProfile.@class = "Device Profile"; XFkType xfktype = new XFkType(); xfktype.Value = "SEP555555555555-SCCP-Individual Template"; addDeviceProfileReq.deviceProfile.phoneTemplateName = xfktype; StandardResponse response = axlApiService.addDeviceProfile(addDeviceProfileReq); Console.WriteLine("Successfully added DeviceProfile " + response.@return); }
/* * * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callDoDeviceReset(AXLAPIService axlApiService) { //metadata please fill the data String strDeviceName = ""; DoDeviceResetReq request = new DoDeviceResetReq(); XFkType xfkType = new XFkType(); xfkType.Value = strDeviceName; request.deviceName = xfkType; request.ItemElementName = ItemChoiceType34.isHardReset; request.Item = "true"; //If the other choice is required uncomment the lines below //And comment out the above lines. //request.ItemElementName = ItemChoiceType34.deviceResetType; //request.Item ="Reset"; DoDeviceResetRes response = axlApiService.doDeviceReset(request); Console.WriteLine("Successfully executed by AXL using DoDeviceReserRequest" + response.@return); }
/*To modify CSS and update line * * ##Values in the method are hardcoded please modify accordingly to make it work### */ private static void callUpdatePhoneToModifyCSS(AXLAPIService axlApiService) { UpdatePhoneReq request = new UpdatePhoneReq(); request.ItemElementName = ItemChoiceType32.name; request.Item = "SEP100000100003"; XFkType xfkType = new XFkType(); xfkType.Value = "AXL-CSS0"; request.callingSearchSpaceName = xfkType; request.lines = new UpdatePhoneReqLines(); request.lines.Items = new XPhoneLine[1]; XPhoneLine line = new XPhoneLine(); line.index = "2"; line.display = "Line32"; //existing directory number line.dirn = new XDirn(); line.dirn.pattern = "10002"; xfkType = new XFkType(); xfkType.Value = "AXL-RP"; line.dirn.routePartitionName = xfkType; request.lines.Items.SetValue(line, 0); xfkType = new XFkType(); xfkType.Value = "Standard 7960 SCCP"; request.phoneTemplateName = xfkType; xfkType = new XFkType(); xfkType.Value = "Cisco 7960 - Standard SCCP Non-Secure Profile"; request.securityProfileName = xfkType; xfkType = new XFkType(); xfkType.Value = "Default"; request.devicePoolName = xfkType; StandardResponse response = axlApiService.updatePhone(request); Console.WriteLine("Successfully executed AXL Update Phone using UpdatePhoneReq" + response.@return); }
public static XFkType NullIfEmpty(this XFkType data) { return(string.IsNullOrEmpty(data.uuid) && string.IsNullOrEmpty(data.Value) ? null : data); }