# Create interconnexion LDAP

**URL:** <https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413>\
**Category:** English\
**Created:** [December 13, 2023, 3:04pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413 "2023-12-13T15:04:58Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [December 13, 2023, 3:04pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/1 "2023-12-13T15:04:58Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/4a1f9871385572755d0ebf891957c0deca47edc6.png)

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

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [December 18, 2023, 3:08pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/2 "2023-12-18T15:08:14Z")

</div>

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](https://wazo-platform.org/uc-doc/administration/contact_directories/general)

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 7, 2024, 12:22pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/3 "2024-02-07T12:22:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![julienfr](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/julienfr/32/797_2.png) [@julienfr](https://wazo-platform.discourse.group/u/julienfr)\
**Post date:** [February 7, 2024, 3:16pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/4 "2024-02-07T15:16:26Z")

</div>

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):

```auto
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

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 9, 2024, 11:34am UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/5 "2024-02-09T11:34:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![julienfr](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/julienfr/32/797_2.png) [@julienfr](https://wazo-platform.discourse.group/u/julienfr)\
**Post date:** [February 9, 2024, 2:16pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/6 "2024-02-09T14:16:03Z")

</div>

hello florent,

as you speak french, my answer will be in french 🙂

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

 ![image](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/3f225e771e2230727fcc0fdc3746a8716beb99de.png)

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

 ![image](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/18daf7f3cbe1539fa9daac06ff38976ae8a1f037.png)

cheers !

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 9, 2024, 2:34pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/7 "2024-02-09T14:34:31Z")

</div>

This allows me to work on my English 🙂

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 🙂

---

<div class="post-metadata">

**Author:** ![julienfr](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/julienfr/32/797_2.png) [@julienfr](https://wazo-platform.discourse.group/u/julienfr)\
**Post date:** [February 9, 2024, 2:39pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/8 "2024-02-09T14:39:53Z")

</div>

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 😉

cheers

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 9, 2024, 2:42pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/9 "2024-02-09T14:42:43Z")

</div>

I don’t use an API (too noob 🙂 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)

---

<div class="post-metadata">

**Author:** ![julienfr](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/julienfr/32/797_2.png) [@julienfr](https://wazo-platform.discourse.group/u/julienfr)\
**Post date:** [February 9, 2024, 3:12pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/10 "2024-02-09T15:12:24Z")

</div>

Well,

i think this is a template related issue.

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

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 !  
🙂

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 13, 2024, 12:33pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/11 "2024-02-13T12:33:29Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Florent42](https://avatars.discourse-cdn.com/v4/letter/f/e19adc/32.png) [@Florent42](https://wazo-platform.discourse.group/u/Florent42)\
**Post date:** [February 13, 2024, 12:39pm UTC](https://wazo-platform.discourse.group/t/create-interconnexion-ldap/1413/12 "2024-02-13T12:39:45Z")

</div>

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
