Axivox User guide
Back to the site

Odoo, contact resolution

Looks up the caller in your Odoo by their number and exposes six variables. This module never blocks the call, even if Odoo is unreachable.

In brief

OutputsFound, Not found and Error
FieldsOdoo instance, Number to look up, and the Rename the caller with the found contact's name checkbox
Variables exposed6, always defined, including when the lookup fails
Number looked up by default{{caller}}
Renamingchecked by default
Blocking the callnever, whatever happens
Wait timenot adjustable here; capped at 8 seconds

The label of the block placed on the plan is Odoo Contact. The help text shown in the window is: "Looks up the Odoo contact matching the calling number (res.partner) and exposes {{odoo_found}}, {{odoo_partner_name}}, {{odoo_partner_id}}, {{odoo_user_id}}, {{odoo_user_name}}, {{odoo_user_extension}} (the salesperson's extension, empty if they don't have one). Outputs: Found / Not found / Error. If Odoo is unreachable, the call continues (fail-open)."

How it works

The lookup

The module searches Odoo's contacts for the one whose phone number matches the caller. It tries several forms of the same number, because a caller can arrive as +32…, 0032… or 0… depending on the carrier, and it backs this up with a comparison on the last nine significant digits. The first matching contact is kept.

It then reads their name and their salesperson, then goes to fetch that salesperson's extension from their Odoo record. A salesperson with no extension set leaves this last value empty.

The six variables

VariableWhat it contains
odoo_found1 if a contact was found, 0 otherwise
odoo_partner_namethe contact's name
odoo_partner_idtheir Odoo ID
odoo_user_idtheir salesperson's ID
odoo_user_nametheir salesperson's name
odoo_user_extensionthat salesperson's extension, empty if they don't have one

They are always defined, even after a failure: in that case odoo_found equals 0 and the others are empty. You can therefore test them downstream without worrying about a missing value.

{{odoo_user_extension}} connects directly to a Call module: the caller reaches the salesperson handling their account, without you having to maintain a mapping by hand.

Renaming

The Rename the caller with the found contact's name checkbox replaces the caller's displayed name with the contact's. Your colleague reads the customer's name on their phone screen, even before answering. It is checked by default.

This module never blocks the call

This is the most important point, and the least known. This module enriches the call, it does not decide its fate. Whatever happens, Odoo down, expired credentials, a suspended instance, the call continues.

To do this, the module takes the first connected output, in a preference order: first the correct branch, then the others as a fallback. Three consequences, all useful:

What to fill in

FieldWhat is expectedIf you leave it empty
Odoo instancethe Odoo to query, among those declared in Integrations, OdooDefault instance, meaning the resolution instance declared for your installation
Number to look upthe number, generally {{caller}}; another variable is accepted{{caller}}
Rename the caller with the found contact's namechecked, the contact's name shows on the phone calledunchecked, the name passed by the carrier is kept

Steps

  1. First check that your Odoo is connected, in Integrations, Odoo, and that the instance is active there.
  2. Place the Odoo, contact resolution module and connect the previous node to its input.
  3. Open it and choose the Odoo instance, or leave the default instance if you only have one.
  4. Leave {{caller}} in Number to look up, unless you want to look up a number obtained another way, for example from a DTMF entry.
  5. Decide on renaming. Leave the box checked if your teams answer on phones that display the name.
  6. Click Save.
  7. Connect at minimum the Found output. Connect Not found and Error too the day you want to handle them differently.
  8. Place a Debugging module right after, with the message found={{odoo_found}} name={{odoo_partner_name}} extension={{odoo_user_extension}}.
  9. Click Save, then Apply changes in the top banner.
  10. Call from a number that exists in Odoo, then open the plan's Debug log and check the name found.

If it doesn't work

All calls come back Not found. The caller's number does not match any contact. Open the contact's record in Odoo and check that their phone number is filled in, then compare its format to the value of {{caller}} read in the Debug log. A contact with no number will never be found, no matter how good their record otherwise is.

The name doesn't show on my colleague's phone. Check the Rename the caller with the found contact's name box in the module. Then check that the found contact does have a name, and that the phone called displays the name and not just the number.

Calls keep being routed even though Odoo is down. This is the expected behavior. This module is never blocking: it takes the first connected output and the call moves on. Your six variables are then empty, and {{odoo_found}} equals 0.

The Error output is never taken. For the same reason. If Error is not connected, the module falls back to another connected output rather than cutting the call off. Connect Error if you want to see it used.

{{odoo_user_extension}} is always empty. Two cases. The contact has no salesperson assigned in Odoo, in which case {{odoo_user_name}} is also empty. Or the salesperson has no extension set on their Odoo record, and it needs to be filled in there.

How the call flow is built, explained in pictures

See the Dial plans page