diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c
index 793ccde552d9943b701c581955f335ba217d2ac5..37ff0edad93dac4796472ebcb1d1357f7a12e5f5 100644
--- a/pbx/pbx_spool.c
+++ b/pbx/pbx_spool.c
@@ -109,7 +109,11 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
 	char buf[256];
 	char *c, *c2;
 	int lineno = 0;
-	struct ast_variable *var;
+	struct ast_variable *var, *last = o->vars;
+
+	while (last && last->next) {
+		last = last->next;
+	}
 
 	while(fgets(buf, sizeof(buf), f)) {
 		lineno++;
@@ -205,8 +209,13 @@ static int apply_outgoing(struct outgoing *o, char *fn, FILE *f)
 					if (c2) {
 						var = ast_variable_new(c, c2, fn);
 						if (var) {
-							var->next = o->vars;
-							o->vars = var;
+							/* Always insert at the end, because some people want to treat the spool file as a script */
+							if (last) {
+								last->next = var;
+							} else {
+								o->vars = var;
+							}
+							last = var;
 						}
 					} else
 						ast_log(LOG_WARNING, "Malformed \"%s\" argument.  Should be \"%s: variable=value\"\n", buf, buf);