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

Danny Nicholas danny at debsinc.com
Mon Feb 21 09:42:25 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: Monday, February 21, 2011 9:14 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Assigning an extension to a roaming phone

Hi again,

> Ok, so you need a "roaming magic dial" where 4XXX dials the assigned
phone.

Yes.

> Your original command
> - exten => _4XXX,n,Dial(SIP/${ROAM})
> Technically should work, just has no timeouts or control on it.
> The ,30 gives the Dial 30 seconds (about 6 rings) to complete, and mKkTt
> gives the caller music-on-hold until answer/time then lets the dialee
> re-transfer the call.
>
> As I understand what you just wrote, folks come into your shop with a cell
> phone (555-1212) and dial a number 3001 to tell your inhouse folks to
reach
> the cell at 4XXX.  Say "Joe" comes in and dials 3001.  Asterisk should say
> "what is your name".  He says "Joe" and Asterisk says "callers can now
reach
> Joe at 4001".  "Jim" comes in and does the same thing and gets 4002 until
> 999 folks do it.  Is that correct?

Well all I need is:
Joe dials 3001
Asterisk says "Callers can now reach you at 4001"
then, another caller can call 4001 and reach Joe.

But to my understanding, the lines below do something a bit more
complicated:
(please correct if wrong). And unfortunately they do not work in my case...

exten => 3001,1(readop),BackGround(beep)
Joe dials 3001 and gets a beep

exten => 3001,n,Read(digito,vm-youhave,3)
Asterisk says hello (I don't care the actual message, just to know
when I should start dialing) and reads 3 digits from Joe. Let's says
he dials 001.
Actually, this part does not work. Asterisk does not say 'you have'?!

exten => 3001,n,Read(digito,vm-youhave,3)
Asterisk says 001.

exten => 3001,n,Set(ROAM=${digito})
exten => 3001,n,Set(DB(roam/ext)=${digito})
Not very sure what this exactly does, but looks like assigning 001 to
roaming user.

exten => 3001,n,playback(vm-goodbye)
Asterisk says goodbye (works)

exten => 3001,n,hangup
Finish connection.

exten => _4XXX,1,Set(ROAM=${DB(roam/ext)})
Now an end-user dialing 4001. Don't know how this routes to my roaming
user...

exten => _4XXX,n,Dial(SIP/${ROAM},30,,mKkTt)
Dial the roaming user.
Does not work, Asterisk says 4001 is not attributed.

I still cannot reach my roaming user...

-- Axelle

Here goes today's shot at fixing this; 
The _4XXX,n,Dial(SIP/${ROAM}).. line assumes that the line is a defined SIP
extension in your Asterisk PBX.  
Let's say that your shop has 100 phones in it that are defined as 2000-2100.
To reach a "normal" in-house user, you would use this dialplan snippet
Exten => _2XXX,1,Dial(SIP/{$EXTEN},20,m)

If Joe comes in with his cell phone and wants to be called there, dial
SIP(anything) isn't going to connect to him unless you are "bouncing out"
over a SIP provider (DIAL(SIP/5551212 at myprovider.com)).  You would most
likely reach him using a DAHDI dial (DIAL(DAHDI/g1/5551212))

So let's say Joe has a cell and we want to call him at 4001.  We use this
line
Exten => 4001,1,Dial(DAHDI/g1/5551212)
Or 
Exten => 4001,1,Dial(SIP/5551212 at myprovider.com)

In either of these cases, ${ROAM} is a pseudo extension, not a real
reassignment.  

In another case, the 100 in-house extensions are in sections like Widgets
2000-2033, Gadgets 2034-2066 and Foobar 2067-2100.  Joe moves from section
to section, so we want to locate him in the section.  When Joe is in
Widgets, he dials 3001 and enters 001.  Now we find him in the Widget
section.  He dials 3001 again and enters 034.  Now he's in Gadgets.
Since Joe is at an in-house number, we can use FOLLOWME to put him at any
in-house phone.

Addressing two of your 3001 items:
exten => 3001,n,Read(digito,vm-youhave,3)
Asterisk says hello (I don't care the actual message, just to know
when I should start dialing) and reads 3 digits from Joe. Let's says
he dials 001.
Actually, this part does not work. Asterisk does not say 'you have'?!

exten => 3001,n,SayDigits(${digito})
Asterisk says 001.

I would have coded this like so:
exten => 3001,1,noop(get roam)
exten => 3001,n,playback(enterroamno)
exten => 3001,n,Read(digito,beep,3)
exten => 3001,n,playback(roamsetto)
exten => 3001,n,SayDigits(${digito})
exten => 3001,n,Set(DB(roam/ext)=${digito})

line 2 plays "enter roaming number" (you have to record it)
line 3 plays beep and accepts 3 digits
line 4 plays "you entered " (have to record it)
line 5 plays the 3 digits
line 6 sets a key in ASTDB for what you entered

Part two
exten => _4XXX,1,Set(ROAM=${DB(roam/ext)})
exten => _4XXX,n,Dial(SIP/${ROAM},30,,mKkTt)

line 1 user dials 4001 and gets ${ROAM} set from ASTDB
line 2 attempts to dial SIP extension based on ${ROAM} value.

Hope this helps.




More information about the asterisk-users mailing list