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

Dana Olson rickaster at gmail.com
Tue Mar 15 00:12:35 CET 2005


Thanks, I've already checked out those things. I've had to use an
external script to accomplish what I wanted, but it *sorta* works.

And the reply thing.. I blame Gmail. :)
--
Dana


On Mon, 14 Mar 2005 09:53:51 +0100, Klaus Darilion
<klaus.mailinglists at pernau.at> wrote:
> Hi Dana!
> 
> Also take a look at the following paramaters and fucntions from the
> registrar module:
> desc_time_order (integer)
> append_branches (integer)
> registered(domain)
> 
> regards,
> Klaus
> 
> PS: Please always send emails to the mailing list
> 
> Dana Olson 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




More information about the sr-users mailing list