Skip to Content
Menu
This question has been flagged
2 Replies
6069 Views

Tutorial: Connecting Odoo to FreePBX

What it does: The Odoo VoIP softphone seamlessly integrates with Odoo CRM, allowing users to make and receive calls directly from the Odoo interface. Odoo recommends configuring your VoIP with AxiVox.

If you prefer not to use AxiVox due to high costs or poor configurability, you can link Odoo with Asterisk. FreePBX is a relatively easy-to-learn GUI for Asterisk, allowing you to build and manage your own phone systems. For setting up FreePBX, I recommend these tutorials:


Youtube - CrossTalk Solutions - FreePBX 101 - Complete Setup Series (Not enough karma to place a link haha)


Configuring Advanced Settings

Step 1: Log in to the FreePBX Web Interface

  1. Open your web browser and go to the IP address of your FreePBX server.
  2. Log in with your username and password.

Step 2: Adjust Advanced Settings

  1. Navigate to Settings > Advanced Settings.
  2. SIP Channel Driver:
    • Scroll down and find SIP Channel Driver.
    • Change it from 'both' to 'chan_pjsip'. (this is important, Odoo want to make a connection using chan_sip, which is deprecated, if this is not set correctly)
  3. SIP DTMF Signalling:
    • Scroll down and find SIP DTMF Signalling.
    • Change it to 'rfc 2833'.

Step 3: Save and Apply

  1. Click Submit to save the settings.
  2. Click the red Apply Config button at the top of the page to apply the changes.
Configuring Asterisk SIP Settings

Step 1: Log in to the FreePBX Web Interface

  1. Open your web browser and go to the IP address of your FreePBX server.
  2. Log in with your username and password.

Step 2: Adjust General Asterisk SIP Settings

  1. Navigate to Settings > Asterisk SIP Settings.
  2. Go to General SIP settings.
  3. NAT Settings:
    • Add all your local networks under Local Networks.
  4. Audio Codecs:
    • Add the following audio codecs:
      • g722
      • alaw
      • ulaw
      • opus
    • Note: The codecs may vary depending on your trunk provider. These are all required for Odoo to function correctly with FreePBX.

Step 3: Save and Apply

  1. Click Submit to save the settings.
  2. Click the red Apply Config button at the top of the page to apply the changes.
Adjusting Asterisk SIP Settings [chan_pjsip]

Step 1: Log in to the FreePBX Web Interface

  1. Open your web browser and go to the IP address of your FreePBX server.
  2. Log in with your username and password.

Step 2: Adjust [chan_pjsip] Asterisk SIP Settings

  1. Navigate to Settings > Asterisk SIP Settings.
  2. Go to SIP Settings [chan_pjsip].
  3. Enable wss transporter:
    • Go to transporter.
    • Set wss - 0.0.0.0 - All to Yes (important for WebRTC).

Step 3: Save and Apply

  1. Click Submit to save the settings.
  2. Click the red Apply Config button at the top of the page to apply the changes.
Configuring Extensions in FreePBX for Odoo WebRTC

Step 1: Log in to the FreePBX Web Interface

  1. Open your web browser and go to the IP address of your FreePBX server.
  2. Log in with your username and password.

Step 2: Create a New Extension

  1. Navigate to Applications > Extensions.
  2. Click Add Extension and select Add New Extension, then choose Chan_PJSIP as the technology.

Step 3: Configure Extension Settings

  • General Settings:
    • User Extension: Enter the extension number, e.g., 1001.
    • Display Name: Enter the user's name, e.g., the customer's company name.
    • Outbound CID: Leave this field blank unless specific requirements exist.
    • Link to a Default User: Choose Create New User.
    • Groups: Select the groups this user should belong to.
  • Secret (Password):
    • Use a strong password. The default password may be sufficient, but it is better to use a unique and strong password for security.
  • Voicemail:
    • Enable Voicemail: Enable this if you want voicemail for this extension.
    • Voicemail Password: Set a password for accessing voicemail. Use a strong password.
  • Advanced (for Odoo extensions, not for regular extensions):
    • DTMF mode: Set this to RFC4733.
    • Transport: Choose 0.0.0.0-wss (WebSocket Secure).
    • Enable AVPF: Set this to Yes (important for WebRTC).
    • Enable ICE Support: Set this to Yes (important for WebRTC).
    • Enable rtcp MUX: Set this to Yes (important for WebRTC).
    • Disallowed Codecs: all
    • Allowed Codecs: opus&g722&ulaw&alaw
    • Max Contacts: Change from 1 to 5 to allow multiple simultaneous registrations.
    • Enable RTP Symmetric: Set this to Yes.
    • Rewrite Contact: Set this to Yes.
    • Force rport: Set this to Yes.
    • Media Encryption: DTLS-SRTP

Save:

  1. Click Submit to save the changes.
  2. Click Apply Config to apply the configuration.
Explanation of Some Settings
  • Enable AVPF: Required for WebRTC to support AVPF (Audio-Visual Profile with Feedback).
  • Enable ICE Support: ICE (Interactive Connectivity Establishment) helps bypass NAT/firewall restrictions.
  • Enable RTP Symmetric, Rewrite Contact, Force rport: These settings help correctly route RTP and SIP traffic through NAT.
  • Transport: 0.0.0.0-wss is needed for WebRTC to establish the connection via a secure WebSocket.
Extra Checks

Verify Network Configuration:

  • Ensure the external IP address and local network ranges are correctly set under Settings > Asterisk SIP Settings.

SIP Debugging:

  • Run pjsip set logger on in the Asterisk CLI to monitor SIP traffic and diagnose any negotiation issues.
Connect Odoo with your server:
  1. Navigate to the Odoo Apps Menu:
    • Go to the main menu of your Odoo database and navigate to Apps.
    • Search for the VoIP module and install it.
  2. Configure VoIP Server Settings:
    • Go to Settings > VoIP.
    • Add your FreePBX server settings:
      • PBX Server IP: 0.0.0.0 (Replace with the IP of your FreePBX server)
      • WebSocket: wss://pbx.yourfqdn.com:8089/ws (Replace pbx.yourfqdn.com with the FQDN of your FreePBX server)
      • VoIP Environment: Production
  3. Configure VoIP User Settings:
    • Go to Settings > Users & Companies > Users and select the appropriate user.
    • Go to Preferences > VoIP.
    • Add your FreePBX user settings:
      • VoIP Username: The extension number found in the extension you want to link in FreePBX.
      • VoIP Secret: The secret found in the extension you want to link in FreePBX.
  4. Use the Odoo Softphone:
    • Go to the CRM module and open a contact or lead.
    • Click on the phone icon next to the phone number to make a call via the integrated softphone.



Avatar
Discard
Best Answer

hello Reinhard thank you for this tutorial it is very helpful but i have a problem 
i get this message in softphone odoo 

Your browser does not support some of the features required for VoIP to work. Please try updating your browser or using a different one.

how can fix it i use ws in port 8088 
because I don't have certificate 

Avatar
Discard
Best Answer

Hello Reinhard.

 i followed your tutorial but it still doesn't work in odoo. my freepbx 16 is already working with standard voip phone (without websocket). there is a few detail i want to confirm it's right


- the port is 5060,5061or 5062

- the websocket have trailing /ws

- the setting should be chan_pjsip not 'chan_sip'

Avatar
Discard
Author

Make sure to connect WebRTC to port 8089! the regular UDP or TLS ports wont work, even with encryption.
Both of your other settings are correct.
Also make sure you have an FQDN. Check codecs as well.
If you have any other questions feel free to ask!

Happy Calling!

Related Posts Replies Views Activity
1
Jun 23
1846
11
Jul 24
17850
0
Jan 23
1448
2
Jan 25
1105
1
May 21
3217