[SR-Users] Simple look table

Alex Balashov abalashov at evaristesys.com
Tue Mar 5 13:03:00 CET 2013


Your best bet is a database-backed 'htable'.  Take a look at the 
'htable' module.

On 03/05/2013 05:21 AM, Gareth Rylance wrote:

> Is it possible to have a custom look-up table to map ids to other ids in
> the configuration file?
>
> E.G.
> TestLookValues
> key | value
> 1 |100
> 2 | 100
> 3 | 600
>
>
> lookup("TestLookValues", "3")
>
> gives $var(lookupval) equal to 600
>
> It is similar to MTree functionality only I am looking for an exact
> match not just a prefix
>
> TestLookValues
> prefix | value
> 1 |100
> 2 | 100
> 3 | 600
>
> mt_match("TestLookValues", "3003)", "0")
>
> gives $var(mtval) = 600
>
> I would need  $var(mtval) = -1  (not found)
>
> Thanks Gareth
>
>
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>


-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-users mailing list