Project

General

Profile

OpenBSC with Asterisk » History » Revision 5

Revision 4 (wirelesss, 12/01/2016 05:59 PM) → Revision 5/74 (wirelesss, 12/02/2016 12:27 PM)

{{include(Disclaimer-user-content)}} 

 ***Please be aware that LCR is obsolete and osmo-sip-connector should be used istead.*** 



 Next link [[https://osmocom.org/projects/osmonitb/wiki/OsmoNITB_LCR]] gives short setup and run OsmoNITB and LCR with Asterisk.  

 This 


 A tutorial describes describing how to set up an [[OpenBSC]] network-in-a-box with Asterisk. 


 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]]. Asterisk 

 Required osmocom projects are: 
 * openbsc 
 * libosmocore 
 * libosmo-abis 


 lcr, mISDN and mISDNuser    source codes are available at [[http://git.misdn.org]] 

 You can use git client to download the source. 

 ** LCR 

 <pre> 
 cd ../../lcr 
 ln -s ../libosmocore/ . 
 ln -s ../openbsc/openbsc/ . 
 sh autogen.sh 
 ./configure --prefix=/usr --with-asterisk --with-gsm-bs 
 make 
 sudo make install 
 cp chan_lcr.so /usr/lib/asterisk/modules/ 
 </pre> 

 On Debian 6 chan_lcr module will **Please be loaded automatically on service restart, but in case it does not load 
 automatically, it is recommend adding the following line to your @/etc/modules.conf@ 
 @load => chan_lcr.so@ 

 ** Configuring the system environment 


 <pre> 
 ldconfig 
 depmod –a 
 modprobe mISDN_core 
 modprobe mISDN_dsp 
 modprobe mISDN_l1loop nchannel=30 interfaces=2 
 </pre> 

 (Optional) Add following lines to your @/etc/modules@ file if you want your system to load the modules 
 automatically during boot 

 <pre> 
 mISDN_core 
 mISDN_dsp 
 mISDN_l1loop nchannel=30 interfaces=2 
 </pre> 


 * Configuring aware that LCR 

 * Configuring GSM-BS 

 <pre> 
 cd /usr/etc/lcr 
 nano interface.conf 
 </pre> 

 Uncomment GSM section where it says ‘gsm-bs’. It is an interface for GSM Base Station, in this case, 
 osmo-nitb. Now LCR will connect to OpenBSC using its MNCC socket. 
 Add ‘bridge ast’ at the bottom of the GSM section. Now all calls from the GSM Base Station will be 
 forwarded to Asterisk. 

 ** Set up chan_lcr 

 <pre> 
 [ast] 
 remote asterisk 
 context from-lcr 
 earlyb no 
 tones yes 
 bridge GSM 
 </pre> 

 LCR will connect to Asterisk using chan_lcr using context name ‘from-lcr’. Calls from Asterisk will be 
 forwarded to OpenBSC. The phone numbers defined in hlr.sqlite3 will be used to identify mobiles within 
 the network. Please refer to the example Asterisk configuration given below. 

 ** Remove unnecessary interfaces 

 Comment the last two interfaces named Ext obsolete and Int. We do not need these interfaces. Now you have 
 chan_lcr and GSM Base Station interface bridged to each other. All calls from one interface will osmo-sip-connector should be 
 redirected to the other. No more routing configurations are necessary at this point. 

 ** Set up permissions 

 <pre> 
 nano options.conf 
 </pre> 

 Uncomment the following 2 lines. LCR will not connect to chan_lcr if you do not set the user and group it 
 runs on. 

 <pre> 
 socketuser asterisk 
 socketgroup asterisk 
 </pre> 

 ** Configuring Asterisk 

 Following is a simple example of asterisk dialplan that can be used to route all calls from OpenBSC back 
 to OpenBSC. But a few extensions listed in the default dialplan are accessible. Add the following lines to 
 your @/etc/asterisk/extensions.conf@ 

 <pre> 
 [from-lcr] 
 include => default 
 exten => _X.,1,Dial(LCR/ast/${EXTEN:0},60) 
 </pre> 

 In this case, I am adding the default Asterisk dialplan. In Asterisk, default dialplan provides some features 
 to test drive your network. You can call 1234 for information on Asterisk, and 600 for latency test. Please 
 refer to the configuration file for more extensions. You might want to remove the default dialplan after 
 you confirm that the network is working properly 

 istead.**
Add picture from clipboard (Maximum size: 48.8 MB)