Merge "pbx: Reduce verbosity while loading extensions"
[asterisk/asterisk.git] / main / bridge_after.c
index e2f14ab..69c8f98 100644 (file)
@@ -32,8 +32,6 @@
 
 #include "asterisk.h"
 
-ASTERISK_REGISTER_FILE()
-
 #include "asterisk/logger.h"
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
@@ -295,23 +293,23 @@ int ast_bridge_set_after_callback(struct ast_channel *chan, ast_bridge_after_cb
        return 0;
 }
 
-const char *reason_strings[] = {
-       [AST_BRIDGE_AFTER_CB_REASON_DESTROY] = "Channel destroyed (hungup)",
-       [AST_BRIDGE_AFTER_CB_REASON_REPLACED] = "Callback was replaced",
-       [AST_BRIDGE_AFTER_CB_REASON_MASQUERADE] = "Channel masqueraded",
-       [AST_BRIDGE_AFTER_CB_REASON_DEPART] = "Channel was departed from bridge",
-       [AST_BRIDGE_AFTER_CB_REASON_REMOVED] = "Callback was removed",
-};
-
 const char *ast_bridge_after_cb_reason_string(enum ast_bridge_after_cb_reason reason)
 {
-       if (reason < AST_BRIDGE_AFTER_CB_REASON_DESTROY
-               || AST_BRIDGE_AFTER_CB_REASON_REMOVED < reason
-               || !reason_strings[reason]) {
-               return "Unknown";
-       }
-
-       return reason_strings[reason];
+       switch (reason) {
+       case AST_BRIDGE_AFTER_CB_REASON_DESTROY:
+               return "Channel destroyed (hungup)";
+       case AST_BRIDGE_AFTER_CB_REASON_REPLACED:
+               return "Callback was replaced";
+       case AST_BRIDGE_AFTER_CB_REASON_MASQUERADE:
+               return "Channel masqueraded";
+       case AST_BRIDGE_AFTER_CB_REASON_DEPART:
+               return "Channel was departed from bridge";
+       case AST_BRIDGE_AFTER_CB_REASON_REMOVED:
+               return "Callback was removed";
+       case AST_BRIDGE_AFTER_CB_REASON_IMPART_FAILED:
+               return "Channel failed joining the bridge";
+       }
+       return "Unknown";
 }
 
 struct after_bridge_goto_ds {
@@ -484,7 +482,7 @@ int ast_bridge_setup_after_goto(struct ast_channel *chan)
                }
        } else if (!ast_check_hangup(chan)) {
                /* Clear the outgoing flag */
-               ast_clear_flag(ast_channel_flags(chan), AST_FLAG_OUTGOING);
+               ast_channel_clear_flag(chan, AST_FLAG_OUTGOING);
 
                if (after_bridge->specific) {
                        goto_failed = ast_explicit_goto(chan, after_bridge->context,