remove whitespace madness thx stkn

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6863 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West 2007-12-18 16:31:05 +00:00
parent 4d4963e2b3
commit ca3e62a4c3

View File

@ -57,6 +57,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status, static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status,
char const *phrase, char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]); nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
void sofia_handle_sip_r_notify(switch_core_session_t *session, int status, void sofia_handle_sip_r_notify(switch_core_session_t *session, int status,
char const *phrase, char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]) nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
@ -297,11 +298,11 @@ void sofia_event_callback(nua_event_t event,
switch_core_session_rwunlock(session); switch_core_session_rwunlock(session);
} }
} }
void event_handler(switch_event_t *event) void event_handler(switch_event_t *event)
{ {
char *subclass, *sql; char *subclass, *sql;
if ((subclass = switch_event_get_header(event, "orig-event-subclass")) && !strcasecmp(subclass, MY_EVENT_REGISTER)) { if ((subclass = switch_event_get_header(event, "orig-event-subclass")) && !strcasecmp(subclass, MY_EVENT_REGISTER)) {
@ -350,12 +351,12 @@ void sofia_event_callback(nua_event_t event,
sofia_glue_release_profile(profile); sofia_glue_release_profile(profile);
} }
} }
} }
void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj) void *SWITCH_THREAD_FUNC sofia_profile_thread_run(switch_thread_t *thread, void *obj)
{ {
sofia_profile_t *profile = (sofia_profile_t *) obj; sofia_profile_t *profile = (sofia_profile_t *) obj;
switch_memory_pool_t *pool; switch_memory_pool_t *pool;
sip_alias_node_t *node; sip_alias_node_t *node;
@ -529,10 +530,10 @@ void sofia_event_callback(nua_event_t event,
switch_mutex_unlock(mod_sofia_globals.mutex); switch_mutex_unlock(mod_sofia_globals.mutex);
return NULL; return NULL;
} }
void launch_sofia_profile_thread(sofia_profile_t *profile) void launch_sofia_profile_thread(sofia_profile_t *profile)
{ {
switch_thread_t *thread; switch_thread_t *thread;
switch_threadattr_t *thd_attr = NULL; switch_threadattr_t *thd_attr = NULL;
@ -540,37 +541,37 @@ void sofia_event_callback(nua_event_t event,
switch_threadattr_detach_set(thd_attr, 1); switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
switch_thread_create(&thread, thd_attr, sofia_profile_thread_run, profile, profile->pool); switch_thread_create(&thread, thd_attr, sofia_profile_thread_run, profile, profile->pool);
} }
static void logger(void *logarg, char const *fmt, va_list ap) static void logger(void *logarg, char const *fmt, va_list ap)
{ {
char *data = NULL; char *data = NULL;
if (fmt) { if (fmt) {
#ifdef HAVE_VASPRINTF #ifdef HAVE_VASPRINTF
int ret; int ret;
ret = vasprintf(&data, fmt, ap); ret = vasprintf(&data, fmt, ap);
if ((ret == -1) || !data) { if ((ret == -1) || !data) {
return; return;
} }
#else #else
data = (char *) malloc(2048); data = (char *) malloc(2048);
if (data) { if (data) {
vsnprintf(data, 2048, fmt, ap); vsnprintf(data, 2048, fmt, ap);
} else { } else {
return; return;
} }
#endif #endif
} }
if (data) { if (data) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, (char *) "%s", data); switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_CONSOLE, (char *) "%s", data);
free(data); free(data);
} }
} }
static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
{ {
switch_xml_t gateway_tag, param; switch_xml_t gateway_tag, param;
sofia_gateway_t *gp; sofia_gateway_t *gp;
@ -747,10 +748,10 @@ void sofia_event_callback(nua_event_t event,
switch_assert(gateway_tag); switch_assert(gateway_tag);
} }
} }
switch_status_t config_sofia(int reload, char *profile_name) switch_status_t config_sofia(int reload, char *profile_name)
{ {
char *cf = "sofia.conf"; char *cf = "sofia.conf";
switch_xml_t cfg, xml = NULL, xprofile, param, settings, profiles, gateways_tag, domain_tag, domains_tag; switch_xml_t cfg, xml = NULL, xprofile, param, settings, profiles, gateways_tag, domain_tag, domains_tag;
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
@ -849,7 +850,7 @@ void sofia_event_callback(nua_event_t event,
} else if (!strcasecmp(var, "sip-trace") && switch_true(val)) { } else if (!strcasecmp(var, "sip-trace") && switch_true(val)) {
switch_set_flag(profile, TFLAG_TPORT_LOG); switch_set_flag(profile, TFLAG_TPORT_LOG);
} else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) { } else if (!strcasecmp(var, "odbc-dsn") && !switch_strlen_zero(val)) {
#ifdef SWITCH_HAVE_ODBC #ifdef SWITCH_HAVE_ODBC
profile->odbc_dsn = switch_core_strdup(profile->pool, val); profile->odbc_dsn = switch_core_strdup(profile->pool, val);
if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) { if ((profile->odbc_user = strchr(profile->odbc_dsn, ':'))) {
*profile->odbc_user++ = '\0'; *profile->odbc_user++ = '\0';
@ -858,9 +859,9 @@ void sofia_event_callback(nua_event_t event,
} }
} }
#else #else
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n"); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ODBC IS NOT AVAILABLE!\n");
#endif #endif
} else if (!strcasecmp(var, "user-agent-string")) { } else if (!strcasecmp(var, "user-agent-string")) {
profile->user_agent = switch_core_strdup(profile->pool, val);; profile->user_agent = switch_core_strdup(profile->pool, val);;
@ -1142,12 +1143,12 @@ void sofia_event_callback(nua_event_t event,
return status; return status;
} }
static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status, static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status,
char const *phrase, char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]) nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
{ {
if (sip && session && (status == 180 || status == 183 || status == 200)) { if (sip && session && (status == 180 || status == 183 || status == 200)) {