Index: channels/chan_alsa.c =================================================================== --- channels/chan_alsa.c (revision 53151) +++ channels/chan_alsa.c (working copy) @@ -522,9 +522,25 @@ { int res = 3; struct ast_frame f = { AST_FRAME_CONTROL }; + char *flags = ast_strdupa(dest), *destcopy; + destcopy = strsep(&flags, "/"); ast_mutex_lock(&alsalock); ast_verbose( " << Call placed to '%s' on console >> \n", dest); - if (autoanswer) { + if (flags && strcasecmp(flags, "answer") == 0) { + if (alsa.owner) { + f.subclass = AST_CONTROL_ANSWER; + ast_queue_frame(alsa.owner, &f); + ast_mutex_unlock(&alsa.owner->lock); + } + } else if (flags && strcasecmp(flags, "noanswer") == 0) { + grab_owner(); + if (alsa.owner) { + f.subclass = AST_CONTROL_RINGING; + ast_queue_frame(alsa.owner, &f); + ast_mutex_unlock(&alsa.owner->lock); + } + write(sndcmd[1], &res, sizeof(res)); + } else if (autoanswer) { ast_verbose( " << Auto-answered >> \n" ); grab_owner(); if (alsa.owner) {