[Freeswitch-svn] [commit] r5497 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Tue Jul 3 17:05:41 EDT 2007


Author: anthm
Date: Tue Jul  3 17:05:41 2007
New Revision: 5497

Modified:
   freeswitch/trunk/src/switch_channel.c

Log:
let hangup app optionally take a digit string for exact cause

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Tue Jul  3 17:05:41 2007
@@ -139,9 +139,13 @@
 	uint8_t x;
 	switch_call_cause_t cause = SWITCH_CAUSE_UNALLOCATED;
 
-	for (x = 0; CAUSE_CHART[x].name; x++) {
-		if (!strcasecmp(CAUSE_CHART[x].name, str)) {
-			cause = CAUSE_CHART[x].cause;
+	if (*str > 47 && *str < 58) {
+		cause = atoi(str);
+	} else {
+		for (x = 0; CAUSE_CHART[x].name; x++) {
+			if (!strcasecmp(CAUSE_CHART[x].name, str)) {
+				cause = CAUSE_CHART[x].cause;
+			}
 		}
 	}
 	return cause;



More information about the Freeswitch-svn mailing list