Asterisk Active directory schema extension

I came across a request where a client want to add Asterisk LDAP extenstion attributes to get populated in Windows active directory. After searching internet, i didn’t come across a single help article to do that. After doing lot of research i was able to get this done.

The goal is go get the following attributes populated in AD, so that asterisk can create extensions based on these attributes

New Attributes need to be populated in AD:
AstAccountCallerID: Russell Bryant
AstAccountContext: LocalSets
AstAccountDTMFMode: rfc2833
AstAccountMailbox: 101@shifteight
AstAccountNAT: yes
AstAccountQualify: yes

Existing Attributes in AD
displayName: Russell Bryant
uidNumber: 1001
gidNumber: 10001
userPassword: {md5}a7be810a28ca1fc0668effb4ea982e58
uid: rbryant

Steps follows:

Create the attributes in Active directory schema

Open command prompt and type regsvr 32 schmmgmt.dll

from command prompt type mmc and add active directory schema management console

 

image

 

Right click on any of the attribute and go into properties. Copy the ID number

 

image

 

we need last 4 digits to be unite for each new custom attributes, I decided to use 33200 and onward five digit number, it will look like

 

image

 

right click on attribute and click on create attribute.

 

image

Ignore the warning and add the attribute, as asterisk just need to see values and string can take any kind of value I choose “Unicode String” in the syntax

 

image

 

Click ok and add rest of the attributes in exactly same way, make sure you use unique X500 OID for rest of the attributes, like in above example the last digits are 33201 and now for next attribute, use 33202 in the OID for last 5 digits.

 

Add the attributes to “user” class

 

Expand classes and look for “user” class

 

image

 

image

 

Right click on user and select properties, select attribute tab in the properties window. Add the newly created attributes and click on ok. MMC may give you error but it usually adds the attributes to user class. If MMC crash, re-pen and make sure the attributes are showing in the user class.

 

image

 

image

 

Import the user attributes using ldifde utility. create the file in following format and save it as .ldf file.

dn: CN=Russell Bryant,OU=Employees,DC=domain,DC=local
changetype: modify
add: AstAccountCallerID
AstAccountCallerID: Russell Bryant

add: AstAccountContext
AstAccountContext: LocalSets

add: AstAccountDTMFMode
AstAccountDTMFMode: rfc2833

add: AstAccountMailbox
AstAccountMailbox: 101@shifteight

add: AstAccountNAT
AstAccountNAT: yes

add: AstAccountQualify
AstAccountQualify: yes

add: uidNumber
uidNumber: 1001

add: gidNumber
gidNumber: 10001

add: userPassword
userPassword: {md5}a7be810a28ca1fc0668effb4ea982e58

you need to use – after every attribute ldifde treat it as terminator. Save the file as .ldf file.

import the file using following command.

ldifde -i –f <filename> –s <DC name> in my case I used

ldifde -i -f Exportuser.ldf –s spi-dc05

 

Please contact us if you need any assistance or have any questions related to this post.

Supported technologies

Need Help?

No problem! Our friendly team is here to help answer any concerns you might have.

Contact Us

Every day over 2500 devices are managed by our NOC Engineers
and over 25 Hosting and MSP companies leverage our NOC services to get their job done.

We let our users do talking

Sign up for our Newsletter

Register to receive news and updates

[newsletter]
Copyright offsitenc 2020 – All Rights Reserved