Fix login to allow logging off with @context

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2003-08-04 22:22:54 +00:00
parent 75fbecf831
commit 2711c7aed9

View File

@@ -904,7 +904,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
/* Retrieve login chan */
res = ast_app_getdata(chan, "agent-newlocation", tmpchan, sizeof(tmpchan) - 1, 0);
if (!res) {
if (context && strlen(context))
if (context && strlen(context) && strlen(tmpchan))
snprintf(p->loginchan, sizeof(p->loginchan), "%s@%s", tmpchan, context);
else
strncpy(p->loginchan, tmpchan, sizeof(p->loginchan) - 1);