FS-7228 - Max Register Refresh before the Register is challenged for credentials

This commit is contained in:
Rajesh Panicker
2015-02-05 23:23:41 -08:00
parent 9e15c4e5b5
commit 5db8a0c16b
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -2726,7 +2726,7 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
free(sql);
//if (!sofia_glue_execute_sql2str(profile, profile->dbh_mutex, sql, np, nplen)) {
if (zstr(np)) {
if (zstr(np) || (profile->max_auth_validity != 0 && cb.last_nc >= profile->max_auth_validity )) {
sql = switch_mprintf("delete from sip_authentication where nonce='%q'", nonce);
sofia_glue_execute_sql(profile, &sql, SWITCH_TRUE);
ret = AUTH_STALE;