diff --git a/main/pbx.c b/main/pbx.c
index 4d7ebbaba1c58db6cb422e5fdef33ecdee853c39..550add495f45f46ee773633bca4ddf1c5049e6c4 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2520,6 +2520,8 @@ static int __ast_pbx_run(struct ast_channel *c)
 	}
 	if (!found && !error)
 		ast_log(LOG_WARNING, "Don't know what to do with '%s'\n", c->name);
+	if (res != AST_PBX_KEEPALIVE)
+		ast_softhangup(c, c->hangupcause ? c->hangupcause : AST_CAUSE_NORMAL_CLEARING);
 	if ((res != AST_PBX_KEEPALIVE) && ast_exists_extension(c, c->context, "h", 1, c->cid.cid_num)) {
 		if (c->cdr && ast_opt_end_cdr_before_h_exten)
 			ast_cdr_end(c->cdr);