Project

General

Profile

Osmo-sip-connector » History » Revision 33

Revision 32 (dexter, 02/06/2017 03:39 PM) → Revision 33/87 (dexter, 02/06/2017 03:40 PM)

h1. Osmo-sip-connector 

 h2. Introduction 

 osmo-sip-connector translates between MNCC and SIP protocols. It does not handle RTP by itself but with the help of external SIP server it can be used for tests. 

 Sample configuration: 

 <pre> 
 app 
 mncc 
   socket-path /tmp/bsc_mncc 
 sip 
   local 10.9.10.105 5069 
   remote 10.9.10.105 5060 
 </pre> 

 Running osmo-sip-connector: 
 <pre> 
 osmo-sip-connector -c ~/.config/osmocom/osmo-sip-connector.cfg 
 </pre> 

 Running NITB: 
 <pre> 
 ./src/osmo-nitb/osmo-nitb -c ~/.config/osmocom/open-bsc.cfg -l ~/.config/osmocom/hlr.sqlite3 -d DLMUX:DRTP -m 
 </pre> 

 The configuration above assumes that SIP server is running on the same machine. Attached is example configuration file for Kamailio https://www.kamailio.org SIP server which can be used to route calls between mobile phones. It also handles 2 special numbers 500 (routed to sip:music@iptel.org) and 600 (routed to sip:echo@iptel.org): by dialing them you can use echo test or hear nice music from your mobile. 

 *Note:* in attached kamailio.cfg, for 64bit systems, you may need to adjust 
 <pre> 
 mpath="/usr/lib/x86_64-linux-gnu/kamailio/modules/" 
 </pre> 

 N. B: Those numbers are meant only as an example for quick tests - please consider running your own Asterisk instance if you expect more than couple of calls, do not abuse http://www.iptel.org/service 


 h2. Asterisk howto 

 This howto was created and tested using Debian 8.7.1. It is assumed that there is already a working installation of osmo-nitb already exists. In the following steps we will show how to integrate an existing installation with asterisk using osmo-sip-connector. The following image illustrates how the network components wile be laid out: 

 {{graphviz_link() 
 digraph G{ 
   //rankdir = LR; 
   Phone -> BTS [label = "Um"]; 
   BTS -> "osmo-nitb" [label = "A.bis"]; 
   "osmo-nitb" -> "osmo-sip-connector" [label = "MNCC"]; "mncc"]; 
   "osmo-sip-connector" -> "asterisk" [label = "SIP"]; "sip"]; 
   "BTS" -> "asterisk" [label = "RTP"]; "rtp"]; 
 } 
 }} 

 h3. Preparations 

 As we assume that we use an existing and working osmo-nitb configuration as a starting point most of the relevant dependencies are already installed. However, we still miss osmo-sip-connector and asterisk as a major components. 

 * Install dependancies: 
 The extension we are about to make requires to install some additional packages. 
 <pre> 
 sudo apt-get install libsofia-sip-ua-glib-dev 
 sudo apt-get install asterisk 
 </pre> 

 * Install osmo-sip-connector: 
 The installation of osmo-sip-connector is as straight forward as you know it already from other osmocom projects: 
 <pre> 
 git clone git://git.osmocom.org/osmo-sip-connector.git 
 cd osmo-sip-connector/ 
 autoreconf -fi 
 ./configure 
 make 
 sudo make install 
 </pre> 


 h3. Configuration of osmo-sip-connector 

 * Osmo-nitb: 
 Osmo-nitb does not require any change of of its configuration. The connection between osmo-sip-connector is configured using the command line option “-M”: 
 <pre> 
 osmo-nitb -c ./openbsc.cfg -d option –debug=DRLL:DCC:DMM:DRR:DRSL:DNM -M /tmp/bsc_mncc 
 </pre> 
 The “-M” option disables the internal call control handler of osmo-nitb and offers an unix domain socket, where an external call control handler can be connected. In the described situation this will be osmo-sip-connector. 


 * osmo-sip-connector 
 Osmo-sip connector acts as a translator between the classic ISDN mncc and SIP. The configuration is rather simple. 
 <pre> 
 app 
 mncc 
   socket-path /tmp/bsc_mncc 
 sip 
   local 10.9.1.110 5069 
   remote 10.9.1.110 5060 
 </pre> 
 Again, we have to setup a socket path. This path has to be the same as we provided with the commandline option “-M” for osmo-nitb earlier. For SIP we need to setup a remote and local IP-Address and port. In most cases Asterisk and osmo-sip-connector will run on one and the same machine, so it is ovious that local and remote IP-Address are the same. The type of connection between osmo-sip-connector and Asterisk is a classic SIP-Trunk. For asterisk it appears as just another PBX. Osmo-sip-connector is started via commandline as follows: 
 <pre> 
 osmo-sip-connector -c ./osmo-sip-connector.cfg 
 </pre> 


 h3. Configuration of asterisk 

 The following section will discuss a minimal Asterisk configuration that is able to route calls between mobile phones. The described case assumes a freshly installed asterisk with virgin configuration files. In the following we will edit extensions.conf and sip.conf which can be found in the /etc/asterisk directory. 

 * Sip trunk configuration 
 The first that has to be taken care of is the connection to osmo-sip-connector. Two connections have to be created. One for outgoing and one for incoming calls. The following lines need be appended to sip.conf: 
 <pre> 
 [GSM] 
 type=friend 
 host=10.9.1.110 
 dtmfmode=rfc2833 
 canreinvite=no 
 disallow=all 
 allow=gsm 
 context=gsmsubscriber 
 port=5069 
 </pre> 
 The connection are named GSM, as we will reference to this connection later it is recommended to keep the name short. The context name “gsmsubscriber” references the context where mobile originated calls are routed into the dialplan. 





Add picture from clipboard (Maximum size: 48.8 MB)