mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-21 10:44:16 +00:00
add uuid_simplify and sip_auto_simplify
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16422 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
af7f05dce6
commit
d186928224
7 files changed
+83
-175
No files matched your search
@@ -1435,7 +1435,6 @@ 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);
|
||||
|
||||
@@ -1452,33 +1451,15 @@ 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;
|
||||
|
||||
sipip = tech_pvt->profile->sipip;
|
||||
|
||||
if (sofia_glue_check_nat(tech_pvt->profile, dest_host)) {
|
||||
if (sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
|
||||
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>";
|
||||
@@ -1511,9 +1492,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;
|
||||
char *invite_contact = NULL, *to_str, *use_from_str, *from_str, *url_str;
|
||||
const char *t_var;
|
||||
char *rpid_domain = "cluecon.com", *p;
|
||||
const char *priv = "off";
|
||||
@@ -1526,6 +1507,19 @@ 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);
|
||||
@@ -4007,7 +4001,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);
|
||||
|
||||
Reference in new issue
Block a user