[SR-Users] Using =~ to get the group identifier with longest match

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 6 10:53:35 CEST 2011


Hello,

On 6/6/11 10:39 AM, Iñaki Baz Castillo wrote:
> 2011/6/6 Daniel-Constantin Mierla<miconda at gmail.com>:
>> one option that comes in my mind is to break it in several if conditions,
>> matching one group at a time, written in the order of preferences.
> The problem is that it would require perform N regular expression
> matching and such expressions will be very long (all the country
> prefixes in the world). The main problem is that some groups would
> contain prefixes starting with, for example, 12, while in other group
> there is the prefix 1 (an the very same in multiple cases, so doing it
> manually would be too much manual work and any change in the world
> would require hard modifications).
>
> I'm evaluating building a custom function for this purpose.
maybe dialplan module could give you a solution -- you can play with 
priorities for matching rules.

Cheers,
Daniel
-- 
Daniel-Constantin Mierla -- http://www.asipto.com
http://linkedin.com/in/miconda -- http://twitter.com/miconda




More information about the sr-users mailing list