Index: chan_agent.c =================================================================== --- chan_agent.c (revision 353961) +++ chan_agent.c (working copy) @@ -84,6 +84,9 @@ silent login - do not announce the login ok segment after agent logged on/off + @@ -1868,6 +1871,7 @@ ); const char *tmpoptions = NULL; int play_announcement = 1; + int skip_password = 0; char agent_goodbye[AST_MAX_FILENAME_LEN]; int update_cdr = updatecdr; char *filename = "agent-loginok"; @@ -1909,6 +1913,9 @@ if (strchr(args.options, 's')) { play_announcement = 0; } + if (strchr(args.options, 'p')) { + skip_password = 1; + } } if (chan->_state != AST_STATE_UP) @@ -1929,8 +1936,10 @@ } AST_LIST_UNLOCK(&agents); if (!res) { - if (!ast_strlen_zero(xpass)) + if (!ast_strlen_zero(xpass) && skip_password == 0) res = ast_app_getdata(chan, "agent-pass", pass, sizeof(pass) - 1, 0); + else if (skip_password == 1) + ast_copy_string(pass, p->password, sizeof(pass)); else pass[0] = '\0'; }