add uuid_simplify and sip_auto_simplify

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16420 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2010-01-20 18:55:38 +00:00
1 parent c26d08dbfc
commit da82398e07
13 files changed
+182 -211

No files matched your search

+25 -19
View File
@@ -1435,6 +1435,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
char *route_uri = NULL;
sofia_destination_t *dst = NULL;
sofia_cid_type_t cid_type = tech_pvt->profile->cid_type;
char *d_url = NULL, *url = NULL, *dest_host = NULL, *url_str = NULL;
rep = switch_channel_get_variable(channel, SOFIA_REPLACES_HEADER);
@@ -1451,15 +1452,33 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
check_decode(cid_name, session);
check_decode(cid_num, session);
if (zstr(tech_pvt->dest)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error!\n");
return SWITCH_STATUS_FALSE;
}
if ((d_url = sofia_glue_get_url_from_contact(tech_pvt->dest, 1))) {
url = d_url;
} else {
url = tech_pvt->dest;
}
url_str = url;
if ((dest_host = strchr(url_str, '@'))) {
dest_host++;
}
if (!tech_pvt->from_str) {
const char* sipip;
const char* format;
const char *alt = NULL;
if (sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
sipip = tech_pvt->profile->sipip;
if (sofia_glue_check_nat(tech_pvt->profile, dest_host)) {
sipip = tech_pvt->profile->extsipip;
} else {
sipip = tech_pvt->profile->extsipip ? tech_pvt->profile->extsipip : tech_pvt->profile->sipip;
}
format = strchr(sipip, ':') ? "\"%s\" <sip:%s%s[%s]>" : "\"%s\" <sip:%s%s%s>";
@@ -1492,9 +1511,9 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
sofia_set_flag_locked(tech_pvt, TFLAG_READY);
if (!tech_pvt->nh) {
char *d_url = NULL, *url = NULL;
sofia_private_t *sofia_private;
char *invite_contact = NULL, *to_str, *use_from_str, *from_str, *url_str;
char *invite_contact = NULL, *to_str, *use_from_str, *from_str;
const char *t_var;
char *rpid_domain = "cluecon.com", *p;
const char *priv = "off";
@@ -1507,19 +1526,6 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
const char *from_var = switch_channel_get_variable(tech_pvt->channel, "sip_from_uri");
const char *from_display = switch_channel_get_variable(tech_pvt->channel, "sip_from_display");
if (zstr(tech_pvt->dest)) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(tech_pvt->session), SWITCH_LOG_ERROR, "URL Error!\n");
return SWITCH_STATUS_FALSE;
}
if ((d_url = sofia_glue_get_url_from_contact(tech_pvt->dest, 1))) {
url = d_url;
} else {
url = tech_pvt->dest;
}
url_str = url;
if (from_var) {
if (strncasecmp(from_var, "sip:", 4) || strncasecmp(from_var, "sips:", 5)) {
use_from_str = switch_core_session_strdup(tech_pvt->session, from_var);
@@ -4001,7 +4007,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
}
free(test_sql);
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and expires > 0", mod_sofia_globals.hostname);
test_sql = switch_mprintf("delete from sip_dialogs where hostname='%q' and expires >= 0", mod_sofia_globals.hostname);
if (switch_odbc_handle_exec(odbc_dbh, test_sql, NULL, NULL) != SWITCH_ODBC_SUCCESS) {
switch_odbc_handle_exec(odbc_dbh, "DROP TABLE sip_dialogs", NULL, NULL);