Asterisk+Configuration+to+Work+With+Mobile+Through+OpenBTS
-
Upload
tarik-kazaz -
Category
Documents
-
view
68 -
download
0
description
Transcript of Asterisk+Configuration+to+Work+With+Mobile+Through+OpenBTS
Experiment ID
Asterisk Configuration to Work with Mobile through OpenBTS.
Responsible Engineer
Mohamed Hegazy.
Purpose
Learn how to configure asterisk to connect MS station as SIP client through
OpenBTS, and configure OpenBTS to connect to asterisk.
Resources Required
Pc with Linux operating system and Asterisk installed.
Pc with Linux operating system and OpenBTS installed connected to USRP.
(Can Use Same PC with Linux Operating System with Asterisk and OpenBTS installed)
(Can Use More Than One OpenBTS PC)
USRP unit.
Mobile with SIM.
Artifacts
How to connect (One or More) OpenBTS to Asterisk.
How to connect MS as client to asterisk through OpenBTS.
Experiment Description
Step1:
To add a GSM handset (MS) to asterisk as SIP client through SIP.conf file.
The name is the IMSI which is a 15-digit code in the SIM. You can see it in
the Control log (In OpenBTS) whenever a phone tries to register (to
OpenBTS). callerid is the mobile number which will be assigned to that user
(IMSI)
Example:
[602022034266633]
callerid=2102
canreinvite=no
type=friend
context=sip-external
allow=gsm
host=dynamic
Step2:
Create a dialplan for clients (MS) in extensions.conf.Use macros to avoid
repeating the same dialplan for every client
Example:
[macro-dialSIP]
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
Step3:
Define a new context which maps between Caller Id and his IMSI (Because
when you make a call, you don`t dial a destination IMSI but you call its caller
ID)
Example:
[sip-local]
; This is a simple mapping between extensions and IMSIs.
exten => 0101650009,1,Macro(dialSIP,IMSI602022039311598)
exten => 0102963592,1,Macro(dialSIP,IMSI602022004523247)
Step4:
In OpenBTS.config file under OpenBTS apps directory, change the Asterisk
IP under Asterisk section to your asterisk server IP (If using same machine
keep it 127.0.0.1) and the port used for SIP channel in SIP.conf.
Example:
# Asterisk PBX
Asterisk.IP 127.0.0.1
Asterisk.Port 5060
$static Asterisk.IP
$static Asterisk.Port
In the SIP IP section in OpenBTS.config, if Asterisk is 127.0.0.1, then the
SIP IP is also 127.0.0.1. Otherwise, SIP IP should be the local IP address of
the interface used to contact asterisk. In other words, this is the IP address at
which Asterisk will see OpenBTS.
Example:
SIP.IP 127.0.0.1
(If Connect More Than One Openbts Pc Repeat Step 4 For Every Pc)
Step 4: Using MS
At this point, you should be able to use Mobile and dial any extension defined in asterisk SIP Account & Dialplan (SIP.conf & extensions.conf). As you make a few test calls, be sure to watch the Asterisk command-line interface (and ensure that your verbosity is set to a value three or higher) so that you can see the messages coming from Asteriskto Set Verbosity when run the asterisk add at least three v's to activate the debug mode as follow
Asterisk -vvvvvvvr