}
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 (switch_core_session_in_thread(session)) {
de->session = session;
}
- sofia_process_dispatch_event(&de, SWITCH_TRUE);
+ sofia_process_dispatch_event(&de);
switch_mutex_unlock(tech_pvt->sofia_mutex);
goto end;
}
case SWITCH_MESSAGE_INDICATE_PHONE_EVENT:
{
+
+ switch_channel_set_flag(channel, CF_REQ_MEDIA);
+ sofia_glue_do_invite(session);
+
+
+#if 0
const char *event = "talk";
if (!zstr(msg->string_arg) && strcasecmp(msg->string_arg, event)) {
} else {
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR(event), TAG_END());
}
+#endif
}
break;
case SWITCH_MESSAGE_INDICATE_SIMPLIFY:
if (sofia_private && sofia_private->is_call && sofia_private->de) {
sofia_dispatch_event_t *qde = sofia_private->de;
sofia_private->de = NULL;
- sofia_process_dispatch_event(&qde, SWITCH_TRUE);
+ sofia_process_dispatch_event(&qde);
}
profile->last_sip_event = switch_time_now();
}
}
-void sofia_process_dispatch_event(sofia_dispatch_event_t **dep, switch_bool_t do_callback)
+void sofia_process_dispatch_event(sofia_dispatch_event_t **dep)
{
sofia_dispatch_event_t *de = *dep;
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;
- }
+ *dep = NULL;
- 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);
- }
+ 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);
nua_destroy_event(de->event);
su_free(nh->nh_home, de);
while(switch_queue_pop(q, &pop) == SWITCH_STATUS_SUCCESS && pop) {
sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop;
- sofia_process_dispatch_event(&de, SWITCH_TRUE);
+ sofia_process_dispatch_event(&de);
switch_cond_next();
}
int idx = 0;
if (mod_sofia_globals.running == 0) {
- sofia_process_dispatch_event(&de, SWITCH_TRUE);
+ sofia_process_dispatch_event(&de);
return;
}
switch_core_session_t *session;
if (!zstr(sofia_private->uuid)) {
- if ((session = switch_core_session_force_locate(sofia_private->uuid))) {
+ if ((session = switch_core_session_locate(sofia_private->uuid))) {
if (switch_core_session_running(session)) {
switch_core_session_queue_signal_data(session, de);
} else {
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;
}