[Serusers] lookup("...")

Jan Janak jan at iptel.org
Tue Apr 27 14:20:30 CEST 2004


There is does_uri_exist function in uri module. The function returns
true if username from the Request-URI exists in subscriber table and
false otherwise:

if (!lookup("location")) {
	if (does_uri_exist()) {
		sl_send_reply("480", "Temporarily Unavailable");
		break;
	} else {
		sl_send_reply("404", "Not Found");
		break;
	};
};

  Jan.

On 27-04 13:53, per.hubinette at cellip.com wrote:
> Atle,
> 
> Did you solve your problem?
> I have to be able to route calls to subscribers that aren't online (not in
> the location table). I still need to be sure they exist in the system.
> Conclusion I also need the lookup("subscirber") function to work. I don't
> like to have a user table as you stated the ugly hack would be. Because then
> you have to update two tables each time you add a new user to the system.
> 
> thanks
> -Per
> 
> ----- Original Message ----- 
> From: "Atle Samuelsen" <clona at camaro.no>
> To: <serusers at lists.iptel.org>
> Sent: Wednesday, April 14, 2004 7:21 PM
> Subject: [Serusers] lookup("...")
> 
> 
> >
> > Hey Guys (And most likely No girls :( )
> >
> >  I'v got this scenario now :
> >
> >  if a user does have voicemail everything is great!. No problems. Thou,
> >  my case is that I've got users who does not have a voicemail service,
> >  and may disconnect from my gw.
> >
> >  Then when a imcoming call coms, the "caller" get's a 404 (per today).
> >  So the way I want it to be is :
> >
> >   if (!lookup("location"){
> >         (lookup("subscirber"){
> >             log(1,"user's not online but does exist");
> >             sl_send_reply("404", "Not found,but exists");
> >             break;
> >          }
> >          log(1,"404 , user not found");
> >          sl_send_reply("404","Not found");
> >          break;
> >   }
> >
> >   If I do it like this,the !lookup("subscriber") will fail, because it
> >   cant do this.
> >   How can I get this to work ?
> >
> >   I see 2 difrent way's of doing it.
> >
> >   1: Create a database with the name users, and dump all my users from
> >   this into that database,, then have the same structure etc as I have
> >   in the locations database..
> >   .. As far as I see , this will be a ugly hack.
> >
> >   2: make a new function for this ..
> >
> >
> >   How and what do you guys mean ?
> >
> >
> >   Thanks for a quick answer :)
> >   You guys are REALLY helpful both night and day.
> >   - Atle
> >
> >
> > _______________________________________________
> > Serusers mailing list
> > serusers at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
> >
> >
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list