[Serusers] aliases

Nils Ohlmeier nils at iptel.org
Fri Jan 5 19:24:39 CET 2007


As this might be interesting for other users I cc'ed the list again.

Just to be sure: you know that their is no alias table any more, right? Alias 
or not is just a matter of the flag value in the uri table.
 
In general there is no need any more for re-writting a request which was 
targeted towards an alias. Request towards an alias are handled exactly the 
same way as "normal" requests, because both will get the same UID value.

If you used the alias table for re-distributing the requests outside of your 
domain, which is actually more a forwarding function then an alias, then you 
could have this function as one (out of many) possible alternative(s) with 
AVPs like this:
(Note: non-tested pseudo code)

  lookup_user("$t.uid", "ruri");
  ...
  if ($t.uid) {
    load_attrs("$tu", "$t.uid");
    if ($t.forwarding_target) {
      attr2uri("$t.forwarding_target");
      t_relay();
    }
  }

Greetings
  Nils

On Friday 05 January 2007 17:27, you wrote:
> Thanks for the reply, Nils!  I suppose I am a more of a newbie than I first
> appeared as your answer is a little over my head.  What I am trying to do
> with the new version of SER is what used to be done (in previous versions)
> with
>
> If (lookup("aliases")){
> 	Route(1);
>
> To redirect users based on a few entries in the aliases table.  I won't be
> using the SER server as a registrar or to handle dynamic user locations or
> even authenticated accounts -- it will be open to the public without
> authentication to access SIP accessible numbers and users.  Mostly what I
> want to do is just to route calls that SER receives (like john at iptn.org,
> 5555555555 at iptn.org etc.) to the domain/uri that used to be accessed in the
> aliases table (openser worked this way too).
>
> Sorry for not explaining better and thanks again for your help!
>
> Eliott
>
>
> -----Original Message-----
> From: Nils Ohlmeier [mailto:nils at iptel.org]
> Sent: Friday, January 05, 2007 8:32 AM
> To: serusers at lists.iptel.org
> Cc: Eliott Spencer
> Subject: Re: [Serusers] aliases
>
> Hello,
>
> On Friday 05 January 2007 04:27, Eliott Spencer wrote:
> > I am coming over from OpenSER because I ran some tests and found SER to
> > be much faster.  There are some things that are new to me that I imagine
> > are easy to do.  I have a working config with the 12/22/06 development
>
> snapshot
>
> > of 0.10 but I would like to lookup aliases to redirect inbound calls to
> > another domain.  I filled in the domain table and the uri table with a
>
> user
>
> > and I looked through the sample config but can't seem to get it to work.
>
> I
>
> > have also loaded the domain module, then the uri module, then the avp and
> > avpops modules (among others).
> >
> >
> >
> > Any idea what I might need to put in my route?  This doesn't seem to work
> > (stolen from ser.cfg.sample):
> >
> >
> >
> >        if (lookup_user("$t.uid", "@ruri")) {
> >
> >               setflag(1);
> >
> >               route(1);
> >
> >               break;
> >
> >        };
>
> from looking at your code snipset I'm not sure what you really want to
> achieve.
> In general you should just do the lookup_user and then examine the AVPs
> afterwards. I think that it is easier then looking at the result code of
> the
>
> lookup_user function.
> If you really want to distingiush if the call was targeted to an alias or
> the
> non-alias URI of an user then check for the AVP ruri_canonical. If it is
> set
>
> (to the value 1) the URI contained the canonical (=non-alias) URI of the
> user.
> If you just want to know if the URI is a know one and belongs to a user,
> just
> check for the presence of the uid AVP after the lookup_user call. If it is
> present the user is know to the system under the value of the uid AVP.
> Otherwise the user/URI is not known to the system.
>
> Hope this helps
>   Nils



More information about the sr-users mailing list