*** chan_misdn.c.orig Sat Jan 16 17:56:53 2010 --- chan_misdn.c Sat Jan 16 22:51:48 2010 *************** *** 855,860 **** --- 855,867 ---- diff = ast_tvdiff_ms(tv_end, tv_now); + if (ast_exists_extension(ch->ast, ch->context, ch->bc->dad, 1, ch->bc->oad) + && !ast_matchmore_extension(ch->ast, ch->context, ch->bc->dad, 1, ch->bc->oad) ) { + /* unique extension found */ + chan_misdn_log(4, ch->bc->port, "leave overlap dial...\n"); + diff=0; + } + if (diff <= 100) { char *dad=ch->bc->dad, sexten[]="s"; /* if we are 100ms near the timeout, we are satisfied.. */ *************** *** 4280,4285 **** --- 4287,4300 ---- } } + if (ast_exists_extension(ch->ast, ch->context, bc->dad, 1, bc->oad) && !ast_matchmore_extension(ch->ast, ch->context, bc->dad, 1, bc->oad) ) { + /* unique extension found */ + chan_misdn_log(4, ch->bc->port, "leave overlap dial...\n"); + ch->state = MISDN_DIALING; + start_pbx(ch, bc, ch->ast); + break; + } + if (!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) { if (ast_exists_extension(ch->ast, ch->context, "i", 1, bc->oad)) { ast_log(LOG_WARNING,