[Freeswitch-trunk] [commit] r6220 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Mon Nov 12 11:51:34 EST 2007
Author: anthm
Date: Mon Nov 12 11:51:33 2007
New Revision: 6220
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
Log:
fix MODENDP-42
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Mon Nov 12 11:51:33 2007
@@ -254,7 +254,6 @@
switch_thread_rwlock_t *rwlock;
switch_mutex_t *flag_mutex;
uint32_t inuse;
- uint32_t soft_max;
time_t started;
uint32_t session_timeout;
uint32_t max_proceeding;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Mon Nov 12 11:51:33 2007
@@ -1917,7 +1917,7 @@
su_addrinfo_t *my_addrinfo = msg_addrinfo(nua_current_request(nua));
- if ((profile->soft_max && sess_count >= profile->soft_max) || sess_count >= sess_max) {
+ if (sess_count >= sess_max) {
nua_respond(nh, 480, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END());
return;
}
@@ -2193,19 +2193,18 @@
return;
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "LUKE: I'm hit, but not bad.\n");
-
- switch_mutex_lock(profile->flag_mutex);
-
- profile->soft_max = sess_count - 10;
- switch_core_session_limit(profile->soft_max);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "LUKE'S VOICE: Artoo, see what you can do with it. Hang on back there....\n"
- "Green laserfire moves past the beeping little robot as his head turns. "
- "After a few beeps and a twist of his mechanical arm,\n"
- "Artoo reduces the max sessions to %d thus, saving the switch from certian doom.\n",
- profile->soft_max);
+ if (sess_count > 110) {
+ switch_mutex_lock(profile->flag_mutex);
+ switch_core_session_limit(sess_count - 10);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "LUKE: I'm hit, but not bad.\n");
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "LUKE'S VOICE: Artoo, see what you can do with it. Hang on back there....\n"
+ "Green laserfire moves past the beeping little robot as his head turns. "
+ "After a few beeps and a twist of his mechanical arm,\n"
+ "Artoo reduces the max sessions to %d thus, saving the switch from certian doom.\n",
+ sess_count < 10);
- switch_mutex_unlock(profile->flag_mutex);
+ switch_mutex_unlock(profile->flag_mutex);
+ }
if (tech_pvt->hash_key) {
switch_core_hash_delete(tech_pvt->profile->chat_hash, tech_pvt->hash_key);
More information about the Freeswitch-trunk
mailing list