Merged revisions 280909 via svnmerge from
authorMatthew Nicholson <mnicholson@digium.com>
Wed, 4 Aug 2010 15:22:02 +0000 (15:22 +0000)
committerMatthew Nicholson <mnicholson@digium.com>
Wed, 4 Aug 2010 15:22:02 +0000 (15:22 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r280909 | mnicholson | 2010-08-04 10:11:13 -0500 (Wed, 04 Aug 2010) | 2 lines

  Initialize FAXOPT() status variables in sendfax and receivefax instead of when the details structure is created.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@280910 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_fax.c

index 03fd128..934000d 100644 (file)
@@ -387,9 +387,6 @@ static struct ast_fax_session_details *session_details_new(void)
        d->modems = general_options.modems;
        d->minrate = general_options.minrate;
        d->maxrate = general_options.maxrate;
-       ast_string_field_set(d, result, "FAILED");
-       ast_string_field_set(d, resultstr, "error starting fax session");
-       ast_string_field_set(d, error, "INIT_ERROR");
 
        return d;
 }
@@ -1390,6 +1387,10 @@ static int receivefax_exec(struct ast_channel *chan, const char *data)
                return -1;
        }
 
+       ast_string_field_set(details, result, "FAILED");
+       ast_string_field_set(details, resultstr, "error starting fax session");
+       ast_string_field_set(details, error, "INIT_ERROR");
+
        set_channel_variables(chan, details);
 
        if (ast_strlen_zero(data)) {
@@ -1795,6 +1796,9 @@ static int sendfax_exec(struct ast_channel *chan, const char *data)
                return -1;
        }
 
+       ast_string_field_set(details, result, "FAILED");
+       ast_string_field_set(details, resultstr, "error starting fax session");
+       ast_string_field_set(details, error, "INIT_ERROR");
        set_channel_variables(chan, details);
 
        if (ast_strlen_zero(data)) {