[asterisk-commits] oej: branch oej/moremanager r180681 - in /team/oej/moremanager: include/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 8 16:25:55 CDT 2009


Author: oej
Date: Sun Mar  8 16:25:51 2009
New Revision: 180681

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=180681
Log:
Issue cause code when one of the limits in asterisk.conf is reached. Not tested yet.


Modified:
    team/oej/moremanager/include/asterisk/causes.h
    team/oej/moremanager/main/channel.c
    team/oej/moremanager/main/pbx.c

Modified: team/oej/moremanager/include/asterisk/causes.h
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/include/asterisk/causes.h?view=diff&rev=180681&r1=180680&r2=180681
==============================================================================
--- team/oej/moremanager/include/asterisk/causes.h (original)
+++ team/oej/moremanager/include/asterisk/causes.h Sun Mar  8 16:25:51 2009
@@ -70,6 +70,9 @@
 #define AST_CAUSE_PROTOCOL_ERROR			111
 #define AST_CAUSE_INTERWORKING				127
 
+/* Private cause codes */
+#define AST_CAUSE_CALL_LIMIT				200
+
 /* Special Asterisk aliases */
 #define AST_CAUSE_BUSY 					AST_CAUSE_USER_BUSY
 #define AST_CAUSE_FAILURE 				AST_CAUSE_NETWORK_OUT_OF_ORDER

Modified: team/oej/moremanager/main/channel.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/main/channel.c?view=diff&rev=180681&r1=180680&r2=180681
==============================================================================
--- team/oej/moremanager/main/channel.c (original)
+++ team/oej/moremanager/main/channel.c Sun Mar  8 16:25:51 2009
@@ -159,6 +159,7 @@
 	{ AST_CAUSE_MANDATORY_IE_LENGTH_ERROR, "MANDATORY_IE_LENGTH_ERROR", "Mandatory IE length error" },
 	{ AST_CAUSE_PROTOCOL_ERROR, "PROTOCOL_ERROR", "Protocol error, unspecified" },
 	{ AST_CAUSE_INTERWORKING, "INTERWORKING", "Interworking, unspecified" },
+	{ AST_CAUSE_CALL_LIMIT, "CALL_LIMIT", "Call limit reached (maxcall,loadavg, mem)" },
 };
 
 struct ast_variable *ast_channeltype_list(void)

Modified: team/oej/moremanager/main/pbx.c
URL: http://svn.digium.com/svn-view/asterisk/team/oej/moremanager/main/pbx.c?view=diff&rev=180681&r1=180680&r2=180681
==============================================================================
--- team/oej/moremanager/main/pbx.c (original)
+++ team/oej/moremanager/main/pbx.c Sun Mar  8 16:25:51 2009
@@ -2609,8 +2609,6 @@
 			option_maxcalls, countcalls,
 			option_maxload, curloadavg);
  	}
- 	ast_mutex_unlock(&maxcalllock);
- 
 	ast_mutex_unlock(&maxcalllock);
 
 	return failed;
@@ -2664,8 +2662,10 @@
 		return AST_PBX_FAILED;
 	}
 
-	if (increase_call_count(c))
+	if (increase_call_count(c)) {
+		c->hangupcause = AST_CAUSE_CALL_LIMIT;
 		return AST_PBX_CALL_LIMIT;
+	}
 
 	/* Start a new thread, and get something handling this channel. */
 	pthread_attr_init(&attr);




More information about the asterisk-commits mailing list