indent run

This commit is contained in:
Anthony Minessale
2010-06-30 10:35:03 -05:00
parent 4f235af8b4
commit f2ea3ee315
5 changed files with 126 additions and 70 deletions
+25 -18
View File
@@ -121,7 +121,7 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
}
}
end:
end:
switch_mutex_unlock(tech_pvt->sofia_mutex);
@@ -245,7 +245,7 @@ char *generate_pai_str(switch_core_session_t *session)
const char *var, *header, *ua = switch_channel_get_variable(tech_pvt->channel, "sip_user_agent");
char *pai = NULL;
if (!sofia_test_pflag(tech_pvt->profile, PFLAG_CID_IN_1XX) ||
if (!sofia_test_pflag(tech_pvt->profile, PFLAG_CID_IN_1XX) ||
((var = switch_channel_get_variable(tech_pvt->channel, "sip_cid_in_1xx")) && switch_false(var))) {
return NULL;
}
@@ -518,7 +518,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session)
}
if (!sofia_test_flag(tech_pvt, TFLAG_BYE)) {
char *cid = generate_pai_str(session);
nua_respond(tech_pvt->nh, sip_cause, sip_status_phrase(sip_cause),
TAG_IF(!zstr(reason), SIPTAG_REASON_STR(reason)),
TAG_IF(cid, SIPTAG_HEADER_STR(cid)), TAG_IF(!zstr(bye_headers), SIPTAG_HEADER_STR(bye_headers)), TAG_END());
@@ -702,7 +702,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE) && tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {
/* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless
we do so in this case we will abandon the SOA rules and go rogue.
*/
*/
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
}
@@ -1100,7 +1100,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
tech_pvt->mismatch_count = 0;
tech_pvt->last_ts = 0;
}
skip:
skip:
if ((bytes = tech_pvt->read_impl.encoded_bytes_per_packet)) {
frames = (tech_pvt->read_frame.datalen / bytes);
@@ -2162,7 +2162,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
tech_pvt->early_sdp && strcmp(tech_pvt->early_sdp, tech_pvt->local_sdp_str)) {
/* The SIP RFC for SOA forbids sending a 183 with one sdp then a 200 with another but it won't do us much good unless
we do so in this case we will abandon the SOA rules and go rogue.
*/
*/
sofia_clear_flag(tech_pvt, TFLAG_ENABLE_SOA);
}
@@ -2207,7 +2207,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
}
end_lock:
end_lock:
//if (msg->message_id == SWITCH_MESSAGE_INDICATE_ANSWER || msg->message_id == SWITCH_MESSAGE_INDICATE_PROGRESS) {
//sofia_send_callee_id(session, NULL, NULL);
@@ -2215,7 +2215,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_mutex_unlock(tech_pvt->sofia_mutex);
end:
end:
if (switch_channel_down(channel) || !tech_pvt || sofia_test_flag(tech_pvt, TFLAG_BYE)) {
status = SWITCH_STATUS_FALSE;
@@ -3158,7 +3158,7 @@ static switch_status_t cmd_profile(char **argv, int argc, switch_stream_handle_t
stream->write_function(stream, "-ERR Unknown command!\n");
done:
done:
if (profile) {
sofia_glue_release_profile(profile);
}
@@ -3456,7 +3456,7 @@ SWITCH_STANDARD_API(sofia_gateway_data_function)
sofia_reg_release_gateway(gateway);
end:
end:
switch_safe_free(mydata);
return SWITCH_STATUS_SUCCESS;
}
@@ -3559,7 +3559,7 @@ SWITCH_STANDARD_API(sofia_function)
stream->write_function(stream, "Unknown Command [%s]\n", argv[0]);
}
done:
done:
switch_safe_free(mycmd);
return status;
}
@@ -3946,7 +3946,7 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
if (switch_core_session_compare(session, nsession)) {
/* It's another sofia channel! so lets cache what they use as a pt for telephone event so
we can keep it the same
*/
*/
private_object_t *ctech_pvt;
ctech_pvt = switch_core_session_get_private(session);
switch_assert(ctech_pvt != NULL);
@@ -3979,14 +3979,14 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
goto done;
error:
error:
if (nsession) {
switch_core_session_destroy(&nsession);
}
if (pool) {
*pool = NULL;
}
done:
done:
if (profile) {
if (cause == SWITCH_CAUSE_SUCCESS) {
@@ -4140,12 +4140,12 @@ static void general_event_handler(switch_event_t *event)
sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,'%q','%q','%q' "
"from sip_registrations where mwi_user='%s' and mwi_host='%q'",
ct, es, switch_str_nil(body), switch_str_nil(user), switch_str_nil(host)
);
);
} else {
sql = switch_mprintf("select sip_user,sip_host,contact,profile_name,'%q','%q','%q' "
"from sip_registrations where sip_user='%s' and sip_host='%q'",
ct, es, switch_str_nil(body), switch_str_nil(user), switch_str_nil(host)
);
);
}
}
@@ -4299,7 +4299,7 @@ static void general_event_handler(switch_event_t *event)
sofia_glue_release_profile(profile);
}
done:
done:
switch_safe_free(local_dup);
@@ -4463,7 +4463,7 @@ static switch_status_t list_profile_gateway(const char *line, const char *cursor
status = SWITCH_STATUS_SUCCESS;
}
end:
end:
switch_safe_free(dup);
@@ -4553,6 +4553,12 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
return SWITCH_STATUS_GENERR;
}
if (switch_event_bind_removable(modname, SWITCH_EVENT_CUSTOM, MY_EVENT_RECOVERY, sofia_glue_track_event_handler, NULL,
&mod_sofia_globals.recovery_node) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
}
if (switch_event_bind(modname, SWITCH_EVENT_TRAP, SWITCH_EVENT_SUBCLASS_ANY, general_event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
return SWITCH_STATUS_GENERR;
@@ -4647,6 +4653,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown)
switch_event_unbind(&mod_sofia_globals.roster_node);
switch_event_unbind(&mod_sofia_globals.custom_node);
switch_event_unbind(&mod_sofia_globals.mwi_node);
switch_event_unbind(&mod_sofia_globals.recovery_node);
switch_event_unbind_callback(general_event_handler);
while (mod_sofia_globals.threads) {