Index: include/asterisk/channel.h =================================================================== RCS file: /usr/cvsroot/asterisk/include/asterisk/channel.h,v retrieving revision 1.53 diff -c -u -r1.53 channel.h --- include/asterisk/channel.h 1 Aug 2004 03:14:11 -0000 1.53 +++ include/asterisk/channel.h 1 Aug 2004 07:57:13 -0000 @@ -123,6 +123,8 @@ struct ast_filestream *vstream; /*! Original writer format */ int oldwriteformat; + /*! True if this is a sub-channel */ + int subchannel; /*! Timing fd */ int timingfd; Index: channel.c =================================================================== RCS file: /usr/cvsroot/asterisk/channel.c,v retrieving revision 1.131 diff -c -u -r1.131 channel.c --- channel.c 28 Jul 2004 20:41:49 -0000 1.131 +++ channel.c 1 Aug 2004 07:57:14 -0000 @@ -1851,6 +1851,7 @@ "Uniqueid: %s\r\n", c->name, ast_state2str(c->_state), c->callerid ? c->callerid : "", c->uniqueid); } + c->subchannel = 0; } return c; } Index: apps/app_dial.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_dial.c,v retrieving revision 1.91 diff -c -u -r1.91 app_dial.c --- apps/app_dial.c 28 Jul 2004 19:25:14 -0000 1.91 +++ apps/app_dial.c 1 Aug 2004 07:57:14 -0000 @@ -232,6 +232,8 @@ o->stillgoing = 0; numnochan++; } else { + o->chan->subchannel = 1; + if (o->chan->callerid) free(o->chan->callerid); @@ -340,7 +342,15 @@ /* Ignore going off hook */ break; case -1: - if (!outgoing->ringbackonly && !outgoing->musiconhold) { + if (o->chan->subchannel) { + if (option_verbose > 2) + ast_verbose( VERBOSE_PREFIX_3 "%s is busy\n", o->chan->name); + in->hangupcause = o->chan->hangupcause; + ast_hangup(o->chan); + o->chan = NULL; + o->stillgoing = 0; + numbusy++; + } else if (!outgoing->ringbackonly && !outgoing->musiconhold) { if (option_verbose > 2) ast_verbose( VERBOSE_PREFIX_3 "%s stopped sounds\n", o->chan->name); ast_indicate(in, -1);