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