[asterisk-users] Matching *, + and # in the dialplan

Steve Murphy murf at digium.com
Thu Oct 16 15:44:22 CDT 2008


On Thu, 2008-10-16 at 13:59 -0500, Karl Fife wrote:
> On Thu, 16 Oct 2008 11:47:15 -0500, "Tilghman Lesher"
> <tilghman at mail.jeffandtilghman.com> said:
> > 
> > If you could explain what ISN is, that might help.
> 
> an ISN, stands for ITAD Subscriber Number, which in turn stands for
> 'Internet Telephony Administrative Domain Subscriber Number'. 
> Essentially it is a very clever way of resolving numeric strings (easily
> be entered on a twelve-key numeric keypad) to full SIP uri's. 
> 
> for example 1234 at sip.ucla.edu would be hard to enter on a telephone
> keypad.  ISN (available through Freenum.org) offers a solution.  
> 
> sip.ucla.edu is assigned the resolvable numeric string '269'.  The
> extension '1234' is already numeric.  The @ sign in the SIP uri is
> replaced by *.  
> 
> 1234*296 is dialed on the keypad, which resolves to 1234 at sip.ucla.edu. 
> The call is completed bypassing the PSTN. 
> 
> Back to the main idea:
> 
> The ISN is unambiguous.  There are no other dial strings that have a
> single * somewhere between position 2 and length-3
> 
> It seems silly and kludgey to have to use an ISN prefix to recognize the
> ISN, so that it can be sent to the resolver, so that it can be routed,
> but I suspect that there's no way to differentiate that format with the
> parser as it currently functions.
> 

Since our pattern matching algorithms can't do trailing context,
then you can't do something simple like the RE X+\*X+ where X= [0-9],
but you can do:

X[*]XX.            {Set(num=${EXTEN:0:1}; Set(isn=${EXTEN:2};
Dial(...); }
XX[*]XX.           {Set(num=${EXTEN:0:2}; Set(isn=${EXTEN:3};
Dial(...); }
XXX[*]XX.          {Set(num=${EXTEN:0:3}; Set(isn=${EXTEN:4};
Dial(...); }
XXXX[*]XX.         {Set(num=${EXTEN:0:4}; Set(isn=${EXTEN:5};
Dial(...); }
XXXXX[*]XX.        {Set(num=${EXTEN:0:5}; Set(isn=${EXTEN:6};
Dial(...); }
XXXXXX[*]XX.       {Set(num=${EXTEN:0:6}; Set(isn=${EXTEN:7};
Dial(...); }
XXXXXXX[*]XX.      {Set(num=${EXTEN:0:7}; Set(isn=${EXTEN:8};
Dial(...); }
XXXXXXXX[*]XX.     {Set(num=${EXTEN:0:8}; Set(isn=${EXTEN:9};
Dial(...); }
XXXXXXXXX[*]XX.    {Set(num=${EXTEN:0:9}; Set(isn=${EXTEN:10};
Dial(...); }
XXXXXXXXXX[*]XX.   {Set(num=${EXTEN:0:10}; Set(isn=${EXTEN:11};
Dial(...); }
XXXXXXXXXXX[*]XX.  {Set(num=${EXTEN:0:11}; Set(isn=${EXTEN:12};
Dial(...); }

(I hope I have my numbers right!)
OR, you could use: ReadExten or WaitExten, maybe, depending on how they
react to *, which might collide with a def in features.conf, or
where-ever the
features like # (xfer) are defined.

The above might seem dorky, but, it's not that bad. Some folks define
their dialplans with thousands of numbers, and nobody thinks anything of
it!

murf

-- 
Steve Murphy
Software Developer
Digium
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20081016/2d735ae7/attachment.bin 


More information about the asterisk-users mailing list