From e4a8e3fd9ee743e6cfb5891986d13e953d93b2ff Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Sat, 16 Aug 2003 16:06:29 +0000 Subject: [PATCH] Trim post dash portion of name if unspecified git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1352 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index 1b5088c956..9206e1dde5 100755 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1013,6 +1013,7 @@ static int aqm_exec(struct ast_channel *chan, void *data) struct localuser *u; char *queuename; char info[512]; + char tmpchan[512]=""; char *interface=NULL; struct ast_call_queue *q; struct member *save; @@ -1034,8 +1035,13 @@ static int aqm_exec(struct ast_channel *chan, void *data) *interface = '\0'; interface++; } - else - interface = chan->name ; + else { + strncpy(tmpchan, chan->name, sizeof(tmpchan) - 1); + interface = strrchr(tmpchan, '-'); + if (interface) + *interface = '\0'; + interface = tmpchan; + } } if( ( q = queues) != NULL )