[asterisk-users] Assigning an extension to a roaming phone

Axelle aafortinet at gmail.com
Tue Feb 22 08:48:16 CST 2011


H Danny,

> Axelle, please post the CLI output from the 3001 call and I'll put up a
> dialplan that should work for you.

So this is the output I get:

Connected to Asterisk 1.4.21.2~dfsg-3+lenny1 currently running on
openbts (pid = 20597)
[Feb 22 15:18:02] NOTICE[20626]: chan_sip.c:15642
handle_request_register: Registration from
'IMSI20830061xxxx<sip:IMSI20830061xxxx at 127.0.0.1>' failed for
'127.0.0.1' - No matching peer found
Create roaming extension
Caller IMSI is
Setting roaming extension 4001
Calling roaming extension 4001
[Feb 22 15:22:42] WARNING[9512]: chan_sip.c:2921 create_addr: No such host: 4001
[Feb 22 15:22:42] WARNING[9512]: app_dial.c:1202 dial_exec_full:
Unable to create channel of type 'SIP' (cause 3 - No route to
destination)
openbts*CLI> database show
/SIP/Registry/IMSI20810xxxx                 :
127.0.0.1:5062:3600:IMSI20810xxxx:sip:IMSI20810xxxx at 127.0.0.1:5062
/SIP/Registry/IMSI20830061xxxx                 :
127.0.0.1:5062:3600:IMSI20830061xxxx:sip:IMSI20830061xxxx at 127.0.0.1:5062
/SIP/Registry/IMSI2083044xxx                 :
127.0.0.1:5062:3600:IMSI2083044xxxx:sip:IMSI2083044xxxx at 127.0.0.1:5062
/roam/001                                         : 4001
/roam/002                                         : 2103
/roam/003                                         : 4003
/roam/007                                         : 4007
/roam/ext                                         : 001
openbts*CLI>

My current extensions.conf is
[globals]

; This is the extensions file used in the Burning Man 2008
; site test, with private information removed.
; Jump to the end for handset examples.

[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(3000)
exten => s-CONGESTION,1,Congestion(3000)
exten => s-CHANUNAVAIL,1,playback(ss-noservice)
exten => s-CANCEL,2,Hangup

[from-trunk]
; route incoming calls from the PSTN

[sip-external]
include => sip-local
; roaming users
;Create a new roaming extension
exten => 3001,1(readop),Verbose(Create roaming extension)
exten => 3001,n,Verbose(Caller IMSI is ${IMSI})
exten => 3001,n,Read(digito,beep,3)
exten => 3001,n,Playback(vm-goodbye)
exten => 3001,n,SayDigits(${digito})
exten => 3001,n,Verbose(Setting roaming extension 4${digito})
exten => 3001,n,Set(DB(roam/${digito})=4${digito})
exten => 3001,n,Playback(vm-goodbye)
exten => 3001,n,Hangup()

;Dial a roaming extension
exten => _4XXX,1,Verbose(Calling roaming extension ${EXTEN})
exten => _4XXX,n,Set(ROAMEXT=${DB(roam/${EXTEN:1})})
exten => _4XXX,n,Dial(SIP/${ROAMEXT},30)

; outgoing trunk access
; NANP

[sip-local]
; removing full IMSI value for the cut and paste in the list
exten => 2102,1,Macro(dialSIP,IMSI20810xxxx)
exten => 2103,1,Macro(dialSIP,IMSI2083044xxxx)
; Note 2111 is commented:
;exten => 2111,1,Macro(dialSIP,IMSI20830061xxxx)

exten => 6123,1,SayNumber(${EXTEN})

My sip.conf is:
[general]
bindaddr=0.0.0.0
bindport=5060
; Comment these out if no backhaul is available.

; This is a GSM handset entry.
; You need one for each SIM.
; The IMSI is a 15-digit code in the SIM.
; You can see it in the Control log whenever a phone tries to register.
[IMSI20810xxxx]	
callerid=2102
canreinvite=no
type=friend
context=sip-external
allow=gsm
host=dynamic

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

;[IMSI20830061xxxx]
;callerid=2111
;canreinvite=no
;type=friend
;context=sip-external
;allow=gsm
;host=dynamic

-- Axelle



More information about the asterisk-users mailing list