Project

General

Profile

OpenBSC with Asterisk » History » Version 10

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