[Users] username prefixes

Mark Kent mark at noc.mainstreet.net
Wed Jul 19 21:45:21 CEST 2006


I'm looking for opinions from people who may have already done 
something like this:

Suppose I've got some entries in the location table that I want the
whole world to get to, and some locations that I want only authorized
users to get to.  Some of these locations have $resources$ attached,
but even so they aren't hard-coded in my config, they register just
like JoeUser on a SIP phone.

I'm thinking of handling this with a prefix on the username, 
like auth.foobar vs foobar, like this:

  if (!uri=~"^sip:auth\.") {
     log(1,"---not auth destination\n");
     if (lookup("location")) {
        append_hf("P-hint: non-auth usrloc\r\n");
        route(1);
     }
  }

  # rest of stuff requires authorization

  if (!proxy_authorize("", "subscriber")) {
     proxy_challenge("", "0");
     return;
  }
  consume_credentials();

  <snip rest of INVITE handling>

Is this naive, stupid, already handled in XYZ, or reasonable?

Thanks,
-mark




More information about the sr-users mailing list