improve connectile-dysfunction mode to send message packets from the server end to keep the connection open

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5210 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-05-22 15:03:21 +00:00
parent e0047afb3f
commit dcd1d6423b
3 changed files with 56 additions and 4 deletions
+22 -1
View File
@@ -110,6 +110,28 @@ void sofia_event_callback(nua_event_t event,
su_root_break(profile->s_root);
}
break;
case nua_r_message:
{
if (status == 503) {
const char *user = NULL, *host = NULL;
char *sql;
if (sip->sip_to && sip->sip_to->a_url) {
user = sip->sip_to->a_url->url_user;
host = sip->sip_to->a_url->url_host;
sql = switch_mprintf("delete from sip_registrations where user='%q' and host='%q'", user, host);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Deleting registration for %s@%s\n", user, host);
sofia_glue_execute_sql(profile, SWITCH_TRUE, sql, NULL);
switch_safe_free(sql);
}
}
nua_handle_destroy(nh);
}
break;
case nua_r_get_params:
case nua_r_invite:
case nua_r_unregister:
@@ -120,7 +142,6 @@ void sofia_event_callback(nua_event_t event,
case nua_i_bye:
case nua_r_unsubscribe:
case nua_r_publish:
case nua_r_message:
case nua_r_notify:
case nua_i_notify:
case nua_i_cancel: