Difference between revisions of "OpenBTS: Konfigurasi Asterisk untuk OpenBTS"

From OnnoWiki
Jump to navigation Jump to search
Line 1: Line 1:
Setting Up Asterisk to Work with OpenBTS¶
+
Pada dasarnya tidak banyak yang perlu di konfigurasi di Asterisk agar berbicara dengan OpenBTS. Kita terutama perlu mengedit file
  
OpenBTS integration with Asterisk is simple in principle: each SIM is configured in Asterisk as a SIP user, using the IMSI as the SIP user name.
+
/etc/asterisk/sip.conf
So provisioning an OpenBTS subscriber has two steps: # Get the IMSI from the SIM. # Make the corresponding entries in sip.conf and extensions.conf to support the new SIP user.
+
/etc/asterisk/extensions.conf
Getting the IMSIs¶
 
  
There are several ways to get the IMSI for a SIM so that it can be programmed into Asterisk's configuration files. Which one you use will depend on the volume of SIMs you need to provision.
+
Contoh isi /etc/asterisk/sip.conf adalah sebagai berikut
Getting the IMSI with OpenBTS Itself¶
 
  
This is the easiest approach for small numbers of SIMs.
+
  [IMSI520010104743577]
Whenever a handset tries to register with OpenBTS, it will send a mobile identity. You can force the handset to use the IMSI as its identity and then capture the IMSI from the OpenBTS console output when the handset tries to register. Here are the steps:
+
  callerid=21011
 
 
  1. Be in the correct GSM band.
 
        1. Be sure the handset is configured to use the same band as you OpenBTS binary, and no other.
 
  2. Reset the handset's TMSI.
 
      This procedure is derived from GSM 04.08.
 
        1. Turn off the handset.
 
        2. Remove the battery and SIM.
 
        3. Replace them and turn the phone back on. This will clear any TMSI stored in the phone.
 
  3. Let the phone try to register.
 
      What happens next depends on the version.
 
 
 
For releases prior to "Jean Lafitte": Start running the full OpenBTS (OpenBTS + transceiver + Asterisk). Pipe out output of the OpenBTS binary through "| grep Control" and watch for something like this:
 
 
 
FACCHDispatch.cpp:53 ControlLayer FACCHDispatcher waiting for ESTABLISH RadioResource.cpp:87 ControlLayer AccessGrantResponder RA=27 when=0:7734
 
RadioResource.cpp:127 ControlLayer AccessGrantResponder sending PageMode=(0) DedicatedModeOrTBF=(TMA=0 Downlink=0 DMOrTBF=0) ChannelDescription=(typeAndOffset=SDCCH/4-3 TN=0 TSC=0 ARFCN=29) RequestReference=(RA=27 T1'=5 T2=12 T3=33) TimingAdvance=0
 
SDCCHDispatch.cpp:101 ControlLayer SDCCHDispatcher got MM Location Updating Request MobileIdentity=(IMSI=310410186585294)
 
MobilityManagement.cpp:111 ControlLayer LocationUpdatingController MM Location Updating Request MobileIdentity=(IMSI=310410186585294)
 
MobilityManagement.cpp:121 ControlLayer LocationUpdatingController waiting for registration
 
MobilityManagement.cpp:137 ControlLayer LocationUpdatingController : SIPRegistration -> FAIL
 
SDCCHDispatch.cpp:136 ControlLayer SDCCHDisptacher waiting for RELEASE
 
SDCCHDispatch.cpp:97 ControlLayer SDCCHDisptacher waiting for ESTABLISH
 
 
 
 
 
For "Jean Lafitte" and later: Start OpenBTS and Asterisk with the OpenBTS logging level set to "INFO" and watch for something like this in the log:
 
 
 
RadioResource.cpp:152: AccessGrantResponder RA=0x15 when=0:1192710 age=25 TOA=0.0000
 
RadioResource.cpp:196: AccessGrantResponder sending PageMode=(0) DedicatedModeOrTBF=(TMA=0 Downlink=0 DMOrTBF=0) ChannelDescription=(typeAndOffset=SDCCH/4-0 TN=0 TSC=0 ARFCN=975) RequestReference=(RA=21 T1'=3 T2=12 T3=24) TimingAdvance=0
 
MobilityManagement.cpp:119: LocationUpdatingController MM Location Updating Request LAI=(MCC=901 MNC=55 LAC=0x29b) MobileIdentity=(TMSI=0x49ffcddd)
 
MobilityManagement.cpp:172: LocationUpdatingController registration FAIL: IMSI=234100223456161
 
 
 
In either version, the SIP registration attempt will return "FAIL" because this IMSI is not yet provisioned in Asterisk.
 
 
 
If you're really clever, you'll write some kind of Python script to catch the log output and automatically update the Asterisk configuration files. If you do that, please share your scripts with the rest of us. That would make this technique applicable to very large numbers of SIMs in situations where acceptance rules can be applied based on the upper digits of the IMSI.
 
Use the GSM "AT" Interface¶
 
 
 
Many GSM devices support a Hayes-style "AT" command interface, defined in GSM 07.07. This interface supports the "AT+CIMI" command, described in GSM 07.07 Section 5.6, which will return the IMSI of the device's installed SIM.
 
This is a good approach if you have a device that affords easy SIM changes, like a MultiTech GSM modem and need to provision a few dozen subscribers.
 
 
 
Again, if you're really clever you'll write a script to automate that. And if you're a good person you'll share it with the rest of us.
 
Order Lots of SIMs¶
 
 
 
If you need even larger numbers of SIMs provisioned you might consider ordering a batch of them with sequential IMSIs that can be easily programmed into Asterisk with a script.
 
 
 
Programming IMSIs Into Asterisk¶
 
 
 
To provision an IMSI into Asterisk you will need to modify two files: sip.conf and extensions.conf. These files are normally located in /etc/asterisk.
 
Creating a SIP User in sip.conf¶
 
 
 
The minimal entry for the IMSI in sip.conf looks like this:
 
 
 
r310410186585294
 
 
  canreinvite=no
 
  canreinvite=no
 
  type=friend
 
  type=friend
Line 66: Line 13:
 
  context=sip-external
 
  context=sip-external
 
  host=dynamic
 
  host=dynamic
 
+
 
+
  [IMSI510110301694405]
 
+
  callerid=21019
  [IMSI204123170034543]
 
  callerid=IMSI204123170034543 <IMSI204123170034543>
 
 
  canreinvite=no
 
  canreinvite=no
 
  type=friend
 
  type=friend
 
  allow=gsm
 
  allow=gsm
  context=sip-internal
+
  context=sip-external
 
  host=dynamic
 
  host=dynamic
  
 +
Contoh isi /etc/asterisk/extensions.conf adalah sebagai berikut
  
This defines a SIP user called "310410186585294".
+
  [sip-external]
Assigning an Address in extensions.conf¶
+
  exten => 21011,1,Dial(SIP/IMSI520010104743577)
We recommend this macro for dialing OpenBTS users:
+
  exten => 21022,1,Dial(SIP/IMSI520010201115028)
 
+
  exten => 21023,1,Dial(SIP/IMSI520012391814084)
  [macro-dialGSM]
+
  exten => 21024,1,Dial(SIP/IMSI520990400939846)
  exten => s,1,Dial(SIP/${ARG1})
+
  exten => 21025,1,Dial(SIP/IMSI520189200141327)
  exten => s,2,Goto(s-${DIALSTATUS},1)
+
  exten => 21025,1,Dial(SIP/IMSI520189200141327)
  exten => s-CANCEL,1,Hangup
+
  exten => 21019,1,Dial(SIP/IMSI510110301694405)
  exten => s-NOANSWER,1,Hangup
+
  exten => 21018,1,Dial(SIP/IMSI520154100006647)
  exten => s-BUSY,1,Busy(30)
 
  exten => s-CONGESTION,1,Congestion(30)
 
  exten => s-CHANUNAVAIL,1,playback(ss-noservice)
 
  exten => s-CANCEL,1,Hangup
 
 
 
  
(And if any Asterisk expert has improvements to that, please feel free to submit them.) With that macro in place, the GSM handset can be assigned an extension just like any other Asterisk terminal device.
+
Angka IMSI520154100006647 di peroleh dari SMS yang di terima oleh user OpenBTS.
For example, this macro assigns extension "2103" to the handset with ISMI "310410186585291":
 
  
;; the name in the brackets is the context, it should be the same with the context line in sip.conf
+
Bagi anda yang ingin mempelajari lebih lanjut tentang asterisk sangat di sarankan untuk membaca-baca tentang [[VoIP]] atau [[Internet Telepon]] karena disini akan di terangkan lebih jauh tentang berbagai konfigurasi asterisk dan bagaimana melakukan mapping ke +62XXX menggunakan teknologi ENUM.
 
 
[sip-external]
 
exten => 2103,1,Macro(dialGSM,310410186585291)
 
  
 +
==Pranala Menarik==
  
And this macro allows a specific block of 1,000 AT&T SIMs (310410186585000-310410186585999) to be dialed by the last 4 digits of the IMSI:
+
* [[Membuat Base Station GSM Open Source]]
 +
* [[GNURadio: Ubuntu Install]]
 +
* [[OpenBTS: Ubuntu Install]]
 +
* [[OpenBTS: Konfigurasi]]
 +
* [[OpenBTS: Konfigurasi Asterisk untuk OpenBTS]]
 +
* [[OpenBTS: Mengoperasikan BTS]]
 +
* [[Teknologi Selular]]
 +
* [[Wireless Internet]]
  
exten => _5XXX,1,Macro(dialGSM,310410186585${EXTEN:-3})
+
[[Category: Wireless]]
 +
[[Category: Selular]]

Revision as of 03:10, 10 December 2010

Pada dasarnya tidak banyak yang perlu di konfigurasi di Asterisk agar berbicara dengan OpenBTS. Kita terutama perlu mengedit file

/etc/asterisk/sip.conf
/etc/asterisk/extensions.conf

Contoh isi /etc/asterisk/sip.conf adalah sebagai berikut

[IMSI520010104743577]
callerid=21011
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic

[IMSI510110301694405]
callerid=21019
canreinvite=no
type=friend
allow=gsm
context=sip-external
host=dynamic

Contoh isi /etc/asterisk/extensions.conf adalah sebagai berikut

[sip-external]
exten => 21011,1,Dial(SIP/IMSI520010104743577)
exten => 21022,1,Dial(SIP/IMSI520010201115028)
exten => 21023,1,Dial(SIP/IMSI520012391814084)
exten => 21024,1,Dial(SIP/IMSI520990400939846)
exten => 21025,1,Dial(SIP/IMSI520189200141327)
exten => 21025,1,Dial(SIP/IMSI520189200141327)
exten => 21019,1,Dial(SIP/IMSI510110301694405)
exten => 21018,1,Dial(SIP/IMSI520154100006647)

Angka IMSI520154100006647 di peroleh dari SMS yang di terima oleh user OpenBTS.

Bagi anda yang ingin mempelajari lebih lanjut tentang asterisk sangat di sarankan untuk membaca-baca tentang VoIP atau Internet Telepon karena disini akan di terangkan lebih jauh tentang berbagai konfigurasi asterisk dan bagaimana melakukan mapping ke +62XXX menggunakan teknologi ENUM.

Pranala Menarik