aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_dial.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-15 20:20:21 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-01-15 20:20:21 +0000
commit19db091314243f1cefa88064ea8c12a1c109e3d5 (patch)
tree10f72a624d9c8c26bad0163393f19392ad9ea998 /apps/app_dial.c
parente75815a644605f3c25238d082751fb237d4e3978 (diff)
X out announce stuff (bug #760)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2039 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_dial.c')
-rwxr-xr-xapps/app_dial.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 06073c2fd..812944c6f 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -347,7 +347,6 @@ static int dial_exec(struct ast_channel *chan, void *data)
int privacy=0;
int announce=0;
int resetcdr=0;
- int cnt=0;
char numsubst[AST_MAX_EXTENSION];
char restofit[AST_MAX_EXTENSION];
char *transfer = NULL;
@@ -397,6 +396,24 @@ static int dial_exec(struct ast_channel *chan, void *data)
if (transfer) {
+ /* XXX ANNOUNCE SUPPORT */
+ if ((ann = strstr(transfer, "A("))) {
+ announce = 1;
+ strncpy(announcemsg, ann + 2, sizeof(announcemsg) - 1);
+ /* Overwrite with X's what was the announce info */
+ while(*ann && (*ann != ')'))
+ *(ann++) = 'X';
+ if (*ann)
+ *ann = 'X';
+ /* Now find the end of the privdb */
+ ann = strchr(announcemsg, ')');
+ if (ann)
+ *ann = '\0';
+ else {
+ ast_log(LOG_WARNING, "Transfer with Announce spec lacking trailing ')'\n");
+ announce = 0;
+ }
+ }
/* Extract privacy info from transfer */
if ((s = strstr(transfer, "P("))) {
privacy = 1;
@@ -411,7 +428,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
if (s)
*s = '\0';
else {
- ast_log(LOG_WARNING, "Transfer with privacy lacking trailing '('\n");
+ ast_log(LOG_WARNING, "Transfer with privacy lacking trailing ')'\n");
privacy = 0;
}
} else if (strchr(transfer, 'P')) {
@@ -420,16 +437,6 @@ static int dial_exec(struct ast_channel *chan, void *data)
} else if (strchr(transfer, 'C')) {
resetcdr = 1;
}
- /* XXX ANNOUNCE SUPPORT */
- else if ((ann = strstr(transfer, "A("))) {
- announce = 1;
- strncpy(announcemsg, ann + 2, sizeof(announcemsg) - 1);
- cnt=0;
- while(announcemsg[cnt] != ')') {
- cnt++;
- }
- announcemsg[cnt]='\0';
- }
}
if (resetcdr && chan->cdr)
ast_cdr_reset(chan->cdr, 0);