Connect Asterisk 18.x.x (Pjsip) with Ldap

Greetings,

I want to use an Asterisk with an OpenLdap but I cannot get these two together.

I´ve setup the Asterisk according to this guide: https://computingforgeeks.com/how-to-install-asterisk-pbx-on-ubuntu/ and configured the res_ldap.conf according to this guide: LDAP Integration
Setting up the [_general] part in the res_ldap.conf.

When I check the ldap connection with realtime show ldap statusI get

Connected to ‘ldap://localhost:389’, baseDN dc=ldap,dc=mcgreedy,dc=de with username cn=admin,dc=ldap,dc=mcgreedy,dc=de for 21 minutes, 6 seconds

which looks fine to me.
I´ve setup my OpenLDAP with LAM where I used the Asterisk Modules and created two Testusers.
In the extconfig.conf I set

sipusers => ldap,“ou=users,dc=ldap,dc=mcgreedy,dc=de”,sip
sippeers => ldap,“ou=users,dc=ldap,dc=mcgreedy,dc=de”,sip
extensions = ldap,“ou=extensions,dc=ldap,dc=mcgreedy,dc=de”,extensions

according to the guide.

But when I search for the users with pjsip show contacts I get

No objects found.

According to the module show like sip command the Asterisk uses PJSIP and all modules are running. Also the module res_config_ldap.so is running.

I hope someone can help me :slight_smile:

This is for chan_sip, not for chan_pjsip so that won’t work. I haven’t used LDAP myself with PJSIP, or seen anyone else do so, so can’t provide configuration.

for pjsip you can read this article: (this work for me)

why these schemas not included in distributive? i don’t know

1 Like

They were never contributed, and noone else has done any other work to do so.

also current schema have a bug

cat_metric = AstConfigCategoryMetric
var_metric = ?

var_metric is required in *, but not exist in schema

Thanks a lot this guide worked for me too. I dont know how I could oversee this in my research.

The key point was the custom asterisk schema.