-Wed Nov 2 08:58:40 CDT 2011
+Thu Nov 17 11:43:21 CST 2011
ss = nua_dialog_usage_private(du);
reason = ss->ss_reason;
- error = nua_base_client_trequest(cr, msg, sip,
- SIPTAG_REASON_STR(reason),
- TAG_NEXT(tags));
-
- if (error == 0) {
- nua_dialog_usage_reset_refresh(du);
- ss->ss_timer->timer_set = 0;
- /* Terminate server transactions associated with session, too. */
- for (sr = du->du_dialog->ds_sr; sr; sr = sr->sr_next) {
+ nua_dialog_usage_reset_refresh(du);
+ ss->ss_timer->timer_set = 0;
+
+ /* Terminate server transactions associated with session, too. */
+ for (sr = du->du_dialog->ds_sr; sr; sr = sr->sr_next) {
if (sr->sr_usage == du && nua_server_request_is_pending(sr) &&
- sr->sr_method != sip_method_bye) {
- sr_status(sr, SIP_486_BUSY_HERE);
- nua_server_respond(sr, 0);
+ sr->sr_method != sip_method_bye) {
+ sr_status(sr, SIP_486_BUSY_HERE);
+ nua_server_respond(sr, 0);
}
- }
}
-
+
+ error = nua_base_client_trequest(cr, msg, sip,
+ SIPTAG_REASON_STR(reason),
+ TAG_NEXT(tags));
+
return error;
}
static int nua_bye_client_response(nua_client_request_t *cr,
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending BYE to %s\n", switch_channel_get_name(channel));
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
+ switch_ivr_parse_all_signal_data(session);
nua_bye(tech_pvt->nh,
TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)),
TAG_IF(call_info, SIPTAG_CALL_INFO_STR(call_info)),
switch_channel_set_variable(channel, "sip_hangup_disposition", "send_cancel");
}
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
+ switch_ivr_parse_all_signal_data(session);
nua_cancel(tech_pvt->nh,
TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)), TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)), TAG_END());
}
if (sofia_test_flag(tech_pvt, TFLAG_HUP)) {
return SWITCH_STATUS_FALSE;
}
-
- while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session) && !switch_channel_test_flag(channel, CF_REQ_MEDIA))) {
+ for(;;) {
+ //while (!(tech_pvt->read_codec.implementation && switch_rtp_ready(tech_pvt->rtp_session) && !switch_channel_test_flag(channel, CF_REQ_MEDIA))) {
switch_ivr_parse_all_messages(tech_pvt->session);
-
if (--sanity && switch_channel_up(channel)) {
switch_yield(10000);
} else {
nua_handle_t *nh = de->nh;
nua_t *nua = de->nua;
sofia_profile_t *profile = de->profile;
-
+ nua_event_t event;
*dep = NULL;
+ event = de->data->e_event;
+
+ if (de->session && switch_channel_down_nosig(switch_core_session_get_channel(de->session))) {
+ if (event == nua_i_invite) {
+ nua_respond(nh, 481, "Channel Hanging Up", TAG_END());
+ }
+ do_callback = SWITCH_FALSE;
+ }
+
if (do_callback) {
our_sofia_event_callback(de->data->e_event, de->data->e_status, de->data->e_phrase, de->nua, de->profile,
de->nh, nua_handle_magic(de->nh), de->sip, de, (tagi_t *) de->data->e_tags);
if (!zstr(sofia_private->uuid)) {
if ((session = switch_core_session_force_locate(sofia_private->uuid))) {
if (switch_core_session_running(session)) {
- if (switch_channel_down_nosig(switch_core_session_get_channel(session))) {
- sofia_process_dispatch_event(&de, SWITCH_FALSE);
- } else {
- switch_core_session_queue_signal_data(session, de);
- }
+ switch_core_session_queue_signal_data(session, de);
} else {
switch_core_session_message_t msg = { 0 };
msg.message_id = SWITCH_MESSAGE_INDICATE_SIGNAL_DATA;
char sip_acl_authed_by[512] = "";
char sip_acl_token[512] = "";
- profile->ib_calls++;
-
if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING)) {
nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
goto fail;
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Setting NAT mode based on %s\n", is_nat);
switch_channel_set_variable(channel, "sip_nat_detected", "true");
}
+
+ profile->ib_calls++;
return;
}