From: Mark Spencer Date: Wed, 6 Apr 2005 19:17:21 +0000 (+0000) Subject: Correctly choose end of number (i.e. if it ends in 'w' with nothing following) X-Git-Tag: 1.2.0-beta1~878 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a7230de79afa2e8afc74c2bf6026268f572af6fa;p=thirdparty%2Fasterisk.git Correctly choose end of number (i.e. if it ends in 'w' with nothing following) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5430 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 2926fc3421..86f2cd0260 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -57,7 +57,7 @@ #include #ifdef ZAPATA_PRI #include -#ifndef PRI_REDIRECTING_REASON +#ifndef PRI_AOC_UNITS #error "You need newer libpri" #endif #endif @@ -1835,11 +1835,12 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout) p->dop.op = ZT_DIAL_OP_REPLACE; s = strchr(c + p->stripmsd, 'w'); if (s) { - if (strlen(s)) + if (strlen(s) > 1) snprintf(p->dop.dialstr, sizeof(p->dop.dialstr), "T%s", s); else p->dop.dialstr[0] = '\0'; *s = '\0'; + s++; } else { p->dop.dialstr[0] = '\0'; } @@ -1889,7 +1890,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout) pridialplan = PRI_LOCAL_ISDN; } } - pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, s ? 1 : 0); + pri_sr_set_called(sr, c + p->stripmsd + dp_strip, pridialplan, (s && *s) ? 1 : 0); ldp_strip = 0; prilocaldialplan = p->pri->localdialplan - 1;