Index: channels/chan_dahdi.c =================================================================== --- channels/chan_dahdi.c (revision 401703) +++ channels/chan_dahdi.c (working copy) @@ -13295,8 +13295,27 @@ ast_mutex_unlock(&iflock); restart_monitor(); if (cause && !tmp) { + /* + * If this is a trunk (e.g. FXO with FXSKS signalling) return + * CONGESTION instead of BUSY so that dialplan logic knows to continue + * trying next trunk. + */ if (callwait || channelmatched) { - *cause = AST_CAUSE_BUSY; + /* Look for matching channel again */ + if (start.channelmatch && p->channel != start.channelmatch) { + ast_mutex_lock(&iflock); + for (p = iflist; p; p = p->next) { + if (p->channel == start.channelmatch) { + break; + } + } + ast_mutex_unlock(&iflock); + } + if (p && ISTRUNK(p)) { + *cause = AST_CAUSE_CONGESTION; + } else { + *cause = AST_CAUSE_BUSY; + } } else if (groupmatched) { *cause = AST_CAUSE_CONGESTION; } else {