[asterisk-dev] channel name uniqueness

Venefax venefax at gmail.com
Mon May 18 19:06:56 CDT 2009


Is this not a serious bug for us 64 bit users???
F.Alves

-----Original Message-----
From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of paul at glccom.com
Sent: Monday, May 18, 2009 6:39 PM
To: Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] channel name uniqueness

On Mon, 2009-05-18 at 16:18 -0500, Russell Bryant wrote:
> Paul Albrecht wrote:
> > On Mon, 2009-05-18 at 15:39 -0500, Russell Bryant wrote:
> >> Paul Albrecht wrote:
> >>> I have a question about the channel name. Specifically, is it
guaranteed
> >>> to be unique? The reason I'm asking is because sip channels use the
> >>> pointer to their private block in their channel name, but that only
> >>> ensures uniqueness if asterisk is compiled 32 bit.
> >> Channel names are not guaranteed to be unique throughout system
> >> lifetime.  There will (should!) never be more than one channel with the
> >> same name at the same time, though.
> >>
> >> The unique ID field on a channel is what uniquely identifies it from
> >> others that had the same name.  The unique ID field is a monotonically
> >> increasing integer, a timestamp, and optionally, a system name.
> >>
> > 
> > Hmmm, ... what about the "ASCII unique channel name", is it unique? For
> > sip channels, it's set in sip_new by calling ast_channel_alloc with
> > format string "SIP/%s-%08x", where the the string is a host address and
> > the number is a 32 bit pointer to the channel's private data pointer.
> 
> Right, so, that will be unique across _current_ channels.  However,
> after one channel is gone, it is conceivable that another with the same
> name will get created.
> 

The names of the active sip channels are guaranteed to be unique only if
asterisk data pointers are 32 bits, that is, asterisk is compiled on a
32 bit system. If, on the other hand, asterisk is compiled on a 64 bit
system, pointers are 64 bits so that a 32 bit data pointer is ambiguous
because heap is allocated both above and below 4 gigabytes.  

-- 
Paul Albrecht


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list