From: Mark Spencer Date: Sun, 6 Jun 2004 08:52:24 +0000 (+0000) Subject: Don't require "c" before CRV syntax X-Git-Tag: 1.0.0-rc1~300 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65d5921ddee92d29273ef28868e21c206eecbf29;p=thirdparty%2Fasterisk.git Don't require "c" before CRV syntax git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3155 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index c9e153cf7d..07e4062dd4 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -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;xlock; - 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;xlock; + 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; }