Project "FreeSWITCH Source" received a push.

branch: master updated

       via: 3fd7b8f2675b6198e9edbdf2359794d5dc134b0a (commit)
      from: a2c0da53f368f0b11340c3a72814c93b182753b7 (commit)


= COMMIT LOG ===========================================================
committer: Marc Olivier Chouinard
comments: 
switch_channel: Add CS_NONE and correct variable name

diff --git a/src/switch_channel.c b/src/switch_channel.c
index f750496..9e3064b 100644
--- a/src/switch_channel.c
+++ b/src/switch_channel.c
@@ -184,7 +184,7 @@ struct switch_callstate_table {
 	const char *name;
 	switch_channel_callstate_t callstate;
 };
-static struct switch_callstate_table STATE_CHART[] = {
+static struct switch_callstate_table CALLSTATE_CHART[] = {
     {"DOWN", CCS_DOWN},
     {"DIALING", CCS_DIALING},
     {"RINGING", CCS_RINGING},
@@ -228,9 +228,9 @@ SWITCH_DECLARE(const char *) switch_channel_callstate2str(switch_channel_callsta
 	uint8_t x;
 	const char *str = "UNKNOWN";
 
-	for (x = 0; x < (sizeof(STATE_CHART) / sizeof(struct switch_cause_table)) - 1; x++) {
-		if (STATE_CHART[x].callstate == callstate) {
-			str = STATE_CHART[x].name;
+	for (x = 0; x < (sizeof(CALLSTATE_CHART) / sizeof(struct switch_cause_table)) - 1; x++) {
+		if (CALLSTATE_CHART[x].callstate == callstate) {
+			str = CALLSTATE_CHART[x].name;
 			break;
 		}
 	}
@@ -238,6 +238,7 @@ SWITCH_DECLARE(const char *) switch_channel_callstate2str(switch_channel_callsta
 	return str;
 }
 
+
 SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2callstate(const char *str)
 {
 	uint8_t x;
@@ -246,9 +247,9 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2callstate(const char *str
 	if (*str > 47 && *str < 58) {
 		callstate = atoi(str);
 	} else {
-		for (x = 0; x < (sizeof(STATE_CHART) / sizeof(struct switch_callstate_table)) - 1 && STATE_CHART[x].name; x++) {
-			if (!strcasecmp(STATE_CHART[x].name, str)) {
-				callstate = STATE_CHART[x].callstate;
+		for (x = 0; x < (sizeof(CALLSTATE_CHART) / sizeof(struct switch_callstate_table)) - 1 && CALLSTATE_CHART[x].name; x++) {
+			if (!strcasecmp(CALLSTATE_CHART[x].name, str)) {
+				callstate = CALLSTATE_CHART[x].callstate;
 				break;
 			}
 		}
@@ -1606,6 +1607,7 @@ static const char *state_names[] = {
 	"CS_HANGUP",
 	"CS_REPORTING",
 	"CS_DESTROY",
+	"CS_NONE",
 	NULL
 };
 
========================================================================

Summary of changes:
 src/switch_channel.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email
For more info, see http://blog.chomperstomp.com/?p=630 --
FreeSWITCH Source