[sr-dev] Enum PV lookup

Juha Heinanen jh at tutpro.com
Sat Apr 3 08:24:08 CEST 2010


Vadim Lebedev writes:

 > >   Most of the time you want to route based on the RURI. On rare
 > >   occasions you may wish to route based on something else. The  
 > > function
 > >   enum_pv_query mimics the behavior of the enum_query function except
 > >   the E.164 number in its pseudo variable argument is used for the  
 > > enum
 > >   lookup instead of the user part of the RURI. Obviously the user part
 > >   of the RURI is still used in the NAPTR regexp.
 > 
 > Except that before trying to validate the pv as e164 number,  the  
 > function exit when user part of RURI
 > is not e164-compatible

based on the readme, that is what it should do, because "the user part
of the RURI is still used in the NAPTR regexp".  don't ask me why,
because i did not write that function.  it was provided by Greg Fausak
<lgfausak at gmail.com> and here is the original description:

  Most of the time you want to route based on the RURI. On rare
  occasions you may wish to route based on the user part of the
  "From:" tag, analogous to source based policy routing in the
  ip world. The function enum_fquery mimics the behaviour of the
  enum_query function except the user part of the "From:" is
  used for the enum lookup instead of the user part of the RURI.
  Obviously the user part of the RURI is still used in the naptr
  regexp.

i don't know if anyone is still using enum_pv_query.  if not, then it
could be changed to use the number in the pv also where the regex is
applied to.

what you can do in the meantime is assign your pv contents to $rU,
call normal enum_query and then revert_uri().

-- juha



More information about the sr-dev mailing list