diff --git a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c index f85a9855bb..1e651222da 100644 --- a/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c +++ b/src/mod/dialplans/mod_dialplan_xml/mod_dialplan_xml.c @@ -573,9 +573,15 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * } switch_regex_safe_free(re); - if (((anti_action == SWITCH_FALSE && do_break_i == BREAK_ON_TRUE) || - (anti_action == SWITCH_TRUE && do_break_i == BREAK_ON_FALSE)) || do_break_i == BREAK_ALWAYS) { - break; + if (switch_xml_child(xcond, "condition") && switch_xml_attr(xexten, "break-from-nested") && switch_false(switch_xml_attr(xexten, "break-from-nested"))) { + if ((anti_action == SWITCH_TRUE && do_break_i == BREAK_ON_FALSE)) { + break; + } + } else { + if (((anti_action == SWITCH_FALSE && do_break_i == BREAK_ON_TRUE) || + (anti_action == SWITCH_TRUE && do_break_i == BREAK_ON_FALSE)) || do_break_i == BREAK_ALWAYS) { + break; + } } if (proceed) { @@ -588,6 +594,12 @@ static int parse_exten(switch_core_session_t *session, switch_caller_profile_t * } } } + + /* need to recheck this if we didn't break ealier because of break-from-nested */ + if (((anti_action == SWITCH_FALSE && do_break_i == BREAK_ON_TRUE) || + (anti_action == SWITCH_TRUE && do_break_i == BREAK_ON_FALSE)) || do_break_i == BREAK_ALWAYS) { + break; + } } done: