10000 [ADD] crm: How to install and setup Odoo VOIP · tdu-odoo/documentation-user@8eddc08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8eddc08

Browse files
committed
[ADD] crm: How to install and setup Odoo VOIP
1 parent 46adaf5 commit 8eddc08

File tree

5 files changed

+384
-2
lines changed

5 files changed

+384
-2
lines changed

crm/leads.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ Leads
77

88
leads/generate
99
leads/manage
10+
leads/voip

crm/leads/voip.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=========
2+
Odoo VOIP
3+
=========
4+
5+
.. toctree::
6+
:titlesonly:
7+
8+
voip/setup

crm/leads/voip/setup.rst

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
======================
2+
Installation and Setup
3+
======================
4+
5+
Installing Asterisk server
6+
==========================
7+
8+
Dependencies
9+
~~~~~~~~~~~~
10+
11+
Before installing Asterisk you need to install the following dependencies:
12+
13+
- wget
14+
- gcc
15+
- gcc-c++
16+
- ncurses-devel
17+
- libxml2-devel
18+
- sqlite-devel
19+
- libsrtp-devel
20+
- libuuid-devel
21+
- openssl-devel
22+
23+
If libsrtp is not available in the repo install it from source.
24+
25+
.. code-block:: console
26+
27+
cd /usr/local/src/
28+
wget http://srtp.sourceforge.net/srtp-1.4.2.tgz
29+
tar zxvf srtp-1.4.2.tgz
30+
cd /usr/local/src/srtp
31+
./configure CFLAGS=-fPIC
32+
make && make install
33+
34+
You also need to install PJSIP, you can download the source `here <http://www.pjsip.org/download.htm>`_. Once the source directory is extracted:
35+
36+
- **Change to the pjproject source directory:**
37+
38+
.. code-block:: console
39+
40+
# cd pjproject
41+
42+
- **run:**
43+
44+
.. code-block:: console
45+
46+
# ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
47+
48+
- **Build and install pjproject:**
49+
50+
.. code-block:: console
51+
52+
# make dep
53+
# make
54+
# make install
55+
56+
- **Update shared library links:**
57+
58+
.. code-block:: console
59+
60+
# ldconfig
61+
62+
- **Verify that pjproject is installed:**
63+
64+
.. code-block:: console
65+
66+
# ldconfig -p | grep pj
67+
68+
- **The result should be:**
69+
70+
.. code-block:: console
71+
72+
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
73+
74+
Asterisk
75+
~~~~~~~~
76+
77+
- 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>`_.
78+
79+
- Extract Asterisk:
80+
81+
.. code-block:: console
82+
83+
tar zxvf asterisk*.
84+
85+
- Enter the Asterisk directory:
86+
87+
.. code-block:: console
88+
89+
cd /usr/local/src/asterisk*.
90+
91+
- Run the Asterisk configure script:
92+
93+
.. code-block:: console
94+
95+
./configure --libdir=/usr/lib64.
96+
97+
- Run the Asterisk menuselect tool:
98+
99+
.. code-block:: console
100+
101+
make menuselect.
102+
103+
- In the menuselect, go to the resources option and ensure that res_srtp is enabled. If there are 3 x’s 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.
104+
105+
- Compile and install Asterisk:
106+
107+
.. code-block:: console
108+
109+
make && make install.
110+
111+
- 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.
112+
113+
DTLS Certificates
114+
~~~~~~~~~~~~~~~~~
115+
116+
- After you need to setup the DTLS certificates.
117+
118+
.. code-block:: console
119+
120+
mkdir /etc/asterisk/keys
121+
122+
- Enter the Asterisk scripts directory:
123+
124+
.. code-block:: console
125+
126+
cd /usr/local/src/asterisk*/contrib/scripts.
127+
128+
- Create the DTLS certificates (replace pbx.mycompany.com with your ip address or dns name, replace My Super Company with your company name):
129+
130+
.. code-block:: console
131+
132+
./ast_tls_cert -C pbx.mycompany.com -O "My Super Company" -d /etc/asterisk/keys
133+
134+
Configure Asterisk server
135+
=========================
136+
137+
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:
138+
139+
.. code-block:: console
140+
141+
;http.conf
142+
[general]
143+
enabled=yes
144+
bindaddr=127.0.0.1 ; Replace this with your IP address
145+
bindport=8088 ; Replace this with the port you want to listen on
146+
147+
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:
148+
149+
.. code-block:: console
150+
151+
;sip.conf
152+
[general]
153+
realm=127.0.0.1 ; Replace this with your IP address
154+
udpbindaddr=127.0.0.1 ; Replace this with your IP address
155+
transport=udp
156+
157+
[1060] ; This will be WebRTC client
158+
type=friend
159+
username=1060 ; The Auth user for SIP.js
160+
host=dynamic ; Allows any host to register
161+
secret=password ; The SIP Password for SIP.js
162+
encryption=yes ; Tell Asterisk to use encryption for this peer
163+
avpf=yes ; Tell Asterisk to use AVPF for this peer
164+
icesupport=yes ; Tell Asterisk to use ICE for this peer
165+
context=default ; Tell Asterisk which context to use when this peer is dialing
166+
directmedia=no ; Asterisk will relay media for this peer
167+
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
168+
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
169+
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
170+
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
171+
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
172+
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
173+
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
174+
175+
In the sip.conf and rtp.conf files you also need to add or uncomment the lines:
176+
177+
.. code-block:: console
178+
179+
icesupport = true
180+
stunaddr = stun.l.google.com:19302
181+
182+
Lastly, set up extensions.conf:
183+
184+
.. code-block:: console
185+
186+
;extensions.conf
187+
[default]
188+
exten => 1060,1,Dial(SIP/1060) ; Dialing 1060 will call the SIP client registered to 1060
189+
190+
Configure Odoo VOIP
191+
===================
192+
193+
In Odoo, the configuration should be done in the user's preferences.
194+
195+
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.
196+
197+
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.

crm/leads/voip/usage.rst

Whitespace-only changes.

0 commit comments

Comments
 (0)
0