aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-22 05:19:06 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-22 05:19:06 +0000
commitde60feae86c732afa8ffbdc4b9fb6d2dcabb0b46 (patch)
tree3999d66957086bc31fd125f322f4cadf74f6de95
parentf8e1b236fe2988539217e2b28898a563a77630fd (diff)
Handle arbitrary long dial sequences (like what we need at Astricon)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3817 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xapps/app_dial.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/app_dial.c b/apps/app_dial.c
index 9ffd1d5a2..7f3c3d768 100755
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -3,9 +3,9 @@
*
* Trivial application to dial a channel and send an URL on answer
*
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999-2004, Digium, Inc.
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
@@ -411,7 +411,7 @@ static int dial_exec(struct ast_channel *chan, void *data)
{
int res=-1;
struct localuser *u;
- char info[256], *peers, *timeout, *tech, *number, *rest, *cur;
+ char *info, *peers, *timeout, *tech, *number, *rest, *cur;
char privdb[256] = "", *s;
char announcemsg[256] = "", *ann;
struct localuser *outgoing=NULL, *tmp;
@@ -462,10 +462,13 @@ static int dial_exec(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Dial requires an argument (technology1/number1&technology2/number2...|optional timeout|options)\n");
return -1;
}
-
+
+ if (!(info = ast_strdupa(data))) {
+ ast_log(LOG_WARNING, "Unable to dupe data :(\n");
+ return -1;
+ }
LOCAL_USER_ADD(u);
- strncpy(info, (char *)data, sizeof(info) - 1);
peers = info;
if (peers) {