aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_zap.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-06 19:17:21 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-06 19:17:21 +0000
commite98507dd4f5dd23299abedea55e69221cc454760 (patch)
tree96ae7b96885a0fa625683e9f7140baf932f396d2 /channels/chan_zap.c
parent0d2814ae15531a6de8de485cdf9075f70c7f0de7 (diff)
Correctly choose end of number (i.e. if it ends in 'w' with nothing following)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5430 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_zap.c')
-rwxr-xr-xchannels/chan_zap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 2926fc342..86f2cd026 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -57,7 +57,7 @@
#include <ctype.h>
#ifdef ZAPATA_PRI
#include <libpri.h>
-#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;