fix dingaling reject

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4087 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2007-01-29 22:22:29 +00:00
parent 2d4d6ea756
commit 39119eb7a7
3 changed files with 16 additions and 6 deletions

View File

@ -366,6 +366,8 @@ static ldl_status parse_session_code(ldl_handle_t *handle, char *id, char *from,
} }
} else if (!strcasecmp(type, "transport-accept")) { } else if (!strcasecmp(type, "transport-accept")) {
dl_signal = LDL_SIGNAL_TRANSPORT_ACCEPT; dl_signal = LDL_SIGNAL_TRANSPORT_ACCEPT;
} else if (!strcasecmp(type, "reject")) {
dl_signal = LDL_SIGNAL_REJECT;
} else if (!strcasecmp(type, "transport-info")) { } else if (!strcasecmp(type, "transport-info")) {
char *tid = iks_find_attrib(xml, "id"); char *tid = iks_find_attrib(xml, "id");
dl_signal = LDL_SIGNAL_CANDIDATES; dl_signal = LDL_SIGNAL_CANDIDATES;

View File

@ -142,7 +142,8 @@ typedef enum {
LDL_SIGNAL_LOGIN_SUCCESS, LDL_SIGNAL_LOGIN_SUCCESS,
LDL_SIGNAL_LOGIN_FAILURE, LDL_SIGNAL_LOGIN_FAILURE,
LDL_SIGNAL_CONNECTED, LDL_SIGNAL_CONNECTED,
LDL_SIGNAL_TRANSPORT_ACCEPT LDL_SIGNAL_TRANSPORT_ACCEPT,
LDL_SIGNAL_REJECT
} ldl_signal_t; } ldl_signal_t;
typedef enum { typedef enum {

View File

@ -1616,10 +1616,10 @@ static switch_status_t channel_outgoing_channel(switch_core_session_t *session,
switch_channel_set_flag(channel, CF_OUTBOUND); switch_channel_set_flag(channel, CF_OUTBOUND);
switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND); switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
switch_stun_random_string(sess_id, 10, "0123456789"); switch_stun_random_string(sess_id, 10, "0123456789");
tech_pvt->us = switch_core_session_strdup(session, user); tech_pvt->us = switch_core_session_strdup(*new_session, user);
tech_pvt->them = switch_core_session_strdup(session, full_id); tech_pvt->them = switch_core_session_strdup(*new_session, full_id);
ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user, LDL_FLAG_OUTBOUND); ldl_session_create(&dlsession, mdl_profile->handle, sess_id, full_id, user, LDL_FLAG_OUTBOUND);
tech_pvt->profile = mdl_profile; tech_pvt->profile = mdl_profile;
ldl_session_set_private(dlsession, *new_session); ldl_session_set_private(dlsession, *new_session);
@ -2685,11 +2685,18 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
} }
} }
break; break;
case LDL_SIGNAL_REJECT:
if (channel) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "reject %s\n", switch_channel_get_name(channel));
terminate_session(&session, __LINE__, SWITCH_CAUSE_CALL_REJECTED);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call (Rejected)\n");
goto done;
}
break;
case LDL_SIGNAL_ERROR: case LDL_SIGNAL_ERROR:
case LDL_SIGNAL_TERMINATE: case LDL_SIGNAL_TERMINATE:
if (channel) { if (channel) {
switch_channel_state_t state = switch_channel_get_state(channel); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hungup %s %u %d\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "hungup %s %u %d\n", switch_channel_get_name(channel), state, CS_INIT);
terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING); terminate_session(&session, __LINE__, SWITCH_CAUSE_NORMAL_CLEARING);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "End Call\n");
goto done; goto done;