forked from Mirrors/freeswitch
fix causes causing trouble (do make current)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8896 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
5d7c2011c4
commit
98479fa633
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user