Stefano Pranzo Posted December 27, 2016 #1 Share Posted December 27, 2016 Hello everyone. with SWConfigDataClientLib.Proxies.Users.UserEntrySortableCollection () method I get the collections of the user. how can I have the PubblicNumber the User? Thanks and happy new year Pranzo Stefano, foruNET Informatik AG (Cham, CH). Link to comment Share on other sites More sharing options...
Most Valued User Sebastian Dreier Posted January 6, 2017 Most Valued User #2 Share Posted January 6, 2017 Hello Stefano, there are multiple ways to get the internal and public numbers of the user. Lets take the easy way first: // Create and configure new LibManager object var libManager = new LibManager() { BaseProtocol = SProxyObject.BaseProtocol.TCP, Username = "admin", Password = "mypass", WSBaseUrl = "127.0.01", AuthenticationMode = SProxyObject.AuthenticationMode.Trusted // Windows Authentication }; // Get Admin Facade var adminFacade = libManager.GetAdminFacade(); // Get User View Entries UserDeviceSmallMap userDeviceSmallMap; var userEntries = adminFacade.GetUserAdminView1(false, out userDeviceSmallMap).CreateSortableFilterCollection(); // Print user name and public numbers to console foreach (var userEntry in userEntries) { Console.WriteLine("--------------------------------------------------------------------------"); Console.WriteLine("User: " + userEntry.Name); Console.WriteLine("Internal Numbers: " + userEntry.InternalNumbers); Console.WriteLine("Internal Fax Numbers: " + userEntry.InternalFaxNumbers); Console.WriteLine("Public Numbers: " + userEntry.PublicNumbers); Console.WriteLine("Public Fax Numbers: " + userEntry.PublicFaxNumbers); } // Cleanup adminFacade.FreeForReuse(); libManager.FreeForReuse(); adminFacade = null; libManager = null; The internal and public numbers are returned as strings with semicolon as separator (e.g. 100;101;102). Public numbers are always assigned to one internal number (one internal number can have multiple public numbers). When you use the easy way as described above you cannot see which numbers belong to each other. If you need this information please let me know and I will provide another sample. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.