Create interconnexion LDAP

Good morning,

I am looking to add an LDAP directory for directory search but in reverse to do the name of the callers.
On WAzo UI, I see Directory > Source

I add an LDAP:

Now apart from the fact that I am not at all sure that it is correctly configured, how do I assign it to the positions?

Thanks

You need to activate the feature you want to do with this directory and map the field correctly in the interface. Also check the log on wazo-dird to debug the request.
The features are search contact in phone, reverse the caller id number to a name, or make a contact favorite (by API, you need to dev an app to use it). Check the profiles to finish your configuration and add the source “annuaire”.

Information here: https://wazo-platform.org/uc-doc/administration/contact_directories/general

Good morning,

thank you for your return
So on the principle if we base wazo-ui:
we configure in : Directory > source > ldap , the directory
and
after?

For phones, I guess I need to add this source? If yes, how do I add it?

The ldap exists and I have an independent interface which manages this directory

Thanks

hello,

french:
tu as créé ton annuaire LDAP, en supposant que les champs correspondent bien.

Maintenant, il te faut l’ajouter dans les sources.
Pour cela:
Directory / profiles
du sĂ©lectionne le “default” et tu le modifie.
tu clique sur le petit + en bas Ă  droite du tableau
et tu pourras choisir ton annuaire ldap dans la liste déroulante.

ensuite, il te faut faire des requĂȘtes dessus.

je n’ai pas testĂ© l’annuaire LDAP, mais voilĂ  un code reactJs qui pourrait fonctionner (Ă  modifier au besoin):

const contactsPhonebooksGet = async () => {
    const phonebookSources = await Wazo.dird.fetchSourcesFor("default")
    const filteredPhonebookSources = phonebookSources.items.filter(
      (source) => source.backend === "ldap"
    );
    
    const results = await Promise.all(
      filteredPhonebookSources.map(async (source) => {
        const phonebookContacts = await Wazo.dird.fetchPhonebookContacts(source);
        const itemsWithSource = phonebookContacts.items.map((item) => ({
              ...item,
              backend: source.backend,
              source: source.name,
              sourceId: item.id,
              name: item.firstname + ' ' + item.lastname,
              favorited: false
            }));
            return { source, phonebookContacts: { ...phonebookContacts, items: itemsWithSource } };
          })
        );
    const allItems = results.reduce((accumulator, currentItem) => {
      accumulator.push(...currentItem.phonebookContacts.items);
      return accumulator;
    }, []);
    setContactsPhonebook(allItems)
  }

au résultat du auras un tableau de tous les contacts de tous les annuaires ayant la valeur:
backend = ‘ldap’
(à voir si c’est la bonne valeur
on peut la trouver avec un console.log de phonebookSources)

Dans ce code, tu peux donc avoir plusieurs annuaires LDAP.

cheers

Thanks a lot in fact I don’t really know what was blocking it but I tried again and it worked without a problem.
thank you

Just a follow-up question:
in my LDAP, for a user, I have a fixed field (telephonenumber), and mobile (mobile)
When I search for a name from the post, I only get a return on the fixed field. The mobile field does not appear. How can I have 2 lines for the name to search for and be able to distinguish them (one fixed, the other mobile for example)?

THANKS

hello florent,

as you speak french, my answer will be in french :slight_smile:

dans ta source annuaire LDAP, tu dois avoir un champ “columns” dans lequel tu renseigne tes champs à retourner, avec un nom correspondant

tu peux Ă©diter ton annuaire
et ajouter
mobile {mobile}

tu peux ajouter autant de champs que tu veux, comme
company
departement
CN
displayName
mail

tu peux facilement retrouver les champs disponibles dans l’AD en recherchant:
active directory user attributes list sur google

ensuite, tu pourras Ă©diter “search columns”
pour dĂ©finir quels sont les champs requĂ©tĂ©s lors d’une recherche

cheers !

This allows me to work on my English :slight_smile:

So I had already tried to add this field and unfortunately it didn’t work
I always only have the landline number (telephone number) which is displayed

thanks :slight_smile:

displayed where ?

if you try to get this contact with the API
you should have all columns in a json

can we have more explaination or a screenshot ?

because, with this API, what you want is what you get :wink:

cheers

I don’t use an API (too noob :slight_smile: for now)

Yes indeed I did not specify, but my tests are only on telephone terminals. I do a simple directory search in my Mitel or Yealink terminals (the result is the same)

Well,

i think this is a template related issue.

i don’t use phone for call, that’s so 2000 :stuck_out_tongue_winking_eye:

maybe, you have to name the desired columns to make it match the directory.xml for your phone

example, you yealink is configured, from factory to display
name
telephone
number
etc
so, on your ldap source, you must have the same name to match the device configuration.

As i don’t know how to change the default phonebook.xml, i can’t answer your question.

google find it for me:

<DirectoryEntry>
    <Name>Chris Wild</Name>
    <Telephone>5053</Telephone>
    <Telephone>5553</Telephone>
</DirectoryEntry>

<DirectoryEntry>
    <Name>Door Intercom</Name>
    <Telephone>sip:123@10.10.0.200</Telephone>
</DirectoryEntry>

<DirectoryEntry>
    <Name>Provu</Name>
    <Telephone>01484840048</Telephone>
</DirectoryEntry>

looks like default phonebook.xml only check for Name and Telephone entries.

hope it helps you.

cheers

edit,
looks like you can have multiple Telephone columns
maybe that’s the fix.
name all related number columns to telephone and it will match !
:slight_smile:

Good morning

thanks for your return.
However, it is not the search for the position that poses a problem. In fact the station is configured to search in the wazo directory and additional sources

It will request the address : http://addresswazo:9498/0.1/lookup/default

The result appears to be JSON which is then retrieved by the post.
It is this search for JSON that should be adapted.

thanks

I just need to post this message to find the solution:

it was a syntax problem: mobile no but phone_mobile yes

In columns, I just had to put phone_mobile in name opposite my associated ldap field. And from now on in my directory search for my station (Mitel and Yealink identically) I have a line marked “name (mobile)” which appears

thank you

1 Like