mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 12:36:58 +00:00
Fix dial to not seg when closing ')' is missing (bug #4410)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5812 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -820,19 +820,19 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
|||||||
dblgoto = ast_strdupa(mac + 2);
|
dblgoto = ast_strdupa(mac + 2);
|
||||||
while (*mac && (*mac != ')'))
|
while (*mac && (*mac != ')'))
|
||||||
*(mac++) = 'X';
|
*(mac++) = 'X';
|
||||||
if (*mac)
|
if (*mac) {
|
||||||
*mac = 'X';
|
*mac = 'X';
|
||||||
else {
|
mac = strchr(dblgoto, ')');
|
||||||
|
if (mac)
|
||||||
|
*mac = '\0';
|
||||||
|
else {
|
||||||
|
ast_log(LOG_WARNING, "Goto flag set without trailing ')'\n");
|
||||||
|
dblgoto = NULL;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
ast_log(LOG_WARNING, "Could not find exten to which we should jump.\n");
|
ast_log(LOG_WARNING, "Could not find exten to which we should jump.\n");
|
||||||
dblgoto = NULL;
|
dblgoto = NULL;
|
||||||
}
|
}
|
||||||
mac = strchr(dblgoto, ')');
|
|
||||||
if (mac)
|
|
||||||
*mac = '\0';
|
|
||||||
else {
|
|
||||||
ast_log(LOG_WARNING, "Goto flag set without trailing ')'\n");
|
|
||||||
dblgoto = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the macroname from the dial option string */
|
/* Get the macroname from the dial option string */
|
||||||
@@ -841,19 +841,19 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
|||||||
macroname = ast_strdupa(mac + 2);
|
macroname = ast_strdupa(mac + 2);
|
||||||
while (*mac && (*mac != ')'))
|
while (*mac && (*mac != ')'))
|
||||||
*(mac++) = 'X';
|
*(mac++) = 'X';
|
||||||
if (*mac)
|
if (*mac) {
|
||||||
*mac = 'X';
|
*mac = 'X';
|
||||||
else {
|
mac = strchr(macroname, ')');
|
||||||
|
if (mac)
|
||||||
|
*mac = '\0';
|
||||||
|
else {
|
||||||
|
ast_log(LOG_WARNING, "Macro flag set without trailing ')'\n");
|
||||||
|
hasmacro = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
ast_log(LOG_WARNING, "Could not find macro to which we should jump.\n");
|
ast_log(LOG_WARNING, "Could not find macro to which we should jump.\n");
|
||||||
hasmacro = 0;
|
hasmacro = 0;
|
||||||
}
|
}
|
||||||
mac = strchr(macroname, ')');
|
|
||||||
if (mac)
|
|
||||||
*mac = '\0';
|
|
||||||
else {
|
|
||||||
ast_log(LOG_WARNING, "Macro flag set without trailing ')'\n");
|
|
||||||
hasmacro = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* Get music on hold class */
|
/* Get music on hold class */
|
||||||
if ((mac = strstr(transfer, "m("))) {
|
if ((mac = strstr(transfer, "m("))) {
|
||||||
@@ -898,8 +898,8 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
|||||||
} else if (strchr(transfer, 'C')) {
|
} else if (strchr(transfer, 'C')) {
|
||||||
resetcdr = 1;
|
resetcdr = 1;
|
||||||
} else if (strchr(transfer, 'n')) {
|
} else if (strchr(transfer, 'n')) {
|
||||||
nojump = 1;
|
nojump = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resetcdr && chan->cdr)
|
if (resetcdr && chan->cdr)
|
||||||
ast_cdr_reset(chan->cdr, 0);
|
ast_cdr_reset(chan->cdr, 0);
|
||||||
|
Reference in New Issue
Block a user