[asterisk-users] Assigning an extension to a roaming phone
Danny Nicholas
danny at debsinc.com
Tue Feb 22 10:34:58 CST 2011
-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Axelle
Sent: Tuesday, February 22, 2011 10:08 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Assigning an extension to a roaming phone
>> Axelle, please post the CLI output from the 3001 call and I'll put up a
>> dialplan that should work for you.
>
> <snip>
>
> Not what I asked for, but here's what I can tell you.
Oh I'm sorry but then what are you asking for? I thought it was the
console messages on Asterisk.
From what you posted,
> you can dial and outside number and from in-house you can dial 2102 or
2103.
> The way the dialplan works is that you set up specific numbers that will
be
> valid like you have done with 2102, 2103 and 3001 or a range of numbers
that
> will be valid like 4000-4999. For the 4XXX "magic number" snippet to ever
> work correctly, it has to dial an outside number or a pre-defined in-house
> extension.
>
> From what you posted, if you dial 4002, the call should properly connect
to
> 2103.
Yes, indeed, but that's not what I want it to do. 2103 does not
correspond to anyone.
Yeah, by the way, just to make that clear: the roaming phone does not
have *any phone number*. I need the dialplan to assign one. Re-routing
to another number won't work, as there is no other number...
Thanks
Axelle
Okay. I modified the dialplan you posted to look like this
;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,SayDigits(${digito})
exten => 3001,n,Verbose(Setting roaming extension 4${digito})
exten => 3001,n,Set(DB(roam/${digito})=${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)
Here's the output from my 3001 call -
Verbosity is at least 10
-- Executing [3001 at default:1] Verbose("SIP/sipuser-0000006f", "Create
roaming extension") in new stack
Create roaming extension
-- Executing [3001 at default:2] Verbose("SIP/sipuser-0000006f", "Caller
IMSI is ") in new stack
Caller IMSI is
-- Executing [3001 at default:3] Read("SIP/sipuser-0000006f",
"digito|beep|3") in new stack
-- Accepting a maximum of 3 digits.
-- <SIP/sipuser-0000006f> Playing 'beep' (language 'en')
-- User entered '144'
-- Executing [3001 at default:4] SayDigits("SIP/sipuser-0000006f", "144")
in new stack
-- <SIP/sipuser-0000006f> Playing 'digits/1' (language 'en')
-- <SIP/sipuser-0000006f> Playing 'digits/4' (language 'en')
-- <SIP/sipuser-0000006f> Playing 'digits/4' (language 'en')
-- Executing [3001 at default:5] Verbose("SIP/sipuser-0000006f", "Setting
roaming extension 4144") in new stack
Setting roaming extension 4144
-- Executing [3001 at default:6] Set("SIP/sipuser-0000006f",
"DB(roam/144)=144") in new stack
-- Executing [3001 at default:7] Playback("SIP/sipuser-0000006f",
"vm-goodbye") in new stack
-- <SIP/sipuser-0000006f> Playing 'vm-goodbye' (language 'en')
-- Executing [3001 at default:8] Hangup("SIP/sipuser-0000006f", "") in new
stack
== Spawn extension (default, 3001, 8) exited non-zero on
'SIP/sipuser-0000006f'
-- Executing [h at default:1] Goto("SIP/sipuser-0000006f", "end-call|h|1")
in new stack
-- Goto (end-call,h,1)
-- Executing [h at end-call:1] Hangup("SIP/sipuser-0000006f", "") in new
stack
== Spawn extension (end-call, h, 1) exited non-zero on 'SIP/sipuser-
0000006f'
* and my 4144 call *
-- Executing [4144 at default:1] Verbose("SIP/sipuser-00000070", "Calling
roaming extension 4144") in new stack
Calling roaming extension 4144
-- Executing [4144 at default:2] Set("SIP/sipuser-00000070", "ROAMEXT=144")
in new stack
-- Executing [4144 at default:3] Dial("SIP/sipuser-00000070", "SIP/144|30")
in new stack
-- Called 144
-- SIP/144-00000071 is ringing
-- SIP/144-00000071 answered SIP/sipuser-00000070
-- Native bridging SIP/sipuser-00000070 and SIP/144-00000071
-- Executing [h at default:1] Goto("SIP/sipuser-00000070", "end-call|h|1")
in new stack
-- Goto (end-call,h,1)
-- Executing [h at end-call:1] Hangup("SIP/sipuser-00000070", "") in new
stack
Still not probably what you are looking for, but maybe it will steer you
along.
More information about the asterisk-users
mailing list