< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] Querying for a registered party?


Stuart:

You didn't quite answer Scott's question about whether you're using DUM or doing something else. I'll assume that you're using DUM.

Keep in mind that the SIP registration operation isn't simply registering a device -- it's associating a device with a user's Address of Record (AOR). The AOR is, in rough terms, the SIP address someone would put on their business card.

If you're using DUM and want to act as a registrar, you set up a ServerRegistrationHandler using setServerRegistrationHandler, and then add a RegistrationPersistenceManager with setRegistrationPersistenceManager.

But if you're using DUM and have registrations working, then you're already doing that. Dig through the example code you used, and find the setRegistrationPersistenceManager call.

You need to keep a pointer to the RegistrationPersistenceManager you've created (probably an InMemoryRegistrationDatabase if you're following example code you found somewhere) for your application to query later.

Once you've done that, you can call getContacts(aor) to get the devices currently registered for an AOR. Or, if you need to get a list of all the registered AORs, you can call getAors() (but be careful with getAors; it is not synchronized, so you cannot safely call it except from within the DUM thread).

Also take note that the InMemoryRegistrationDatabase is really more appropriate for testing and small-scale use. It's not designed for use in commercial-grade products. Among other things, it doesn't delete expired contacts for an AOR until the next time that AOR is accessed (the behavior is correct, but the memory remains in use).

/a

P.S. The SIP/digital radio bridge application sounds really neat! If you have more information on your project, we'd love to hear about it.

Stuart Whelan wrote:
Hi Scott,

Thanks for the reply!

I have an application that is taking on several roles, the appliaction itself is acting as a gateway between two VoIP solutions, one sip based and another is a digital radio.

Firstly the application is a registrar, other sip devices are expected to register with it.

The application keeps its own database of radio terminals, and provides a uas endpoint for the terminals.

If a sip device wishes to call a radio then the application answers the sip invite, authenticates, negotiates the sdp,connects the call, pulls the terminal onto the right radio channel and transcodes the rtp packets into terminal audio.

This is all good, and all working. I have calls setting up and tearing down and the audio flows nicely.

The other way is a little trickier.

If a terminal dials a sip device the application knows the called is a sip device and needs to pull out the registration information from the registrar so it can create an invite session to the correct IP and port to contact the sip device.

After about 3 days of reading through the resip code and playing around with different ideas I can not work out how to extract the registration information for the sip device.

I am sure I am missing something pretty fundamental, but I can not for the life of me work it out..

Cheers,
Stuart.

On Mon, Aug 24, 2009 at 1:16 PM, Scott Godin <sgodin@xxxxxxxxxxxxxxx <mailto:sgodin@xxxxxxxxxxxxxxx>> wrote:

    Hi Stuart,

    Can you explain in more detail what you are trying to achieve?  Are
    you using repro, or are you implementing a registration server using
    DUM?  A client will become aware of it's other registered endpoints as
    soon as it registers.  The 200 response will contain a list of all the
    contacts for the registered AOR.  Or perhaps you are looking for an
    implementation of the Register event package
    (http://www.faqs.org/rfcs/rfc3680.html)?  If so - this is not
    currently implemented in DUM, but I think it would be possible to
    build it on top of DUM.  An review of
    repro/monkeys/LocationServer.hxx/cxx should help with this.

    Scott

    On Sun, Aug 23, 2009 at 6:12 PM, Stuart
    Whelan<stuart@xxxxxxxxxxxxxxxxxxxxxxxxxx
    <mailto:stuart@xxxxxxxxxxxxxxxxxxxxxxxxxx>> wrote:
    > I can see many examples of how to setup a register server and how to
    > register, and have that part of my application working fine.
    >
    > I am unable to work out how to retrieve those registrations from
    either a
    > client or from the registration server.
    >
    > Can anyone point me in the direction that I am missing?
    >
    > Cheers,
    > Stuart.
    >
    > _______________________________________________
    > resiprocate-users mailing list
    > resiprocate-users@xxxxxxxxxxxxxxx
    <mailto:resiprocate-users@xxxxxxxxxxxxxxx>
    > List Archive: http://list.resiprocate.org/archive/resiprocate-users/
    >


------------------------------------------------------------------------

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/