Jump to content

LDAP - .Net Windows app Retrieving Directory Entries and Info from PBX Tenant


Recommended Posts

Posted

Hi guys,

We have recently been moved to a Tenant on a Vodia PBX with Vonex (Australia).

We have written a .Net desktop application that users run on their computers, that allows them to dial their Yealink desk phone from the PC, by sending commands directly to their handset.

We would like to be able to use LDAP or similar to query the PBX for information such as a list of users and their numbers, Address book entries and ideally, the local/internal IP of the handset registered to the account.

Is anyone able to give us any information that might steer us in the direction of doing this please.

Examples in VB.Net or C# would be fantastic.

Thank you.

Regards,

Jeff Davies.

 

Posted

I would also stay away from LDAP. It is just a very limited protocol, compared to REST. I would less use Wireshark and more the Inspector of the we browser of your choice, where you can see how the browser pulls the information from the PBX. Usually its easier to understand than even the best API documentation if you are familiar with JSON and the REST idea.

Posted

Thanks Mr Vodia PBX.

In case anyone else is interested, we did get LDAP going in a .Net Desktop app, based off the Powershell script below.
We can get a list of Names (cn), Numbers(telephoneNumber) and Company with this. (Probably more.)

We will look at extending functionality with the REST Api down the track.
Thanks for your input.

 

# Needs reference to .NET assembly used in the script.
Add-Type -AssemblyName System.DirectoryServices.Protocols
$username = '<YourPBXsURL.comcom\AccountNo>'
$pwd = '<AccountsLDAPPasswprd>'
$server = "<YourPBXsURL.comcom>"
$port = "<YourPBXsLDAPPort" #Normally 389
$password = $pwd | ConvertTo-SecureString -asPlainText -Force
# Top Level OU under which users are located
$ldapSearchBase = "ou=people" 
# Filter to find the user we are connecting with
$ldapSearchFilter = "(&(objectClass=*))"
# Username and Password
$ldapCredentials = New-Object System.Net.NetworkCredential($username,$password)
# Create a Connection
$ldapConnection = New-Object System.DirectoryServices.Protocols.LDAPConnection("$($server):$($port)",$ldapCredentials,"Basic")
# Connect and Search
$ldapTimeOut = new-timespan -Seconds 30
$ldapRequest = New-Object System.DirectoryServices.Protocols.SearchRequest($ldapSearchBase, $ldapSearchFilter, "OneLevel", $null)
$ldapResponse = $ldapConnection.SendRequest($ldapRequest, $ldapTimeOut)
$ldapResponse.Entries[0].Attributes 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...