Make sure a channel exists before attempting to start or stop channel

autoservice in func_lock and func_shell.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87233 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-10-27 01:15:02 +00:00
parent db88298c18
commit 024bd67277
2 changed files with 17 additions and 7 deletions

View File

@@ -49,7 +49,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data,
return -1;
}
ast_autoservice_start(chan);
if (chan)
ast_autoservice_start(chan);
if (len >= 1) {
FILE *ptr;
@@ -62,7 +63,8 @@ static int shell_helper(struct ast_channel *chan, const char *cmd, char *data,
pclose(ptr);
}
ast_autoservice_stop(chan);
if (chan)
ast_autoservice_stop(chan);
return 0;
}