Project

General

Profile

OpenBSC with Asterisk » History » Version 6

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