dect
/
asterisk
Archived
13
0
Fork 0

Don't require "c" before CRV syntax

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3155 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2004-06-06 08:52:24 +00:00
parent 7869a07656
commit 1858dc748b
1 changed files with 24 additions and 28 deletions

View File

@ -6109,33 +6109,6 @@ static struct ast_channel *zt_request(char *type, int format, void *data)
ast_log(LOG_WARNING, "Channel requested with no data\n");
return NULL;
}
#ifdef ZAPATA_PRI
if (dest[0] == 'c') {
/* This is requesting a specific CRV. The format after the C is trunkgroup:CRV, so grab them */
/* Retrieve the group number */
char *stringp=NULL;
stringp=dest + 1;
s = strsep(&stringp, "/");
if (((res = sscanf(s, "%d:%d%c%d", &trunkgroup, &crv, &opt, &y)) < 2) || (trunkgroup < 1) || (crv < 1)) {
ast_log(LOG_WARNING, "Unable to determine trunk group and CRV for data %s\n", (char *)data);
return NULL;
}
res--;
for (x=0;x<NUM_SPANS;x++) {
if (pris[x].trunkgroup == trunkgroup) {
pri = pris + x;
lock = &pri->lock;
break;
}
}
if (!pri) {
ast_log(LOG_WARNING, "Unable to find trunk group %d\n", trunkgroup);
return NULL;
}
channelmatch = crv;
p = pris[x].crvs;
} else
#endif
if (toupper(dest[0]) == 'G' || toupper(dest[0])=='R') {
/* Retrieve the group number */
char *stringp=NULL;
@ -6172,7 +6145,30 @@ static struct ast_channel *zt_request(char *type, int format, void *data)
if (!strcasecmp(s, "pseudo")) {
/* Special case for pseudo */
x = CHAN_PSEUDO;
} else if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) {
}
#ifdef ZAPATA_PRI
else if ((res = sscanf(s, "%d:%d%c%d", &trunkgroup, &crv, &opt, &y)) > 1) {
if ((trunkgroup < 1) || (crv < 1)) {
ast_log(LOG_WARNING, "Unable to determine trunk group and CRV for data %s\n", (char *)data);
return NULL;
}
res--;
for (x=0;x<NUM_SPANS;x++) {
if (pris[x].trunkgroup == trunkgroup) {
pri = pris + x;
lock = &pri->lock;
break;
}
}
if (!pri) {
ast_log(LOG_WARNING, "Unable to find trunk group %d\n", trunkgroup);
return NULL;
}
channelmatch = crv;
p = pris[x].crvs;
}
#endif
else if ((res = sscanf(s, "%d%c%d", &x, &opt, &y)) < 1) {
ast_log(LOG_WARNING, "Unable to determine channel for data %s\n", (char *)data);
return NULL;
}