]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix causes causing trouble (do make current)
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 3 Jul 2008 22:51:09 +0000 (22:51 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 3 Jul 2008 22:51:09 +0000 (22:51 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8896 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_types.h
src/mod/applications/mod_dptools/mod_dptools.c
src/switch_channel.c
src/switch_ivr_originate.c

index 5d48d3fcff5341a49315f7d44d3f63869c377b8d..9c7e1f4499fce181ca6795c0426736ce1d0d8cb1 100644 (file)
@@ -1107,8 +1107,8 @@ typedef enum {
 } switch_input_type_t;
 
 typedef enum {
-       SWITCH_CAUSE_UNALLOCATED = 0,
-       SWITCH_CAUSE_SUCCESS = 1,
+       SWITCH_CAUSE_NONE = 0,
+       SWITCH_CAUSE_UNALLOCATED = 1,
        SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET = 2,
        SWITCH_CAUSE_NO_ROUTE_DESTINATION = 3,
        SWITCH_CAUSE_CHANNEL_UNACCEPTABLE = 6,
@@ -1157,6 +1157,7 @@ typedef enum {
        SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103,
        SWITCH_CAUSE_PROTOCOL_ERROR = 111,
        SWITCH_CAUSE_INTERWORKING = 127,
+       SWITCH_CAUSE_SUCCESS = 142,
        SWITCH_CAUSE_ORIGINATOR_CANCEL = 487,
        SWITCH_CAUSE_CRASH = 500,
        SWITCH_CAUSE_SYSTEM_SHUTDOWN = 501,
index f78da842c23007352763c2552182a6907059d95d..bf1846bbd1cf53c1e04a46620c20a3737ae0b166 100644 (file)
@@ -1919,7 +1919,7 @@ static switch_call_cause_t user_outgoing_channel(switch_core_session_t *session,
        switch_xml_t x_domain = NULL, xml = NULL, x_user = NULL, x_param, x_params;
        char *user = NULL, *domain = NULL;
        const char *dest = NULL;
-       static switch_call_cause_t cause = SWITCH_CAUSE_UNALLOCATED;
+       static switch_call_cause_t cause = SWITCH_CAUSE_NONE;
        unsigned int timelimit = 60;
        switch_channel_t *new_channel = NULL;
        switch_event_t *params = NULL;
index 3481e6be71e52ca0a937bff5e0754242adc87c52..8bf02aa35a7f4d21406ec08222f95fb577043208 100644 (file)
@@ -40,8 +40,8 @@ struct switch_cause_table {
 };
 
 static struct switch_cause_table CAUSE_CHART[] = {
+       {"NONE", SWITCH_CAUSE_NONE},
        {"UNALLOCATED", SWITCH_CAUSE_UNALLOCATED},
-       {"SUCCESS", SWITCH_CAUSE_SUCCESS},
        {"NO_ROUTE_TRANSIT_NET", SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET},
        {"NO_ROUTE_DESTINATION", SWITCH_CAUSE_NO_ROUTE_DESTINATION},
        {"CHANNEL_UNACCEPTABLE", SWITCH_CAUSE_CHANNEL_UNACCEPTABLE},
@@ -89,6 +89,7 @@ static struct switch_cause_table CAUSE_CHART[] = {
        {"MANDATORY_IE_LENGTH_ERROR", SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR},
        {"PROTOCOL_ERROR", SWITCH_CAUSE_PROTOCOL_ERROR},
        {"INTERWORKING", SWITCH_CAUSE_INTERWORKING},
+       {"SUCCESS", SWITCH_CAUSE_SUCCESS},
        {"ORIGINATOR_CANCEL", SWITCH_CAUSE_ORIGINATOR_CANCEL},
        {"CRASH", SWITCH_CAUSE_CRASH},
        {"SYSTEM_SHUTDOWN", SWITCH_CAUSE_SYSTEM_SHUTDOWN},
@@ -143,7 +144,7 @@ SWITCH_DECLARE(const char *) switch_channel_cause2str(switch_call_cause_t cause)
 SWITCH_DECLARE(switch_call_cause_t) switch_channel_str2cause(const char *str)
 {
        uint8_t x;
-       switch_call_cause_t cause = SWITCH_CAUSE_UNALLOCATED;
+       switch_call_cause_t cause = SWITCH_CAUSE_NONE;
 
        if (*str > 47 && *str < 58) {
                cause = atoi(str);
@@ -192,7 +193,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
        switch_mutex_init(&(*channel)->dtmf_mutex, SWITCH_MUTEX_NESTED, pool);
        switch_mutex_init(&(*channel)->flag_mutex, SWITCH_MUTEX_NESTED, pool);
        switch_mutex_init(&(*channel)->profile_mutex, SWITCH_MUTEX_NESTED, pool);
-       (*channel)->hangup_cause = SWITCH_CAUSE_UNALLOCATED;
+       (*channel)->hangup_cause = SWITCH_CAUSE_NONE;
        (*channel)->name = "";
 
        return SWITCH_STATUS_SUCCESS;
index c45ef54424f3c51b7e95e8ff32d8973e3f8bdeb4..13f5910547bb983130b6e07ee92ce8973a482c40 100644 (file)
@@ -512,7 +512,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
        switch_frame_t write_frame = { 0 };
        uint8_t pass = 0;
        char key[80] = SWITCH_BLANK_STRING, file[512] = SWITCH_BLANK_STRING, *odata, *var;
-       switch_call_cause_t reason = SWITCH_CAUSE_UNALLOCATED;
+       switch_call_cause_t reason = SWITCH_CAUSE_NONE;
        uint8_t to = 0;
        char *var_val, *vars = NULL;
        const char *ringback_data = NULL;
@@ -754,7 +754,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                        char *p, *e = NULL;
                        const char *var_begin, *var_end;
                        
-                       reason = SWITCH_CAUSE_UNALLOCATED;
+                       reason = SWITCH_CAUSE_NONE;
                        memset(peer_names, 0, sizeof(peer_names));
                        peer_session = NULL;
                        memset(peer_sessions, 0, sizeof(peer_sessions));
@@ -1306,7 +1306,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
 
                  done:
                        
-                       *cause = SWITCH_CAUSE_UNALLOCATED;
+                       *cause = SWITCH_CAUSE_NONE;
 
                        if (caller_channel && !switch_channel_ready(caller_channel)) {
                                status = SWITCH_STATUS_FALSE;
@@ -1377,7 +1377,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                                        }
                                }
 
-                               if (*cause == SWITCH_CAUSE_SUCCESS || *cause == SWITCH_CAUSE_UNALLOCATED) {
+                               if (*cause == SWITCH_CAUSE_SUCCESS || *cause == SWITCH_CAUSE_NONE) {
                                        *cause = SWITCH_CAUSE_ORIGINATOR_CANCEL;
                                }