配置 Asterisk 同
OpenBTS 工作
理论上 OpenBTS 同 Asterisk 集成在一起是很简单的:把每个 SIM 在 Asterisk 中配置成一个 SIP 用户, 用 IMSI 作为 SIP 的用户名。 因此以下两个步骤便可以为 OpenBTS 提供订户:
获取 IMSIs有好几种方法为一个 SIM 获取 IMSI, 因此它可以被编程(糅合)到 Asterisk 的配置文件中。 使用哪种方法取决于 SIMs 的容量,你需提供。 由 OpenBTS 自身获得 IMSI对于很小数量的 SIMs,这是一种最简单的方法。无论何时手持试图注册到 OpenBTS, 它将发送手持一个辨识码。 可以强迫手持使用 IMSI 作为辨识码。 当手持试图注册时,便可以从 OpenBTS 的终端画面捕获 IMSI。 下面是操作步骤:
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) SDCCHDispatch.cpp:136 ControlLayer SDCCHDisptacher waiting for RELEASE SDCCHDispatch.cpp:97 ControlLayer SDCCHDisptacher waiting for ESTABLISH
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
Use the GSM "AT" InterfaceMany 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":http://www.multitech.com/PRODUCTS/Families/MultiModemGPRS/ 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 SIMsIf 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 AsteriskTo 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.confThe minimal entry for the IMSI in sip.conf looks like this: <pre> r310410186585294 canreinvite=no type=friend allow=gsm context=sip-external host=dynamic </pre> This defines a SIP user called "310410186585294". Assigning an Address in extensions.confWe recommend this macro for dialing OpenBTS users: <pre> [macro-dialGSM] exten => s,1,Dial(SIP/${ARG1}) exten => s,2,Goto(s-${DIALSTATUS},1) exten => s-CANCEL,1,Hangup exten => s-NOANSWER,1,Hangup exten => s-BUSY,1,Busy(30) exten => s-CONGESTION,1,Congestion(30) exten => s-CHANUNAVAIL,1,playback(ss-noservice) exten => s-CANCEL,1,Hangup </pre> (And if any Asterisk expert has improvements to that, please feel free to submit them.) <pre> 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:;; the name in the brackets is the context, it should be the same with the context line in sip.conf [sip-external] exten => 2103,1,Macro(dialGSM,310410186585291) </pre> <pre> exten => _5XXX,1,Macro(dialGSM,310410186585${EXTEN:-3}) </pre> 注:Setting Up Asterisk to Work with OpenBTS(原文出处,翻译整理仅供参考!) |