From: Anthony Minessale Date: Tue, 3 Jul 2007 21:05:41 +0000 (+0000) Subject: let hangup app optionally take a digit string for exact cause X-Git-Tag: v1.0-beta1~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c02f435a305cd6e8261a75784bd94d304e6985ce;p=thirdparty%2Ffreeswitch.git let hangup app optionally take a digit string for exact cause git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5497 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/switch_channel.c b/src/switch_channel.c index b87bee64ea..07b32946b9 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -139,9 +139,13 @@ SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str) 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;