From de60feae86c732afa8ffbdc4b9fb6d2dcabb0b46 Mon Sep 17 00:00:00 2001 From: markster Date: Wed, 22 Sep 2004 05:19:06 +0000 Subject: 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 --- apps/app_dial.c | 13 ++++++++----- 1 file 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 + * Mark Spencer * * 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) { -- cgit v1.2.3