Hi David,
Thanks a lot for your advice. Here are the port numbers used in my testbed and they are setup in openBTS.db (wush.net/trac/rangepublic/wiki/multiBTS):
PBX (Asterisk)- 192.168.1.0:5060
smqueue - 192.168.1.0:5063
sipauthserve - 192.168.1.0: 5064
OpenBTS (1st BTS) - 192.168.1.1:5062
OpenBTS (2nd BTS) -192.168.1.2:5062
I did some changes as follows:
1)added the port number (5060) into extensions.conf
2)change canreinvite=no, so go through Asterisk
3)change type=peer
echo test still fine, unfortunately, when I call from one pone to another, the error comes at asterisk CLI: (please understand that I hide the IMSI number for security reason)
[color=#FF0000][May 28 10:19:45] NOTICE[3926][C-00000001]: chan_sip.c:25288 handle_request_invite: Call from ‘IMSIXXXXXXXXXXXXX’ (127.0.0.1:5060) to extension ‘IMSIXXXXXXXXXXXXX’ rejected because extension not found in context ‘sip-local’.[/color]
I also noticed that:
- I can only set the port number in sip.conf as 5060, otherwise, whenever I reload the dialplan (CLI>dialplan reload), the error is :“extension not reachable”
- everytime when I dial the number, for instance, 1st phone is 1111, 2nd phone is 2222, when dialing 2222 on 1st phone, the port number of 1st is changed to 5062 in sqlite3.db (in the table SIP_buddies).
==================================================================================================
I attached my code here:
sip.conf
[general]
bindport=5060 ; asterisk 1.6
; UDP Port to bind to (SIP standard port for unencrypted UDP
; and TCP sessions is 5060)
; bindport is the local UDP port that Asterisk will listen on
bindaddr=0.0.0.0 ; asterisk 1.6
; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
; You can specify port here too, like 123.123.123.123:5080
udpbindaddr=0.0.0.0 ; asterisk 1.8
; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
; Optionally add a port number, 192.168.1.1:5062 (default is port 5060)
tos_sip=cs3 ; Sets TOS for SIP packets.
tos_audio=ef ; Sets TOS for RTP audio packets.
tos_video=af41 ; Sets TOS for RTP video packets.
tos_text=af41 ; Sets TOS for RTP text packets.
cos_sip=3 ; Sets 802.1p priority for SIP packets.
cos_audio=5 ; Sets 802.1p priority for RTP audio packets.
cos_video=4 ; Sets 802.1p priority for RTP video packets.
cos_text=3 ; Sets 802.1p priority for RTP text packets.
maxexpiry=3600 ; Maximum allowed time of incoming registrations
; and subscriptions (seconds)
minexpiry=60 ; Minimum length of registrations/subscriptions (default 60)
defaultexpiry=3600 ; Default length of incoming/outgoing registration
dynamic_exclude_static=yes ; Disallow all dynamic hosts from registering
; as any IP address used for staticly defined
; hosts. This helps avoid the configuration
; error of allowing your users to register at
; the same address as a SIP provider.
use_q850_reason=yes ; Set to yes add Reason header and use Reason header if it is available.
;t1min=100 ; Minimum roundtrip time for messages to monitored hosts
; Defaults to 100 ms
;timert1=500 ; Default T1 timer
; Defaults to 500 ms or the measured round-trip
; time to a peer (qualify=yes).
;timerb=32000 ; Call setup timer. If a provisional response is not received
; in this amount of time, the call will autocongest
; Defaults to 64*timert1
rtptimeout=60 ; Terminate call if 60 seconds of no RTP or RTCP activity
; on the audio channel
; when we're not on hold. This is to be able to hangup
; a call in the case of a phone disappearing from the net,
; like a powerloss or grandma tripping over a cable.
rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP or RTCP activity
; on the audio channel
; when we're on hold (must be > rtptimeout)
;allowguest=no ; Allow or reject guest calls (default is yes)
autocreatepeer=yes ; The Autocreatepeer option allows,
; if set to Yes, any SIP ua to register with your Asterisk PBX as a peer.
; This peer's settings will be based on global options.
; The peer's name will be based on the user part of the Contact: header field's URL.
context=phones ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
disallow=all ; need to disallow=all before we can use allow=
allow=gsm ; GSM
allow=ulaw ; ISDN US
allow=alaw ; ISDN EU
relaxdtmf=yes ; Relax dtmf handling
dtmfmode=auto ; Set default dtmfmode for sending DTMF. Default: rfc2833
; Other options:
; info : SIP INFO messages (application/dtmf-relay)
; shortinfo : SIP INFO messages (application/dtmf)
; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
; auto : Use rfc2833 if offered, inband otherwise
[IMSIXXXXXXXXXXXXX]
username=IMSIXXXXXXXXXXXXX ; usually the same with the section title
callerid=1111
canreinvite=no ; allow RTP voice traffic go through Asterisk
type=peer
context=sip-local
host=127.0.0.1
port=5060
disallow=all ;use disallow=all before using allow=..
allow=gsm
allow=g729
dtmfmode=info ;either RFC2833 or INFO for the BudgeTone
qualify=yes
nat=no ;there is no NAT between phone and asterisk
[IMSIXXXXXXXXXXXXX]
username=IMSIXXXXXXXXXXXXX
callerid=2222
canreinvite=no
type=peer
context=sip-local
host=127.0.0.1
port=5060
disallow=all
allow=gsm
allow=g729
dtmfmode=info
qualify=yes
nat=no
extensions.conf
[globals]
[default]
; This is the context for handsets that are allowed to attached via open registration.
; Normally, this context is only used for testing.
; These are test extensions that you might want to disable after installation.
; Create an extension, 2600, for evaluating echo latency.
exten => 2600,1,Answer() ; Do the echo test
exten => 2600,n,Echo ; Do the echo test
exten => 2600,n,Hangup
[outbound-trunk]
; If you had an external trunk, you would dial it here.
exten => _N.,1,Answer()
[sip-local]
include => default
include => macro-dialGSM
exten => 1111,1,Dial(SIP/IMSIXXXXXXXXXXXXX,10,t)
exten => 2222,1,Dial(SIP/IMSIXXXXXXXXXXXXX,10,t)
[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
[sip-external]
; This is the top-level context that gives access to out-of-network calling.
; also includes the in-network calling.
include => sip-local
include => outbound-trunk
=============================================================
[quote=“david55”]I don’t understand why this hasn’t been faulted as a loop back!
If you have host=127.0.0.1, you need to specify an explicit port number, as Asterisk itself will have bound to the default one. You will need to specify that port number in the configuration for the other SIP software on the same machine.
canreinvite is a deprecated synonym for directmedia. directmedia=yes does not cause media to go through Asterisk. It is actually one of the conditions that have to be fulfilled for media to NOT go through Asterisk.
Normally, type=peer causes less problems than type=friend. It is only needed in relatively unusual dynamic host cases.
When you say “only the part you modified”, where did you get the unmodified version from?
I hope you have an appropriate radio telephony licence, as the documentation for OpenBTS seems to say it is only sometimes necessary, when it will always be necessary.[/quote]