Skip to content

Commit 0bf79ac

Browse files
committed
res_alarmsystem: Minor improvements to phone reporting.
* Improve the retry time slightly to not back off as vigorously. * Indicate how many failed attempts occured in log message.
1 parent 8dd1ae4 commit 0bf79ac

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

res/res_alarmsystem.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,19 +1590,19 @@ static int phone_retry_time(struct alarm_client *c)
15901590
case 2:
15911591
return 240;
15921592
case 3:
1593-
return 600;
1593+
return 300;
15941594
case 4:
1595-
return 1200;
1595+
return 600;
15961596
case 5:
1597-
return 1800;
1597+
return 900;
15981598
case 6:
1599-
return 3600;
1599+
return 1200;
16001600
case 7:
1601-
return 7200;
1601+
return 1800;
16021602
case 8:
1603-
return 14400;
1603+
return 3600;
16041604
default:
1605-
return 86400;
1605+
return 7200;
16061606
}
16071607
}
16081608

@@ -1643,7 +1643,8 @@ static int send_events_to_server_by_phone(struct alarm_client *c)
16431643
if (c->last_failed_phonesync + retry_interval > now) {
16441644
int next_retry = (c->last_failed_phonesync + retry_interval) - now;
16451645
AST_LIST_UNLOCK(&c->events);
1646-
ast_debug(2, "Phone reporting failed recently (%ld s ago), waiting %d s before retrying again\n", now - c->last_failed_phonesync, next_retry);
1646+
ast_debug(2, "Phone reporting failed recently (attempt %d, %ld s ago), waiting %d s before retrying again\n",
1647+
c->consecutive_failed_phonesyncs, now - c->last_failed_phonesync, next_retry);
16471648
return -1;
16481649
}
16491650
}

0 commit comments

Comments
 (0)