From a681e7f92eb37ebd8b2a48fea9fdc59b921f661f Mon Sep 17 00:00:00 2001 From: anthm Date: Thu, 24 Mar 2005 03:24:51 +0000 Subject: forgot to fix this git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5246 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_chanspy.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 371dfcc30..6e28a0341 100755 --- a/apps/app_chanspy.c +++ b/apps/app_chanspy.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -184,7 +185,6 @@ static int spy_generate(struct ast_channel *chan, void *data, int len, int sampl f1 = spy_queue_shift(csth->spy, 1); ast_mutex_unlock(&csth->spy->lock); - if (f0 && f1) { if (!csth->trans0) { if (f0->subclass != AST_FORMAT_SLINEAR && (csth->trans0 = ast_translator_build_path(AST_FORMAT_SLINEAR, f0->subclass)) == NULL) { @@ -507,11 +507,18 @@ static int chanspy_exec(struct ast_channel *chan, void *data) if (peer && (!bronly || ast_bridged_channel(peer)) && !ast_check_hangup(peer) && !ast_test_flag(peer, AST_FLAG_SPYING)) { + int x = 0; + strncpy(peer_name, peer->name, AST_NAME_STRLEN); ptr = strchr(peer_name, '/'); *ptr = '\0'; ptr++; - peer_name[0] = tolower(peer_name[0]); + for (x = 0 ; x < strlen(peer_name) ; x++) { + if(peer_name[x] == '/') { + break; + } + peer_name[x] = tolower(peer_name[x]); + } if (!silent) { if (ast_fileexists(peer_name, NULL, NULL) != -1) { -- cgit v1.2.3