[asterisk-dev] New wildcards for pattern matching

Klaus Darilion klaus.mailinglists at pernau.at
Thu Feb 25 08:03:46 CST 2010



Am 25.02.2010 14:53, schrieb Pavel Troller:
> Hi!
>
>> _XXX! in overlap mode:
>>
>> 1 is received ... wait for more
>> 1 is received ... wait for more
>> 1 is received ... trigger ->  dialed number: 111
>>
>> _XX. in overlap mode:
>>
>> 1 is received ... wait for more
>> 1 is received ... wait for more
>> 1 is received ... trigger ->  dialed number: 111
>
> It's not true.
> I've made an example on a live system for you.
> Please look at the following:
>
> exten =>  _133X.,1,NoOp(Collected number: ${EXTEN})
> exten =>  _133X.,n,Milliwatt()
>
> exten =>  _134XX!,1,NoOp(Collected number: ${EXTEN})
> exten =>  _134XX!,n,Milliwatt()
>
> Asterisk log:
> Case 1:
>      -- Accepting overlap call from '11442' to '<unspecified>' on channel 0/19, span 1
>      -- Starting simple switch on 'DAHDI/g1-1'
>      -- Executing [1333333333 at default-ovlp:1] NoOp("DAHDI/g1-1", "Collected number: 1333333333") in new stack
>      -- Executing [1333333333 at default-ovlp:2] Milliwatt("DAHDI/g1-1", "") in new stack
> Case 2:
>      -- Accepting overlap call from '11442' to '<unspecified>' on channel 0/19, span 1
>      -- Starting simple switch on 'DAHDI/g1-1'
>      -- Executing [13444 at default-ovlp:1] NoOp("DAHDI/g1-1", "Collected number: 13444") in new stack
>      -- Executing [13444 at default-ovlp:2] Milliwatt("DAHDI/g1-1", "") in new stack
>
> Both the cases were dialled the same way: A call was received over PRI (no SS7)
> in overlap mode (you can see) and then, once per second, a digit has bee sent
> maximum 10 times. In the first case, after 10 digits the dialling was stopped,
> and after a timeout about 5 seconds the call was connected. In the second
> example, immediately after receiving the fifth digit, the connection was
> established, so it was not possible to send more digits.
>
> Do you see the diffference now ?

Yes, I see. You are right. ! stops the overlap timer.

So, ! and . are not only different in 2 ways - minimum number of 
characters and overlap behavior.

I guess the conclusion is that 2 different wildcards are needed - one 
which stops the overlap timer and one which does not stop the overlap timer.

regards
klaus


>
> With regards, Pavel.
>
>
>>
>> So, . can be substituted with !
>>
>> Or do I miss something special with SS7?
>
> I think it's the same for any technology capable of overlap dialling.
>
> Regards, Pavel.
>
>>
>> regards
>> klaus
>>
>> Am 25.02.2010 12:46, schrieb Pavel Troller:
>>>>> OK, a final '~' meaning 0 or more of the preceding
>>>>> character or class. Hmmm.   Instead, would it be OK to
>>>>> make it 1 or more
>>>>
>>>> Zero or more makes it more useful as it can replace the ! wildcard too.
>>>> It is always possible to make it one or more by simply doubling the last
>>>> char e.g.
>>>>
>>>> _123[0-9]~ is a numeric restriction of _123!
>>>> _123[0-9][0-9]~ is a numeric restriction of _123.
>>>>
>>>>
>>>
>>> Hi!
>>>     I'm sorry but I still doesn't understand, how doubling the last char can
>>> make "." from "!". The main difference between these two symbols are in the
>>> fact, that "!" makes IMMEDIATE match, while "." tries to collect more digits.
>>> The difference is visible on channels with overlap dialling support (like
>>> DAHDI, SCCP and even SIP under certain conditions). For example, when a
>>> pattern _123. is used and the number 123456 is received in overlap mode (like
>>> in SS7 IAM message), a timer is started to wait for more digits (possibly
>>> coming in SAM messages), and if 7, 8 and 9 comes later on, the real ${EXTEN}
>>> will be 123456789. Using pattern _123! and receiving a number 123456 doesn't
>>> start any timers, immediately executes the extension and its ${EXTEN} is,
>>> of course, 123456.
>>>     Please explain, how can your ~ equivalents of "." and "!" work with my
>>> examples above.
>>>     With regards, Pavel.
>>>



More information about the asterisk-dev mailing list