#define DEFAULT_DEFAULT_EXPIRY 120
#define DEFAULT_MAX_EXPIRY 3600
#define DEFAULT_REGISTRATION_TIMEOUT 20
-#define DEFAULT_REGATTEMPTS_MAX 10
/* guard limit must be larger than guard secs */
/* guard min must be < 1000, and should be >= 250 */
static int global_rtpkeepalive = 0;
static int global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
-static int global_regattempts_max = DEFAULT_REGATTEMPTS_MAX;
+static int global_regattempts_max = 0;
/* Object counters */
static int suserobjs = 0;
__sip_pretend_ack(p);
}
/* If we have a limit, stop registration and give up */
- if (global_regattempts_max && r->regattempts > global_regattempts_max) {
+ if (global_regattempts_max && (r->regattempts > global_regattempts_max)) {
/* Ok, enough is enough. Don't try any more */
/* We could add an external notification here...
steal it from app_voicemail :-) */
break;
case 403: /* Forbidden */
ast_log(LOG_WARNING, "Forbidden - wrong password on authentication for REGISTER for '%s' to '%s'\n", p->registry->username, p->registry->hostname);
- p->registry->regattempts = global_regattempts_max+1;
+ if (global_regattempts_max)
+ p->registry->regattempts = global_regattempts_max+1;
ast_sched_del(sched, r->timeout);
ast_set_flag(p, SIP_NEEDDESTROY);
break;
case 404: /* Not found */
ast_log(LOG_WARNING, "Got 404 Not found on SIP register to service %s@%s, giving up\n", p->registry->username,p->registry->hostname);
- p->registry->regattempts = global_regattempts_max+1;
+ if (global_regattempts_max)
+ p->registry->regattempts = global_regattempts_max+1;
ast_set_flag(p, SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
break;
case 479: /* SER: Not able to process the URI - address is wrong in register*/
ast_log(LOG_WARNING, "Got error 479 on register to %s@%s, giving up (check config)\n", p->registry->username,p->registry->hostname);
- p->registry->regattempts = global_regattempts_max+1;
+ if (global_regattempts_max)
+ p->registry->regattempts = global_regattempts_max+1;
ast_set_flag(p, SIP_NEEDDESTROY);
r->call = NULL;
ast_sched_del(sched, r->timeout);
global_rtpkeepalive = 0;
pedanticsipchecking = 0;
global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;
- global_regattempts_max = DEFAULT_REGATTEMPTS_MAX;
+ global_regattempts_max = 0;
ast_clear_flag(&global_flags, AST_FLAGS_ALL);
ast_set_flag(&global_flags, SIP_DTMF_RFC2833);
ast_set_flag(&global_flags, SIP_NAT_RFC3581);