FS-3469 here is some more, this may never be perfect

This commit is contained in:
Anthony Minessale
2011-10-24 18:54:22 -05:00
parent 86fef38b28
commit 3764a60df9
5 changed files with 111 additions and 70 deletions
+6 -3
View File
@@ -4468,6 +4468,8 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
if (profile->pres_type) {
char *sql;
time_t now;
const char *presence_id = switch_channel_get_variable(nchannel, "presence_id");
const char *presence_data = switch_channel_get_variable(nchannel, "presence_data");
@@ -4479,9 +4481,10 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
presence_data = switch_event_get_header(var_event, "presence_data");
}
sql = switch_mprintf("insert into sip_dialogs (uuid,presence_id,presence_data,profile_name,hostname) "
"values ('%q', '%q', '%q', '%q', '%q')", switch_core_session_get_uuid(nsession),
switch_str_nil(presence_id), switch_str_nil(presence_data), profile->name, mod_sofia_globals.hostname);
now = switch_epoch_time_now(NULL);
sql = switch_mprintf("insert into sip_dialogs (uuid,presence_id,presence_data,profile_name,hostname,rcd) "
"values ('%q', '%q', '%q', '%q', '%q', %ld)", switch_core_session_get_uuid(nsession),
switch_str_nil(presence_id), switch_str_nil(presence_data), profile->name, mod_sofia_globals.hostname, (long) now);
sofia_glue_actually_execute_sql(profile, sql, profile->ireg_mutex);
switch_safe_free(sql);
}