[Serusers] how can I look up the username in the location table?

Dana Olson rickaster at gmail.com
Fri Mar 11 15:53:57 CET 2005


Am I right in thinking that the avpops stuff is only in CVS currently?
It's not in /usr/lib/ser/modules/ for 0.8.14 anyhow, and Google seems
to only show me results for CVS commits and a couple discussions on
the mailing list.

I tried using both check_from() and check_to(), and I tried setting
the modparams like so:

modparam("uri", "uri_table", "location")
modparam("uri", "uri_user_column", "username")
modparam("uri", "uri_uriuser_column", "username")
modparam("uri", "subscriber_table", "location")

I thought that if I did this, it would look in the location table, and
if it saw that the user trying to register in the To or From lines
were in the location table, then it would return true, and allow me to
check that way, but it didn't work either. Perhaps my understanding of
how this module works is incorrect, I don't know.

In any case, I don't really see much of an option now except to wait
for 0.9 or to move to it now, before it's actually released. Neither
of these are options that I can use though.

Perhaps I can run an external script using exec_dset to set the URI to
the To or From addresses? I don't really like the idea of leaving the
SER routing script, but if it's the only way, then I may have to. Do
you think this is my only alternative, or am I overlooking something
else?

--
Dana



On Fri, 11 Mar 2005 09:43:52 -0500, Dana Olson <rickaster at gmail.com> wrote:
> Thanks for your reply. I wasn't sure about the URI and the To/From
> thing. I looked at the packet and when you register, the username is
> in both To and From. I guess I mistook the URI for that or something.
> Thanks for your clarification on that.
> 
> I'm trying to limit the number of people using each username to a
> single person at a time. I read the mailing list of people trying to
> do this before me, and everyone, including Jiri, didn't understand why
> someone would want this.
> 
> Well, I have a bunch inbound agents logging into my SER proxy with
> softphones, receiving calls from an AudioCodes Mediant 2000 (T1 <->
> SIP) that is getting calls from an Avaya PBX. These inbound calls have
> to go to whoever is logged in as that agent name, and only to them. We
> can't have multiple people logged into the same name, because each
> name corresponds to a certain phone number on the Avaya PBX. I hope
> this makes sense. It's not really a normal SIP application in this
> sense, which is why I need to remove the ability of a normal SIP
> application.
> 
> I'm using the latest stable release of SER, and can't be putting
> anything less into production. I know that the next release has the
> max_contacts option, but until it goes stable, I don't have a green
> light to use it.
> 
> I'll look into the avpops module, as I haven't really heard of it until now.
> 
> --
> Dana
> 
> On Fri, 11 Mar 2005 09:00:36 +0100, Klaus Darilion
> <klaus.mailinglists at pernau.at> wrote:
> > Hi!
> >
> > Lookup takes the request URI und looks up the location table. In
> > REGISTER messages, the address-of-record is in the To: header.
> > Therefore, lookup() will fail always.
> >
> > Maybe you can overcome this by copying the To: URI into an AVP and then
> > copying this AVP into the request URI. (avpops module).
> >
> > Btw: Why do you need this feature?
> >
> > regards,
> > klaus
> >
> > Dana Olson wrote:
> > > I want to look up the username in the location table during the
> > > method==register if block.
> > >
> > > The reason I wish to do this is to see if there is another location
> > > currently registered in the database for this particular username. How
> > > can I do this? Do I have to use exec_msg() or exec_dset(), or does
> > > lookup() work?
> > >
> > > I've tried lookup("location") but it failed to work, it seems.
> > >
> > > Can anyone help me out? Here is the block of code that I'm trying to use:
> > >
> > >         if (method=="REGISTER") {
> > >                 if (!search("^Expires: 0")) {
> > >                         if (lookup("location")) {
> > >                                 sl_send_reply("200","Another registration.");
> > >                         } else {
> > >                                 sl_send_reply("200", "First registration.");
> > >                         }
> > >                 } else {
> > >                         sl_send_reply("200", "Unregistration.");
> > >                 }
> > >                 save_noreply("location");
> > >                 break;
> > >         }
> > >
> > > Note that it is sending the proper replies for "First registrations"
> > > and "Unregistrations," but not for "Another registrations."
> > >
> > > Thanks in advance,
> > >
> > > Dana
> > >
> > > _______________________________________________
> > > Serusers mailing list
> > > serusers at lists.iptel.org
> > > http://lists.iptel.org/mailman/listinfo/serusers
> > >
> > >
> >
> >
>




More information about the sr-users mailing list