Skip to content

Instantly share code, notes, and snippets.

@joshelson
Created November 28, 2016 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshelson/da57463001a568cc4777aa77a56017e4 to your computer and use it in GitHub Desktop.
Save joshelson/da57463001a568cc4777aa77a56017e4 to your computer and use it in GitHub Desktop.
Patch for OUTGOING_RETRY in Asterisk
--- pbx_spool.orig.c 2016-11-09 03:21:38.017426604 +0300
+++ pbx_spool.patched.c 2016-11-11 03:45:55.484474036 +0300
@@ -298,6 +298,23 @@
ast_log(LOG_WARNING, "At least one of app or extension must be specified, along with tech and dest in file %s\n", o->fn);
return -1;
}
+ char* r;
+ if (asprintf(&r, "%d", o->retries + 1) >= 0) {
+ var = ast_variable_new("OUTGOING_RETRY", r, o->fn);
+ if (var) {
+ if (last) {
+ last->next = var;
+ }
+ else {
+ o->vars = var;
+ }
+ last = var;
+ }
+ free(r);
+ }
+ else
+ ast_log(LOG_WARNING, "Can not set OUTGOING_RETRY\n");
+
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment