Project

General

Profile

OsmoNITB LCR » History » Version 6

Anonymous, 02/19/2016 10:47 PM

1 1
== Howto OpenBSC with Asterisk and LCR ==
2
This is a short walk-through to setup OpenBSC and LCR with Asterisk.
3
4
In the end we'll have a working setup to route calls from our BTS to
5
the PTSN via VoIP.
6
7
8
=== Prerequisites ===
9
 * OpenBSC equipment (BTS, E1 Card)
10
  * We're using a Siemens BS11 microBTS and a Cologne Chips E1 PCI card
11
 * The latest snapshot from the OpenBSC repository
12
   * svn co http://bs11-abis.gnumonks.org/svn/trunk/openbsc
13
   * We've got Revision 513
14
 * LCR from git repository
15
   * git-clone git://git.misdn.org/git/lcr.git/
16
 * A working kernel for your linux system
17
   * Support for your E1 card
18
   * mISDN's l1loop module (mISDN_l1loop.ko)
19
   * You can obtain a working package for Debian at https://brezn.muc.ccc.de/~codec/openbsc/
20
     * Supports cards from Cologne Chips and Junghanns
21
 * libgsm + header files (libgsm / libgsm-dev on Debian)
22
 * A working Asterisk setup
23 6
 * Original howto from https://brezn.muc.ccc.de/~codec/openbsc/howto.txt
24 1
25
26
=== Installation ===
27
28
First of all we assume the following:
29
 * Layout of your working directory:
30
   * openbsc/  - checkout from OpenBSC repo
31
   * lcr/      - checkout from LCR repo
32
 * Installation directories:
33
   * /opt/openbsc for OpenBSC
34
   * /opt/lcr for LCR
35
36
We need to compile and install OpenBSC first:
37
{{{
38
$ cd openbsc/
39
$ sh ../lcr/autogen.sh
40
$ ./configure --prefix=/opt/openbsc
41
$ make
42
$ sudo make install
43
}}}
44
45
After that we're going for LCR. But we had to patch 2 files to make it work:
46
{{{
47 5
$ cd ../lcr
48 1
}}}
49
50
Edit Makefile.am and change
51
{{{
52
GSM_LIB = /usr/local/lib/libgsm.a /usr/local/lib/libbsc.a /usr/local/lib/libvty.a -ldbi -lcrypt
53
}}}
54
to
55
{{{
56
GSM_LIB = /usr/lib/libgsm.a /usr/local/lib/libbsc.a /usr/local/lib/libvty.a -ldbi -lcrypt
57
}}}
58
59
And patch gsm_audio.c on line 13 from
60
{{{
61
#include "/usr/local/include/gsm.h"
62
}}}
63
to
64
{{{
65
#include "/usr/include/gsm.h"
66
}}}
67
68
Now we can go on with compiling LCR:
69
{{{
70
$ sh autogen.sh
71
$ ./configure --prefix=/opt/lcr --with-asterisk --with-gsm
72
$ make
73
$ sudo make install
74
}}}
75 2
76
77
=== LCR configuration ===
78 5
'''1. gsm in options.conf'''[[BR]]
79 2
The gsm option in /usr/local/lcr/options.conf needs to be activated. This can be
80
simply done by adding 'gsm' as a single line to the file.
81
82 5
'''2. GSM interface in interface.conf'''[[BR]]
83 2
/usr/local/lcr/interface.conf holds an example for a GSM interface. Remove the comments
84
and use the example as is.
85
86 5
'''3. gsm.conf'''[[BR]]
87 2
Enable the debugging option in /usr/local/lcr/gsm.conf. We also need 2 mISDN loopback interfaces.
88
Create them with
89
{{{
90
  $ sudo modprobe mISDN_l1loop pri=1 nchannel=30
91
}}}
92
You can check for the interfaces names with the misdn_info tool. All the default settings
93
should work in a BS11 setup.
94
95 5
'''4. Routing'''[[BR]]
96 2
We route all our calls to to asterisk at the moment, as we only have outgoing connectivity via IAX/SIP in our setup.
97
{{{
98
[main]
99
interface=GSM                           : remote application=asterisk context=btsctrl
100
}}}
101
102 1
Calls will go to the context btsctrl in Asterisk.
103 3
104
105
=== Asterisk configuration ===
106
Our setup connects to an external Asterisk via SIP - as we don't have a second ISDN interface.
107
108
chan_lcr for Asterisk comes with LCR (compiled with --with-asterisk). You only need to load the
109
channel driver and maybe check the permissions of the LCR socket (/var/tmp/lcr.socket) - Asterisk
110
on Debian uses a Set UID wrapper.
111
112
To load chan_lcr automagically on startup add the following to your modules.conf:
113
{{{
114
load => chan_lcr.so
115
}}}
116
117
We've created an exclusive context in extensions.conf for OpenBSC/LCR:
118
{{{
119
[btsctrl]
120
exten => _X.,1,Set,CALLERID(num)=5552342
121
exten => _X.,n,dial(SIP/${EXTEN}@btsctrl,120)
122
}}}
123 4
124
125
=== Running OpenBSC/LCR and Asterisk ===
126
Now we're ready to start with our GSM network.
127
Boot up the BS11 and start LCR with
128
{{{
129
$ sudo /opt/lcr/sbin/lcr start
130
}}}
131
132
You can also use 'fork' instead of 'start' to run LCR in daemon mode,
133
but I'd rather go with fork AFTER you made you first successful call. (;
134
135
Now start Asterisk. It should connect to LCR right after startup. You
136
can check this by running
137
{{{
138
$ sudo /opt/lcr/bin/lcradmin state
139
}}}
140
141
The UI should show
142
{{{
143
Remote: asterisk
144
}}}
145
in the upper left part.
146
147
Connect your phone and make your call(s).
148
149
150
=== Troubleshooting ===
151
==== Phones unable to connect ====
152
On the first run I had some problems with connecting my phones as
153
the registration just timed out. I fixed this by starting over with a fresh HLR.
154
155
==== The call routing fails (somewhere) ====
156
Most problems occured within Asterisk for me as neither IAX2 or SIP was working.
157
This was just some kind of problem within the configuration.
158
159
I can provide a working dialplan and SIP configuration if you need it.
160
161
==== Can't see the network ====
162
This was either related to the phone (a restart fixed it) or the BS11. After the
163
first start I sometimes had to hardreset (as in reboot) the BS11.
Add picture from clipboard (Maximum size: 48.8 MB)