[Asterisk-Dev] Channel registry question

Derek Bruce dbruce at calgarytelecom.com
Thu Mar 4 14:14:02 MST 2004


Stephen: I understand your point, and agree with it.

The problem I see however, it that some people will install a client on a
desktop computer and a laptop computer... They leave the desktop on all the
time, and the client is registered to Asterisk... then they run the client
on the laptop and it registers and works... then the desktop client
reregisters and the client on the laptop is orphaned...

My solution is to extend the chan_sip driver... add a list of "clients"...
so now there are users, peers and clients... If I have a phone that needs to
have "hot backup" I can configure it as a user or peer as appropriate... If
I have a client that roams, I configure it as a client...

The difference between a user/peer and a client... the client list tracks
the REGISTER by  IP address and port. Once a UA registers, any subsequent
REGISTER requests for that UA's 'account' are rejected unless the ip address
and port (as well as authentication credentials) match. Once the original
registered UA sends a deREGISTER request (don't know what else to call a
REGISTER with a zero expiry 8-} ), then other clients can register. If the
original UA dies... their entry in the client list is removed when their
registration expires.

I also extended the chan_sip code so that unregistered clients can't process
calls... the original chan_sip will process calls from a UA as long as it's
credentials are valid. This didn't work for me... I only want Asterisk to
process requests from registered clients.

I've been testing it for a number of weeks and it seems to solve the problem
nicely. I'm not ready to post the diffs on bugs.digium.com yet... this code
is very crudely hacked into the existing chan_sip code and needs to be
cleaned up first (it's doesn't patch nicely to the current CVS code). BUT,
if anyone wants to try it out, i'll be happy to pass along the full copy of
my chan_sip.

Derek Bruce
Calgary Telecom
dbruce at calgarytelecom.com

----- Original Message -----
From: "Steven Critchfield" <critch at basesys.com>
To: <asterisk-dev at lists.digium.com>
Sent: Thursday, March 04, 2004 1:37 PM
Subject: Re: [Asterisk-Dev] Channel registry question


> On Thu, 2004-03-04 at 10:41, Steven Sokol wrote:
> > I have noticed that, given two IAX2 devices registering to my asterisk
box
> > with the same credentials, the most recently registered device becomes
the
> > endpoint for calls directed to that IAX2 channel.
>
> > Could we, without breaking anything, alter the registry process to 1)
allow
> > for multiple registered devices for a given channel, or 2) by rejecting
> > registrations from a device while another device is registered with the
same
> > credentials or 3) by de-registering the "older" of the two
registrations,
> > and sending the device being de-registered a "you just got logged out
> > because you logged in elsewhere" response that will cause it to stop
trying
> > to register.
>
> Rejecting new registrations in my opinion is bad. Take the case of a
> machine being moved around on a DHCP lease, you would want it to come
> back up as quickly as possible. Take the case of a hot spare configured
> to take over if it notices the primary goes offline. We want these to
> take over quickly and not wait for some timeout function to say the old
> registration is no longer active.
>
> The best bet would be some form of deregister with ack, but what if it
> is used as an attack. You could forge a dereg packet and send it down to
> a machine in an effort to make them no longer get calls. When would the
> dereg'ed machine know to reconnect and try again.
>
> This all basically points out that you should be a decent admin when
> working on configs.
>
> > Should this be written up as a bug, or a request for a feature?
>
> I'm not sure it is either.
> --
> Steven Critchfield  <critch at basesys.com>
>
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list