[Home]

Summary:ASTERISK-03281: [patch] increase group number limitation
Reporter:paradise (paradise)Labels:
Date Opened:2005-01-15 10:05:11.000-0600Date Closed:2008-01-15 15:21:52.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) configsdiff.txt
( 1) mydiff.txt
( 2) mydiff2.txt
Description:This patch increases group number limitation from 31 to 63.


****** ADDITIONAL INFORMATION ******

all i've done is to change the group type from "unsigned int" to "unsigned long long" and some minor changes in code.
Comments:By: paradise (paradise) 2005-01-15 10:11:34.000-0600

sorry about CVS date my box time is wrong.
btw, this patch is applied to CVS-HEAD-01/15/05.

By: Mark Spencer (markster) 2005-01-15 10:52:27.000-0600

I'm not sure unsigned long long will always be 64-bits on all systems.  I recommend typedef unsigned long long ast_group_t in channel.h and in all function prototypes and channel declarations, so we can fix it in one place if that is the case.  Please update accordingly.  Thanks!

By: paradise (paradise) 2005-01-15 11:31:00.000-0600

agree, it's a better way.
but i've noticed that utils.c and utils.h does not use channel.h

edited on: 01-15-05 11:31

By: Mark Spencer (markster) 2005-01-15 11:44:29.000-0600

Okay so we include channel.h into utils.h or similar?

By: Kevin P. Fleming (kpfleming) 2005-01-15 11:59:55.000-0600

How about creating include/asterisk/types.h, and moving all the simple type definitions to there?

By: Mark Spencer (markster) 2005-01-15 12:37:17.000-0600

I'm not sure that's a big win, but I won't fight it, as long as users don't have to remember to include it directly.

By: paradise (paradise) 2005-01-15 13:08:57.000-0600

OK, it's done now.

By: Kevin P. Fleming (kpfleming) 2005-01-15 13:58:57.000-0600

OK, I've got a question: if the only place that callgroup and pickupgroup are defined is in channel.h, why is ast_print_group in utils.h? There's no way that it's useful with also including channel.h, so in my opinion the simpler fix is to just move it there and not add channel.h to utils.h.

By: paradise (paradise) 2005-01-15 14:21:46.000-0600

just had a search in the source and found that where ever utils.h is included channels.h is also there, except config.c and pbx/dundi-parser.c which don't use ast_print_group. so just moving ast_print_group to channel.h and channel.c will do the job and seems to be more logical.

By: paradise (paradise) 2005-01-15 15:08:43.000-0600

i'm going to finish this patch, but another idea came:
according to what mark said "I'm not sure unsigned long long will always be 64-bits on all systems" i suppose that creating a static variable called ast_group_t_size in channel.h:

static int ast_group_t_size = sizeof(ast_group_t)*8-1;

and using it in the code for conditions, loops, message,... related to group number will solve the problem of group number limitation on any system and makes it more dynamic and accurate.

edited on: 01-15-05 15:09

By: Kevin P. Fleming (kpfleming) 2005-01-15 15:17:15.000-0600

You can also just use a standard C type like uint64_t or something to guarantee that it will always be 64 bits.

By: Mark Spencer (markster) 2005-01-15 15:47:40.000-0600

Fixed in CVS with modifications.

By: paradise (paradise) 2005-01-15 16:08:59.000-0600

added a diff file to modify zapata.conf.sample and modem.conf.sample
with right comments about group numbers.

and may these changes commited to CVS Stable?

thanks!

edited on: 01-15-05 16:24

By: Mark Spencer (markster) 2005-01-15 16:56:06.000-0600

Fixed

By: Russell Bryant (russell) 2005-01-17 16:41:37.000-0600

Since this isn't really a bug, and my time is pretty limited, I'm going to leave this out of 1.0 unless you want to make a 1.0 specific patch.

By: Digium Subversion (svnbot) 2008-01-15 15:21:52.000-0600

Repository: asterisk
Revision: 4803

U   trunk/channel.c
U   trunk/channels/chan_agent.c
U   trunk/channels/chan_mgcp.c
U   trunk/channels/chan_modem.c
U   trunk/channels/chan_sip.c
U   trunk/channels/chan_skinny.c
U   trunk/channels/chan_zap.c
U   trunk/include/asterisk/channel.h
U   trunk/include/asterisk/utils.h
U   trunk/include/asterisk/vmodem.h
U   trunk/utils.c

------------------------------------------------------------------------
r4803 | markster | 2008-01-15 15:21:51 -0600 (Tue, 15 Jan 2008) | 2 lines

Make groups be 64-bits (bug ASTERISK-3281, with mods)

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

http://svn.digium.com/view/asterisk?view=rev&revision=4803