Hi, I'm trying to automatically have the dialplan assign an extension to a roaming phone on my network. I tried the following without success: exten => 3001,1(readop),BackGround(beep) exten => 3001,n,Read(digito,vm-youhave,3) exten => 3001,n,SayDigits(${digito}) exten => 3001,n,Set(ROAM=${digito}) exten => 3001,n,Set(DB(roam/ext)=${digito}) exten => 3001,n,playback(vm-goodbye) exten => 3001,n,hangup exten => _4XXX,1,Set(ROAM=${DB(roam/ext)}) exten => _4XXX,n,dial(SIP/${ROAM}) The idea was that the roaming phone first dials 3001, sets a 3 digits extension (eg 123) and then I supposed that 4123 would work. But it does not. I am unsure about the 2 Set lines. Can anyone help? Regards
Danny Nicholas
2011-Feb-18 14:11 UTC
[asterisk-users] Assigning an extension to a roaming phone
-----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Axelle Sent: Friday, February 18, 2011 5:36 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Assigning an extension to a roaming phone Hi, I'm trying to automatically have the dialplan assign an extension to a roaming phone on my network. I tried the following without success: exten => 3001,1(readop),BackGround(beep) exten => 3001,n,Read(digito,vm-youhave,3) exten => 3001,n,SayDigits(${digito}) exten => 3001,n,Set(ROAM=${digito}) exten => 3001,n,Set(DB(roam/ext)=${digito}) exten => 3001,n,playback(vm-goodbye) exten => 3001,n,hangup exten => _4XXX,1,Set(ROAM=${DB(roam/ext)}) exten => _4XXX,n,dial(SIP/${ROAM}) The idea was that the roaming phone first dials 3001, sets a 3 digits extension (eg 123) and then I supposed that 4123 would work. But it does not. I am unsure about the 2 Set lines. Can anyone help? Regards I'm thinking that _4XXX is an "over-complication". _4XXX means you could dial any number from 4000 through 4999 inclusive and get the extension at SIP/${ROAM}. I'd change the line 2 - exten => _4XXX,n,Dial(SIP/${ROAM},30,,mKkTt) Or - exten => 4123,1,Dial(SIP/${ROAM},30,,mKkTt)
Hi,>I'm thinking that _4XXX is an "over-complication". _4XXX means you could >dial any number from 4000 through 4999 inclusive and get the extension at >SIP/${ROAM}.Well it's kind of what I want. I have a roaming phone that comes in. He dials 3001, sets his extension to 123, so that he is assigned 4123. I have another roamding phone that comes in. Dials 3001, sets his extension to 124. He is assigned 4124. Or at least that's how I understand it. In reality, what I only need is all roaming phones to get assigned an extension (within a given range) and to have a way to find their extension number. Roaming phone 1 comes in. Get assigned (automatically) 4001. Roaming phone 2 comes in. Get assigned (automatically) 4002. Roaming phone 3 comes in. Get assigned (automatically) 4003. etc>I'd change the line 2 >- exten => _4XXX,n,Dial(SIP/${ROAM},30,,mKkTt)looks pretty similar to the previous line - apart from that mKkTt. What is that for? What's wrong with the previous line.>Or >- exten => 4123,1,Dial(SIP/${ROAM},30,,mKkTt)That would only match case where roaming user wants to be assigned 4123, but it would not work for - say - 4124. Thanks.
Carlos Chavez
2011-Feb-22 16:28 UTC
[asterisk-users] Assigning an extension to a roaming phone
On Fri, 2011-02-18 at 12:36 +0100, Axelle wrote:> Hi, > I'm trying to automatically have the dialplan assign an extension to a > roaming phone on my network. > I tried the following without success: > > exten => 3001,1(readop),BackGround(beep) > exten => 3001,n,Read(digito,vm-youhave,3) > exten => 3001,n,SayDigits(${digito}) > exten => 3001,n,Set(ROAM=${digito}) > exten => 3001,n,Set(DB(roam/ext)=${digito}) > exten => 3001,n,playback(vm-goodbye) > exten => 3001,n,hangup > exten => _4XXX,1,Set(ROAM=${DB(roam/ext)}) > exten => _4XXX,n,dial(SIP/${ROAM}) > > The idea was that the roaming phone first dials 3001, sets a 3 digits > extension (eg 123) and then I supposed that 4123 would work. But it > does not. > I am unsure about the 2 Set lines. > Can anyone help? > Regards >I think you are confusing extensions with SIP usernames. In order to dial anything on your system you already need to know the "name" of the SIP phone (unless you are not doing authentication which is a bad idea). That way you can use Dial(SIP/sipphone). If you want to assign an an extension to this sipphone you need to save the username to your database to a key maybe like roam/123. That way when you lookup roam/123 from the database you get the username of the phone and insert that into your dial command. -- Telecomunicaciones Abiertas de M?xico S.A. de C.V. Carlos Ch?vez Prats Director de Tecnolog?a +52-55-91169161 ext 2001 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110222/bd13f59c/attachment.pgp>
Possibly Parallel Threads
- How to list used extensions + assign extension to a roaming phone
- problem with DTMF detection on calls created with Originate AMI command
- Two asterisk servers, two different service providers
- voicemail number of rings
- Adding a higher level partition to ZFS pool