return 0;
}
-unsigned int ast_get_group(char *s)
+ast_group_t ast_get_group(char *s)
{
char *copy;
char *piece;
char *c=NULL;
int start=0, finish=0,x;
- unsigned int group = 0;
+ ast_group_t group = 0;
copy = ast_strdupa(s);
if (!copy) {
ast_log(LOG_ERROR, "Out of memory\n");
continue;
}
for (x=start;x<=finish;x++) {
- if ((x > 31) || (x < 0)) {
- ast_log(LOG_WARNING, "Ignoring invalid group %d (maximum group is 31)\n", x);
+ if ((x > 63) || (x < 0)) {
+ ast_log(LOG_WARNING, "Ignoring invalid group %d (maximum group is 63)\n", x);
} else
group |= (1 << x);
}
{
ast_cli_register(&cli_show_channeltypes);
}
+
+/*--- ast_print_group: Print call group and pickup group ---*/
+char *ast_print_group(char *buf, int buflen, ast_group_t group)
+{
+ unsigned int i;
+ int first=1;
+ char num[3];
+
+ buf[0] = '\0';
+
+ if (!group) /* Return empty string if no group */
+ return(buf);
+
+ for (i=0; i<=63; i++) { /* Max group is 63 */
+ if (group & (1 << i)) {
+ if (!first) {
+ strncat(buf, ", ", buflen);
+ } else {
+ first=0;
+ }
+ snprintf(num, sizeof(num), "%u", i);
+ strncat(buf, num, buflen);
+ }
+ }
+ return(buf);
+}
static int capability = -1;
-static unsigned int group;
+static ast_group_t group;
static int autologoff;
static int wrapuptime;
static int ackcall;
time_t start; /* When call started */
struct timeval lastdisc; /* When last disconnected */
int wrapuptime; /* Wrapup time in ms */
- unsigned int group; /* Group memberships */
+ ast_group_t group; /* Group memberships */
int acknowledged; /* Acknowledged */
char moh[80]; /* Which music on hold */
char agent[AST_MAX_AGENT]; /* Agent ID */
struct agent_pvt *p;
struct ast_channel *chan = NULL;
char *s;
- unsigned int groupmatch;
+ ast_group_t groupmatch;
int waitforagent=0;
int hasagent = 0;
struct timeval tv;
{
struct agent_pvt *p;
char *s;
- unsigned int groupmatch;
+ ast_group_t groupmatch;
int waitforagent=0;
int res = AST_DEVICE_INVALID;
/*static int cur_signalling = -1;*/
/*static unsigned int cur_group = 0;*/
-static unsigned int cur_callergroup = 0;
-static unsigned int cur_pickupgroup = 0;
+static ast_group_t cur_callergroup = 0;
+static ast_group_t cur_pickupgroup = 0;
/* XXX Is this needed? */
/* Doesn't look like the dsp stuff for */
char mailbox[AST_MAX_EXTENSION];
char musicclass[MAX_LANGUAGE];
char curtone[80]; /* Current tone */
- unsigned int callgroup;
- unsigned int pickupgroup;
+ ast_group_t callgroup;
+ ast_group_t pickupgroup;
int callwaiting;
int transfer;
int threewaycalling;
static char outgoingmsn[AST_MAX_EXTENSION]="";
/* Default group */
-static unsigned int cur_group = 0;
+static ast_group_t cur_group = 0;
static int usecnt =0;
struct ast_modem_pvt *p;
struct ast_channel *tmp = NULL;
char dev[80];
- unsigned int group = 0;
+ ast_group_t group = 0;
char *stringp=NULL;
strncpy(dev, (char *)data, sizeof(dev)-1);
stringp=dev;
return tmp;
}
-static unsigned int get_group(char *s)
+static ast_group_t get_group(char *s)
{
char *piece;
int start, finish,x;
- unsigned int group = 0;
+ ast_group_t group = 0;
char *copy = ast_strdupa(s);
char *stringp=NULL;
if (!copy) {
piece = strsep(&stringp, ",");
for (x=start;x<=finish;x++) {
- if ((x > 31) || (x < 0)) {
+ if ((x > 63) || (x < 0)) {
ast_log(LOG_WARNING, "Ignoring invalid group %d\n", x);
break;
}
struct ast_codec_pref prefs; /* codec prefs */
unsigned int ocseq; /* Current outgoing seqno */
unsigned int icseq; /* Current incoming seqno */
- unsigned int callgroup; /* Call group */
- unsigned int pickupgroup; /* Pickup group */
+ ast_group_t callgroup; /* Call group */
+ ast_group_t pickupgroup; /* Pickup group */
int lastinvite; /* Last Cseq of invite */
unsigned int flags; /* SIP_ flags */
int capability; /* Special capability (codec) */
char musicclass[MAX_LANGUAGE]; /* Music on Hold class */
char useragent[256]; /* User agent in SIP request */
struct ast_codec_pref prefs; /* codec prefs */
- unsigned int callgroup; /* Call group */
- unsigned int pickupgroup; /* Pickup Group */
+ ast_group_t callgroup; /* Call group */
+ ast_group_t pickupgroup; /* Pickup Group */
unsigned int flags; /* SIP_ flags */
int amaflags; /* AMA flags for billing */
int callingpres; /* Calling id presentation */
int rtptimeout;
int rtpholdtimeout;
int rtpkeepalive; /* Send RTP packets for keepalive */
- unsigned int callgroup; /* Call group */
- unsigned int pickupgroup; /* Pickup group */
+ ast_group_t callgroup; /* Call group */
+ ast_group_t pickupgroup; /* Pickup group */
struct sockaddr_in addr; /* IP address of peer */
struct in_addr mask;
static char cid_name[AST_MAX_EXTENSION] = "";
static char linelabel[AST_MAX_EXTENSION] ="";
static int nat = 0;
-static unsigned int cur_callergroup = 0;
-static unsigned int cur_pickupgroup = 0;
+static ast_group_t cur_callergroup = 0;
+static ast_group_t cur_pickupgroup = 0;
static int immediate = 0;
static int callwaiting = 0;
static int callreturn = 0;
char mailbox[AST_MAX_EXTENSION];
char musicclass[MAX_LANGUAGE];
int curtone; /* Current tone being played */
- unsigned int callgroup;
- unsigned int pickupgroup;
+ ast_group_t callgroup;
+ ast_group_t pickupgroup;
int callwaiting;
int transfer;
int threewaycalling;
static int zaptrcallerid = 0;
static int cur_signalling = -1;
-static unsigned int cur_group = 0;
-static unsigned int cur_callergroup = 0;
-static unsigned int cur_pickupgroup = 0;
+static ast_group_t cur_group = 0;
+static ast_group_t cur_callergroup = 0;
+static ast_group_t cur_pickupgroup = 0;
static int relaxdtmf = 0;
static int immediate = 0;
int confno; /* Our conference */
int confusers; /* Who is using our conference */
int propconfno; /* Propagated conference number */
- unsigned int callgroup;
- unsigned int pickupgroup;
+ ast_group_t callgroup;
+ ast_group_t pickupgroup;
int immediate; /* Answer before getting digits? */
int channel; /* Channel Number or CRV */
int span; /* Span number */
#define AST_MAX_FDS 8
+typedef unsigned long long ast_group_t;
+
struct ast_generator {
void *(*alloc)(struct ast_channel *chan, void *params);
void (*release)(struct ast_channel *chan, void *data);
ast_set_flag(c, AST_FLAG_BLOCKING); \
} }
-extern unsigned int ast_get_group(char *s);
+extern ast_group_t ast_get_group(char *s);
+/* print call- and pickup groups into buffer */
+extern char *ast_print_group(char *buf, int buflen, ast_group_t group);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
extern char *ast_strcasestr(const char *, const char *);
#endif
-
-/* print call- and pickup groups into buffer */
-char *ast_print_group(char *buf, int buflen, unsigned int group);
/*! Multiple Subscriber Number we accept for outgoing calls (; seperated list) */
char outgoingmsn[AST_MAX_EXTENSION];
/*! Group(s) we belong to if available */
- unsigned int group;
+ ast_group_t group;
/*! Caller ID if available */
char cid_name[AST_MAX_EXTENSION];
/*! Caller ID if available */
}
}
#endif
-
-
-/*--- ast_print_group: Print call group and pickup group ---*/
-char *ast_print_group(char *buf, int buflen, unsigned int group)
-{
- unsigned int i;
- int first=1;
- char num[3];
-
- buf[0] = '\0';
-
- if (!group) /* Return empty string if no group */
- return(buf);
-
- for (i=0; i<=31; i++) { /* Max group is 31 */
- if (group & (1 << i)) {
- if (!first) {
- strncat(buf, ", ", buflen);
- } else {
- first=0;
- }
- snprintf(num, sizeof(num), "%u", i);
- strncat(buf, num, buflen);
- }
- }
- return(buf);
-}