[ADD] crm: How to install and setup Odoo VOIP

This commit is contained in:
Yannick Tivisse 2016-03-18 14:24:10 +01:00
parent 46adaf532d
commit 8eddc08f6f
5 changed files with 384 additions and 2 deletions

View File

@ -7,3 +7,4 @@ Leads
leads/generate
leads/manage
leads/voip

8
crm/leads/voip.rst Normal file
View File

@ -0,0 +1,8 @@
=========
Odoo VOIP
=========
.. toctree::
:titlesonly:
voip/setup

197
crm/leads/voip/setup.rst Normal file
View File

@ -0,0 +1,197 @@
======================
Installation and Setup
======================
Installing Asterisk server
==========================
Dependencies
~~~~~~~~~~~~
Before installing Asterisk you need to install the following dependencies:
- wget
- gcc
- gcc-c++
- ncurses-devel
- libxml2-devel
- sqlite-devel
- libsrtp-devel
- libuuid-devel
- openssl-devel
If libsrtp is not available in the repo install it from source.
.. code-block:: console
cd /usr/local/src/
wget http://srtp.sourceforge.net/srtp-1.4.2.tgz
tar zxvf srtp-1.4.2.tgz
cd /usr/local/src/srtp
./configure CFLAGS=-fPIC
make && make install
You also need to install PJSIP, you can download the source `here <http://www.pjsip.org/download.htm>`_. Once the source directory is extracted:
- **Change to the pjproject source directory:**
.. code-block:: console
# cd pjproject
- **run:**
.. code-block:: console
# ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
- **Build and install pjproject:**
.. code-block:: console
# make dep
# make
# make install
- **Update shared library links:**
.. code-block:: console
# ldconfig
- **Verify that pjproject is installed:**
.. code-block:: console
# ldconfig -p | grep pj
- **The result should be:**
.. code-block:: console
libpjsua.so (libc6,x86-64) => /usr/lib/libpjsua.so libpjsip.so (libc6,x86-64) => /usr/lib/libpjsip.so libpjsip-ua.so (libc6,x86-64) => /usr/lib/libpjsip-ua.so libpjsip-simple.so (libc6,x86-64) => /usr/lib/libpjsip-simple.so libpjnath.so (libc6,x86-64) => /usr/lib/libpjnath.so libpjmedia.so (libc6,x86-64) => /usr/lib/libpjmedia.so libpjmedia-videodev.so (libc6,x86-64) => /usr/lib/libpjmedia-videodev.so libpjmedia-codec.so (libc6,x86-64) => /usr/lib/libpjmedia-codec.so libpjmedia-audiodev.so (libc6,x86-64) => /usr/lib/libpjmedia-audiodev.so libpjlib-util.so (libc6,x86-64) => /usr/lib/libpjlib-util.so libpj.so (libc6,x86-64) => /usr/lib/libpj.so
Asterisk
~~~~~~~~
- In order to install Asterisk 13.7.0, you can download the source directly `there <http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.7.0.tar.gz>`_.
- Extract Asterisk:
.. code-block:: console
tar zxvf asterisk*.
- Enter the Asterisk directory:
.. code-block:: console
cd /usr/local/src/asterisk*.
- Run the Asterisk configure script:
.. code-block:: console
./configure --libdir=/usr/lib64.
- Run the Asterisk menuselect tool:
.. code-block:: console
make menuselect.
- In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are 3 xs next to res_srtp, there is a problem with the srtp library and you must reinstall it. Save the configuration (press x). You should also see stars in front of the res_pjsip lines.
- Compile and install Asterisk:
.. code-block:: console
make && make install.
- If you need the sample configs you can run make samples to install the sample configs. If you need to install the Asterisk startup script you can run make config.
DTLS Certificates
~~~~~~~~~~~~~~~~~
- After you need to setup the DTLS certificates.
.. code-block:: console
mkdir /etc/asterisk/keys
- Enter the Asterisk scripts directory:
.. code-block:: console
cd /usr/local/src/asterisk*/contrib/scripts.
- Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace My Super Company with your company name):
.. code-block:: console
./ast_tls_cert -C pbx.mycompany.com -O "My Super Company" -d /etc/asterisk/keys
Configure Asterisk server
=========================
For WebRTC, a lot of the settings that are needed MUST be in the peer settings. The global settings do not flow down into the peer settings very well. By default, Asterisk config files are located in /etc/asterisk/. Start by editing http.conf and make sure that the following lines are uncommented:
.. code-block:: console
;http.conf
[general]
enabled=yes
bindaddr=127.0.0.1 ; Replace this with your IP address
bindport=8088 ; Replace this with the port you want to listen on
Next, edit sip.conf. The WebRTC peer requires encryption, avpf, and icesupport to be enabled. In most cases, directmedia should be disabled. Also under the WebRTC client, the transport needs to be listed as ws to allow websocket connections. All of these config lines should be under the peer itself; setting these config lines globally might not work:
.. code-block:: console
;sip.conf
[general]
realm=127.0.0.1 ; Replace this with your IP address
udpbindaddr=127.0.0.1 ; Replace this with your IP address
transport=udp
[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=password ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
In the sip.conf and rtp.conf files you also need to add or uncomment the lines:
.. code-block:: console
icesupport = true
stunaddr = stun.l.google.com:19302
Lastly, set up extensions.conf:
.. code-block:: console
;extensions.conf
[default]
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
Configure Odoo VOIP
===================
In Odoo, the configuration should be done in the user's preferences.
The SIP Login/Browser's Extension is the number you configured previously in the sip.conf file. In our example, 1060. The SIP Password is the secret you chose in the sip.conf file. The extension of your office's phone is not a required field but it is used if you want to transfer your call from Odoo to an external phone also configured in the sip.conf file.
The configuration needs also to be done in the sale settings under the title "PBX Configuration". You need to put the IP you define in the http.conf file and the WebSocket should be: ws://127.0.0.1:8088/ws. The part "127.0.0.1" needs to be the same as the IP defined previously and the "8088" is the port you defined in the http.conf file.

0
crm/leads/voip/usage.rst Normal file
View File

View File

@ -1,5 +1,5 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2015, Odoo S.A.
# Copyright (C) 2015-TODAY, Odoo S.A.
# This file is distributed under the same license as the Odoo Business package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Business 9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-03 16:14+0100\n"
"POT-Creation-Date: 2016-03-18 14:22+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -526,6 +526,182 @@ msgstr ""
msgid ":doc:`automatic_assignation`"
msgstr ""
#: ../../crm/leads/voip.rst:3
msgid "Odoo VOIP"
msgstr ""
#: ../../crm/leads/voip/setup.rst:3
msgid "Installation and Setup"
msgstr ""
#: ../../crm/leads/voip/setup.rst:6
msgid "Installing Asterisk server"
msgstr ""
#: ../../crm/leads/voip/setup.rst:9
msgid "Dependencies"
msgstr ""
#: ../../crm/leads/voip/setup.rst:11
msgid "Before installing Asterisk you need to install the following dependencies:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:13
msgid "wget"
msgstr ""
#: ../../crm/leads/voip/setup.rst:14
msgid "gcc"
msgstr ""
#: ../../crm/leads/voip/setup.rst:15
msgid "gcc-c++"
msgstr ""
#: ../../crm/leads/voip/setup.rst:16
msgid "ncurses-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:17
msgid "libxml2-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:18
msgid "sqlite-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:19
msgid "libsrtp-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:20
msgid "libuuid-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:21
msgid "openssl-devel"
msgstr ""
#: ../../crm/leads/voip/setup.rst:23
msgid "If libsrtp is not available in the repo install it from source."
msgstr ""
#: ../../crm/leads/voip/setup.rst:34
msgid "You also need to install PJSIP, you can download the source `here <http://www.pjsip.org/download.htm>`_. Once the source directory is extracted:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:36
msgid "**Change to the pjproject source directory:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:42
msgid "**run:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:48
msgid "**Build and install pjproject:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:56
msgid "**Update shared library links:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:62
msgid "**Verify that pjproject is installed:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:68
msgid "**The result should be:**"
msgstr ""
#: ../../crm/leads/voip/setup.rst:75
msgid "Asterisk"
msgstr ""
#: ../../crm/leads/voip/setup.rst:77
msgid "In order to install Asterisk 13.7.0, you can download the source directly `there <http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.7.0.tar.gz>`_."
msgstr ""
#: ../../crm/leads/voip/setup.rst:79
msgid "Extract Asterisk:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:85
msgid "Enter the Asterisk directory:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:91
msgid "Run the Asterisk configure script:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:97
msgid "Run the Asterisk menuselect tool:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:103
msgid "In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are 3 xs next to res_srtp, there is a problem with the srtp library and you must reinstall it. Save the configuration (press x). You should also see stars in front of the res_pjsip lines."
msgstr ""
#: ../../crm/leads/voip/setup.rst:105
msgid "Compile and install Asterisk:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:111
msgid "If you need the sample configs you can run make samples to install the sample configs. If you need to install the Asterisk startup script you can run make config."
msgstr ""
#: ../../crm/leads/voip/setup.rst:114
msgid "DTLS Certificates"
msgstr ""
#: ../../crm/leads/voip/setup.rst:116
msgid "After you need to setup the DTLS certificates."
msgstr ""
#: ../../crm/leads/voip/setup.rst:122
msgid "Enter the Asterisk scripts directory:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:128
msgid "Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace My Super Company with your company name):"
msgstr ""
#: ../../crm/leads/voip/setup.rst:135
msgid "Configure Asterisk server"
msgstr ""
#: ../../crm/leads/voip/setup.rst:137
msgid "For WebRTC, a lot of the settings that are needed MUST be in the peer settings. The global settings do not flow down into the peer settings very well. By default, Asterisk config files are located in /etc/asterisk/. Start by editing http.conf and make sure that the following lines are uncommented:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:147
msgid "Next, edit sip.conf. The WebRTC peer requires encryption, avpf, and icesupport to be enabled. In most cases, directmedia should be disabled. Also under the WebRTC client, the transport needs to be listed as ws to allow websocket connections. All of these config lines should be under the peer itself; setting these config lines globally might not work:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:175
msgid "In the sip.conf and rtp.conf files you also need to add or uncomment the lines:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:182
msgid "Lastly, set up extensions.conf:"
msgstr ""
#: ../../crm/leads/voip/setup.rst:191
msgid "Configure Odoo VOIP"
msgstr ""
#: ../../crm/leads/voip/setup.rst:193
msgid "In Odoo, the configuration should be done in the user's preferences."
msgstr ""
#: ../../crm/leads/voip/setup.rst:195
msgid "The SIP Login/Browser's Extension is the number you configured previously in the sip.conf file. In our example, 1060. The SIP Password is the secret you chose in the sip.conf file. The extension of your office's phone is not a required field but it is used if you want to transfer your call from Odoo to an external phone also configured in the sip.conf file."
msgstr ""
#: ../../crm/leads/voip/setup.rst:197
msgid "The configuration needs also to be done in the sale settings under the title \"PBX Configuration\". You need to put the IP you define in the http.conf file and the WebSocket should be: ws://127.0.0.1:8088/ws. The part \"127.0.0.1\" needs to be the same as the IP defined previously and the \"8088\" is the port you defined in the http.conf file."
msgstr ""
#: ../../crm/overview.rst:3
msgid "Overview"
msgstr ""