231a232 > double volgain; /*!< Volume gain for voicemails sent via email */ 388a390 > static double volgain; 436a439 > vmu->volgain = volgain; 490a494,495 > } else if (!strcasecmp(var, "volgain")) { > sscanf(value, "%lf", &vmu->volgain); 1653a1659 > char tmpcmd[256]; 1778a1785,1786 > char tmpdir[256], newtmp[256]; > int tmpfd = -1; 1787a1796,1807 > if (vmu->volgain < -.001 || vmu->volgain > .001) { > create_dirpath(tmpdir, sizeof(tmpdir), vmu->context, vmu->mailbox, "tmp"); > snprintf(newtmp, sizeof(newtmp), "%s/XXXXXX", tmpdir); > tmpfd = mkstemp(newtmp); > ast_log(LOG_EVENT, "tmpfd: %d newtmp: %s\n", tmpfd, newtmp); > if (tmpfd > -1) { > snprintf(tmpcmd, sizeof(tmpcmd), "sox -v %.4f %s.%s %s.%s", vmu->volgain, attach, format, newtmp, format); > ast_safe_system(tmpcmd); > attach = newtmp; > ast_log(LOG_EVENT, "VOLGAIN: Stored at: %s.%s - Level: %.4f - Mailbox: %s\n", attach, format, vmu->volgain, mailbox); > } > } 1791a1812,1817 > /* Remove temporary files, both with and without the extension */ > if (tmpfd > -1) { > unlink(fname); > close(tmpfd); > unlink(newtmp); > } 5830a5857 > const char *volgainstr; 5866a5894,5897 > volgain = 0.0; > if ((volgainstr = ast_variable_retrieve(cfg, "general", "volgain"))) > sscanf(volgainstr, "%lf", &volgain); >