[asterisk-commits] file: trunk r164733 - /trunk/pbx/pbx_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 16 10:50:12 CST 2008


Author: file
Date: Tue Dec 16 10:50:11 2008
New Revision: 164733

URL: http://svn.digium.com/view/asterisk?view=rev&rev=164733
Log:
Be more detailed about why the include did not get included.
(closes issue #14071)
Reported by: kshumard
Patches:
      pbx_config.patch.improvederroroutput.txt uploaded by kshumard (license 92)

Modified:
    trunk/pbx/pbx_config.c

Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?view=diff&rev=164733&r1=164732&r2=164733
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Tue Dec 16 10:50:11 2008
@@ -1557,7 +1557,31 @@
 			} else if (!strcasecmp(v->name, "include")) {
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
 				if (ast_context_add_include2(con, realvalue, registrar)) {
-					ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
+					switch (errno) {
+						case ENOMEM:
+							ast_log(LOG_WARNING, "Out of memory for context addition\n");
+							break;
+
+						case EBUSY:
+							ast_log(LOG_WARNING, "Failed to lock context(s) list, please try again later\n");
+							break;
+
+						case EEXIST:
+							ast_log(LOG_WARNING, "Context '%s' already included in '%s' context\n",
+									v->value, cxt);
+							break;
+
+						case ENOENT:
+						case EINVAL:
+							ast_log(LOG_WARNING, "There is no existence of context '%s'\n",
+									errno == ENOENT ? v->value : cxt);
+							break;
+
+						default:
+							ast_log(LOG_WARNING, "Failed to include '%s' in '%s' context\n",
+									v->value, cxt);
+							break;
+					}
 				}
 			} else if (!strcasecmp(v->name, "ignorepat")) {
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);




More information about the asterisk-commits mailing list