[SR-Users] Partial/regex match on hash table key?

Dmitri Savolainen savolainen at erinaco.ru
Wed Jan 31 23:52:02 CET 2018


Hi, Anthony
Masks are not possible for getting values. But sometimes "array" approach
may be usefull

    $var(i) = 0;
    $var(cache_mask) = "slice_a";
    $var(cache_size) = $sht(mycache=>$var(cache_mask)::size);
    while( $var(i) < $var(cache_size) ){
        # do smth with $sht(mycache=>$var(cache_mask)[$var(i)])
        $var(i) = $var(i) + 1;
    }


2018-01-31 21:36 GMT+03:00 Anthony Joseph Messina <amessina at messinet.com>:

> Is is possible (without iterating through all entries in a hash table) to
> return the value based on a partial or regex match to the key?
>
> Something like...
> $var(one)=$sht(a=>*$var(two))
>
> --
> Anthony - https://messinet.com/ - https://messinet.com/~amessina/gallery
> F9B6 560E 68EA 037D 8C3D  D1C9 FF31 3BDB D9D8 99B6
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>


-- 
Savolainen Dmitri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180201/1751fc97/attachment.html>


More information about the sr-users mailing list