95c95 < " AgentCallbackLogin([AgentNo][|[options][|[exten]@context]]):\n" --- > " AgentCallbackLogin([AgentNo][|[options][|[exten]@context]][|[agentpass]):\n" 1698a1699 > AST_APP_ARG(agent_pass); 1747,1751c1748,1751 < parse = args.extension; < args.extension = strsep(&parse, "@"); < context = parse; < } < --- > parse = args.extension; > args.extension = strsep(&parse, "@"); > context = parse; > } 1778,1779c1778,1781 < if (!ast_strlen_zero(xpass)) < res = ast_app_getdata(chan, "agent-pass", pass, sizeof(pass) - 1, 0); --- > if (!ast_strlen_zero(args.agent_pass)) > ast_copy_string(pass, args.agent_pass, AST_MAX_AGENT); > else if (!ast_strlen_zero(xpass)) > res = ast_app_getdata(chan, "agent-pass", pass, sizeof(pass) - 1, 0); 1781c1783 < pass[0] = '\0'; --- > pass[0] = '\0'; 1839,1866c1841,1873 < for (;;) { < if (!ast_strlen_zero(args.extension)) { < ast_copy_string(tmpchan, args.extension, sizeof(tmpchan)); < res = 0; < } else < res = ast_app_getdata(chan, "agent-newlocation", tmpchan+pos, sizeof(tmpchan) - 2, 0); < if (ast_strlen_zero(tmpchan) || ast_exists_extension(chan, !ast_strlen_zero(context) ? context : "default", tmpchan, < 1, NULL)) < break; < if (args.extension) { < ast_log(LOG_WARNING, "Extension '%s' is not valid for automatic login of agent '%s'\n", args.extension, p->agent); < args.extension = NULL; < pos = 0; < } else { < ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, !ast_strlen_zero(context) ? context : "default", p->agent); < res = ast_streamfile(chan, "invalid", chan->language); < if (!res) < res = ast_waitstream(chan, AST_DIGIT_ANY); < if (res > 0) { < tmpchan[0] = res; < tmpchan[1] = '\0'; < pos = 1; < } else { < tmpchan[0] = '\0'; < pos = 0; < } < } < } --- > if(!ast_strlen_zero(args.extension) && strcmp(args.extension,"#")!=0){ > for (;;) { > if (!ast_strlen_zero(args.extension)) { > ast_copy_string(tmpchan, args.extension, sizeof(tmpchan)); > res = 0; > } else > res = ast_app_getdata(chan, "agent-newlocation", tmpchan+pos, sizeof(tmpchan) - 2, 0); > if (ast_strlen_zero(tmpchan) || ast_exists_extension(chan, !ast_strlen_zero(context) ? context : "default", tmpchan, > 1, NULL)) > break; > if (args.extension) { > ast_log(LOG_WARNING, "Extension '%s' is not valid for automatic login of agent '%s'\n", args.extension, p->agent); > args.extension = NULL; > pos = 0; > } else { > ast_log(LOG_WARNING, "Extension '%s@%s' is not valid for automatic login of agent '%s'\n", tmpchan, !ast_strlen_zero(context) ? context : "default", p->agent); > res = ast_streamfile(chan, "invalid", chan->language); > if (!res) > res = ast_waitstream(chan, AST_DIGIT_ANY); > if (res > 0) { > tmpchan[0] = res; > tmpchan[1] = '\0'; > pos = 1; > } else { > tmpchan[0] = '\0'; > pos = 0; > } > } > } > }else{ > tmpchan[0] = '\0'; > pos = 0; > } 1868c1875 < if (!res) { --- > if (!res ) { 1874a1882 > ast_log(LOG_WARNING,"TESTTT");