--- /var/tmp/portage/asterisk-1.0.8/work/asterisk-1.0.8/pbx/pbx_spool.c 2005-04-02 19:41:19.000000000 +0200 +++ /root/pbx_spool.c 2005-07-01 12:16:49.000000000 +0200 @@ -30,6 +30,7 @@ #include #include #include +#include // pow() #include "../astconf.h" /* @@ -50,6 +51,10 @@ int retrytime; /* How long to wait for an answer */ int waittime; + + /* How the retrytime interval should change between retries */ + int mfactor; + /* PID which is currently calling */ int callingpid; @@ -85,6 +90,7 @@ o->priority = 1; o->retrytime = 300; o->waittime = 45; + o->mfactor = 1; } static int apply_outgoing(struct outgoing *o, char *fn, FILE *f) @@ -159,6 +165,11 @@ ast_log(LOG_WARNING, "Invalid retrytime at line %d of %s\n", lineno, fn); o->waittime = 45; } + } else if (!strcasecmp(buf, "mfactor")) { + if ((sscanf(c, "%d", &o->mfactor) != 1) || (o->mfactor < 1)) { + ast_log(LOG_WARNING, "Invalid mfactor at line %d of %s\n", lineno, fn); + o->mfactor = 1; + } } else if (!strcasecmp(buf, "retry")) { o->retries++; } else if (!strcasecmp(buf, "startretry")) { @@ -188,6 +199,7 @@ ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", fn); return -1; } + o->retrytime = o->retrytime * pow(o->mfactor, o->retries); return 0; }