Project

General

Profile

OpenBSC with Asterisk » History » Version 11

wirelesss, 12/08/2016 06:06 PM

1 3 laforge
{{include(Disclaimer-user-content)}}
2
3 5 wirelesss
***Please be aware that LCR is obsolete and osmo-sip-connector should be used istead.***
4 2 manatails
5 11 wirelesss
[[osmonitb:OsmoNITB LCR]] gives short setup and run OsmoNITB and LCR with Asterisk. 
6 5 wirelesss
7 9 wirelesss
This tutorial describes a similar approach to set up an [[OpenBSC:]] network-in-a-box with Asterisk.
8 5 wirelesss
9
10 7 neels
Follow the instructions at [[Build from Source]] to build and install the following Osmocom projects:
11 5 wirelesss
* libosmocore
12 1 manatails
* libosmo-abis
13 8 neels
* openbsc
14 5 wirelesss
15
16 9 wirelesss
lcr, mISDN and mISDNuser  source codes are available at http://git.misdn.org
17 5 wirelesss
18
You can use git client to download the source.
19
20
** LCR
21
22
<pre>
23
cd ../../lcr
24
ln -s ../libosmocore/ .
25
ln -s ../openbsc/openbsc/ .
26
sh autogen.sh
27
./configure --prefix=/usr --with-asterisk --with-gsm-bs
28
make
29
sudo make install
30
cp chan_lcr.so /usr/lib/asterisk/modules/
31
</pre>
32
33
On Debian 6 chan_lcr module will be loaded automatically on service restart, but in case it does not load
34
automatically, it is recommend adding the following line to your @/etc/modules.conf@
35
@load => chan_lcr.so@
36
37
** Configuring the system environment
38
39
40
<pre>
41
ldconfig
42
depmod –a
43
modprobe mISDN_core
44
modprobe mISDN_dsp
45
modprobe mISDN_l1loop nchannel=30 interfaces=2
46
</pre>
47
48
(Optional) Add following lines to your @/etc/modules@ file if you want your system to load the modules
49
automatically during boot
50
51
<pre>
52
mISDN_core
53
mISDN_dsp
54
mISDN_l1loop nchannel=30 interfaces=2
55
</pre>
56
57
58
* Configuring LCR
59
60
* Configuring GSM-BS
61
62
<pre>
63
cd /usr/etc/lcr
64
nano interface.conf
65
</pre>
66
67
Uncomment GSM section where it says ‘gsm-bs’. It is an interface for GSM Base Station, in this case,
68
osmo-nitb. Now LCR will connect to OpenBSC using its MNCC socket.
69
Add ‘bridge ast’ at the bottom of the GSM section. Now all calls from the GSM Base Station will be
70
forwarded to Asterisk.
71
72
** Set up chan_lcr
73
74
<pre>
75
[ast]
76
remote asterisk
77
context from-lcr
78
earlyb no
79
tones yes
80
bridge GSM
81
</pre>
82
83
LCR will connect to Asterisk using chan_lcr using context name ‘from-lcr’. Calls from Asterisk will be
84
forwarded to OpenBSC. The phone numbers defined in hlr.sqlite3 will be used to identify mobiles within
85
the network. Please refer to the example Asterisk configuration given below.
86
87
** Remove unnecessary interfaces
88
89
Comment the last two interfaces named Ext and Int. We do not need these interfaces. Now you have
90
chan_lcr and GSM Base Station interface bridged to each other. All calls from one interface will be
91
redirected to the other. No more routing configurations are necessary at this point.
92
93
** Set up permissions
94
95
<pre>
96
nano options.conf
97
</pre>
98
99
Uncomment the following 2 lines. LCR will not connect to chan_lcr if you do not set the user and group it
100
runs on.
101
102
<pre>
103
socketuser asterisk
104
socketgroup asterisk
105
</pre>
106
107
** Configuring Asterisk
108
109
Following is a simple example of asterisk dialplan that can be used to route all calls from OpenBSC back
110
to OpenBSC. But a few extensions listed in the default dialplan are accessible. Add the following lines to
111
your @/etc/asterisk/extensions.conf@
112
113
<pre>
114
[from-lcr]
115
include => default
116
exten => _X.,1,Dial(LCR/ast/${EXTEN:0},60)
117
</pre>
118
119
In this case, I am adding the default Asterisk dialplan. In Asterisk, default dialplan provides some features
120
to test drive your network. You can call 1234 for information on Asterisk, and 600 for latency test. Please
121
refer to the configuration file for more extensions. You might want to remove the default dialplan after
122
you confirm that the network is working properly
Add picture from clipboard (Maximum size: 48.8 MB)