[asterisk-users] Assigning an extension to a roaming phone
Axelle
aafortinet at gmail.com
Tue Feb 22 05:32:06 CST 2011
> [roaming-ext]
> ;Create a new roaming extension
> exten => 3001,1(readop),Verbose(Create roaming extension)
> exten => 3001,n,Read(digito,beep,3)
> exten => 3001,n,Playback(you-entered)
> exten => 3001,n,SayDigits(${digito})
> exten => 3001,n,Verbose(Setting roaming extension 4${digito} to call
> ${CALLERID(num)})
> exten => 3001,n,Set(DB(roam/${digito})=${CALLERID(num)})
> exten => 3001,n,Playback(vm-goodbye)
> exten => 3001,n,Hangup()
Good idea the Verbose commands, at least I see a bit better what is
happening. I should have thought about that one. Thanks.
But I don't understand the CALLERID part: the roaming user is unknown
on my network, so how could he have a correct CALLERID?
>
> ;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)
I tried it and I get the following logs:
[Feb 22 11:57:44] NOTICE[20626]: chan_sip.c:15642
handle_request_register: Registration from 'IMSI20830xxxx'
<sip:IMSI20830xxxx at 127.0.0.1>' failed for '127.0.0.1' - No matching
peer found
=> this line appears when the roaming user comes in
Create roaming extension
Setting roaming extension 4001 to call 2103
=> those two lines occur when the roaming user dials 3001. Why is it
returning a callerid 2103?? 2103 corresponds to another registered
IMSI !!
Calling roaming extension 4001
[Feb 22 12:05:07] WARNING[27577]: chan_sip.c:2921 create_addr: No such
host: 2103
[Feb 22 12:05:07] WARNING[27577]: app_dial.c:1202 dial_exec_full:
Unable to create channel of type 'SIP' (cause 3 - No route to
destination)
=> this is displayed when the roaming user dials 4001. It's quite
normal it can't route to 2103 because that phone is off.
>
> Then you need to include the [roaming-ext] context in whatever context your
> phones dial from. The basic idea behind this is that you need to store the
> extension where your roamer is currently sitting in your DB, which you were
> doing. By adding the ${CALLERID(num)} to the database, you give it an idea
> of where the calls should go.
Not sure to understand.
The goal here is to assign an extension to the roaming user. He calls 3001.
Where 'the calls should go' is to the roaming user.
> Now, this means your ${CALLERID(num)}
> variable needs to match your SIP endpoint's name, of course, but if these
> don't currently match, I'm pretty sure there is a variable you can use to
> achieve the same effect.
-- Axelle
More information about the asterisk-users
mailing list