Fix login to allow logging off with @context
authorMark Spencer <markster@digium.com>
Mon, 4 Aug 2003 22:22:54 +0000 (22:22 +0000)
committerMark Spencer <markster@digium.com>
Mon, 4 Aug 2003 22:22:54 +0000 (22:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index 8142387..2581817 100755 (executable)
@@ -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);