mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 12:40:17 +00:00
exclude rows with the current call_id - could be an endpoint updating it's
registration while we're at max_registrations git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16567 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
8897834403
commit
03009d648c
@ -1701,6 +1701,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
|
|||||||
const char *passwd = NULL;
|
const char *passwd = NULL;
|
||||||
const char *a1_hash = NULL;
|
const char *a1_hash = NULL;
|
||||||
const char *mwi_account = NULL;
|
const char *mwi_account = NULL;
|
||||||
|
const char *call_id = NULL;
|
||||||
char *sql;
|
char *sql;
|
||||||
char *number_alias = NULL;
|
char *number_alias = NULL;
|
||||||
switch_xml_t domain, xml = NULL, user, param, uparams, dparams, group = NULL, gparams = NULL;
|
switch_xml_t domain, xml = NULL, user, param, uparams, dparams, group = NULL, gparams = NULL;
|
||||||
@ -2119,7 +2120,10 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
|
|||||||
/* expires == 0 means the phone is going to unregiser, so don't count against max */
|
/* expires == 0 means the phone is going to unregiser, so don't count against max */
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
sql = switch_mprintf("select count(sip_user) from sip_registrations where sip_user='%q'", username);
|
call_id = sip->sip_call_id->i_id;
|
||||||
|
switch_assert(call_id);
|
||||||
|
|
||||||
|
sql = switch_mprintf("select count(sip_user) from sip_registrations where sip_user='%q' AND call_id <> '%q'", username, call_id);
|
||||||
switch_assert(sql != NULL);
|
switch_assert(sql != NULL);
|
||||||
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_regcount_callback, &count);
|
sofia_glue_execute_sql_callback(profile, NULL, sql, sofia_reg_regcount_callback, &count);
|
||||||
free(sql);
|
free(sql);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user