Jump to content

PubblicNumber User


Stefano Pranzo

Recommended Posts

  • 2 weeks later...
  • Most Valued User

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


Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.