Index: pbx.c =================================================================== RCS file: /usr/cvsroot/asterisk/pbx.c,v retrieving revision 1.135 diff -u -r1.135 pbx.c --- pbx.c 1 Jul 2004 20:42:49 -0000 1.135 +++ pbx.c 8 Jul 2004 18:38:05 -0000 @@ -215,8 +215,10 @@ { "Busy", pbx_builtin_busy, "Indicate busy condition and stop", -" Busy(): Requests that the channel indicate busy condition and then waits\n" -"for the user to hang up. Always returns -1." }, +" Busy([i]): Requests that the channel indicate busy condition and then waits\n" +"for the user to hang up. If given an argument of 'i', Busy will return\n" +"immediately without waiting for a hangup. Returns -1 if waiting for hangup\n" +"or 0 if it returns immediately." }, { "Congestion", pbx_builtin_congestion, "Indicate congestion and stop", @@ -4237,9 +4239,14 @@ static int pbx_builtin_busy(struct ast_channel *chan, void *data) { - ast_indicate(chan, AST_CONTROL_BUSY); - wait_for_hangup(chan); - return -1; + char *arg = data; + ast_indicate(chan, AST_CONTROL_BUSY); + if (arg && arg[0] == 'i') { + return 0; + } else { + wait_for_hangup(chan); + return -1; + } } static int pbx_builtin_congestion(struct ast_channel *chan, void *data)