Update res_fax and res_fax_spandsp to be compatible with Fax For Asterisk 1.2.
The fax session initilization code for T.38 faxes has been rewritten. T.38 session initialization was removed from generic_fax_exec, and split into two different code paths for receive and send. Also the 'z' option (to send a T.38 reinvite if we do not receive one) was added to sendfax. In the output of 'fax show sessions', the 'Type' column has been renamed to 'Tech' and replaced with a new 'Tech' column that will report 'G.711' or 'T.38'. Control of ECM defaults has been added to res_fax A 'fax show settings' CLI command has been added. Support of the new AST_T38_REQUEST_PARMS control method request to handle channels that have already received a T.38 reinvite before the FAX application is start has been added. Support for the 'fax show settings' command has been added to res_fax_spandsp and handling of the ECM flag has been slightly altered. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258896 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
84c3d61f65
commit
c18fc0e2ae
|
@ -139,13 +139,19 @@ struct ast_fax_session_details {
|
|||
/*! flag to send debug manager events */
|
||||
uint32_t debug:2;
|
||||
/*! flag indicating the use of Error Correction Mode (ECM) */
|
||||
uint32_t ecm:2;
|
||||
uint32_t ecm:1;
|
||||
/*! flag indicating the sending of status manager events */
|
||||
uint32_t statusevents:2;
|
||||
/*! allow audio mode FAX on T.38-capable channels */
|
||||
uint32_t allow_audio:2;
|
||||
/*! indicating the session switched to T38 */
|
||||
uint32_t switch_to_t38:1;
|
||||
/*! flag indicating whether CED should be sent (for receive mode) */
|
||||
uint32_t send_ced:1;
|
||||
/*! flag indicating whether CNG should be sent (for send mode) */
|
||||
uint32_t send_cng:1;
|
||||
/*! send a T.38 reinvite */
|
||||
uint32_t request_t38:1;
|
||||
};
|
||||
} option;
|
||||
/*! override the minimum transmission rate with a channel variable */
|
||||
|
@ -181,6 +187,8 @@ struct ast_fax_session {
|
|||
enum ast_fax_state state;
|
||||
/*! name of the Asterisk channel using the fax session */
|
||||
char *channame;
|
||||
/*! unique ID of the Asterisk channel using the fax session */
|
||||
char *chan_uniqueid;
|
||||
/*! Asterisk channel using the fax session */
|
||||
struct ast_channel *chan;
|
||||
/*! fax debugging structure */
|
||||
|
@ -229,6 +237,8 @@ struct ast_fax_tech {
|
|||
char * (* const cli_show_session)(struct ast_fax_session *, int);
|
||||
/*! displays statistics from the fax technology module */
|
||||
char * (* const cli_show_stats)(int);
|
||||
/*! displays settings from the fax technology module */
|
||||
char * (* const cli_show_settings)(int);
|
||||
};
|
||||
|
||||
/*! \brief register a fax technology */
|
||||
|
|
917
res/res_fax.c
917
res/res_fax.c
File diff suppressed because it is too large
Load Diff
|
@ -61,6 +61,7 @@ static int spandsp_fax_switch_to_t38(struct ast_fax_session *s);
|
|||
static char *spandsp_fax_cli_show_capabilities(int fd);
|
||||
static char *spandsp_fax_cli_show_session(struct ast_fax_session *s, int fd);
|
||||
static char *spandsp_fax_cli_show_stats(int fd);
|
||||
static char *spandsp_fax_cli_show_settings(int fd);
|
||||
|
||||
static struct ast_fax_tech spandsp_fax_tech = {
|
||||
.type = "Spandsp",
|
||||
|
@ -85,6 +86,7 @@ static struct ast_fax_tech spandsp_fax_tech = {
|
|||
.cli_show_capabilities = spandsp_fax_cli_show_capabilities,
|
||||
.cli_show_session = spandsp_fax_cli_show_session,
|
||||
.cli_show_stats = spandsp_fax_cli_show_stats,
|
||||
.cli_show_settings = spandsp_fax_cli_show_settings,
|
||||
};
|
||||
|
||||
struct spandsp_fax_stats {
|
||||
|
@ -405,7 +407,7 @@ static void set_file(t30_state_t *t30_state, struct ast_fax_session_details *det
|
|||
|
||||
static void set_ecm(t30_state_t *t30_state, struct ast_fax_session_details *details)
|
||||
{
|
||||
t30_set_ecm_capability(t30_state, (details->option.ecm == AST_FAX_OPTFLAG_DEFAULT) ? 1 : details->option.ecm );
|
||||
t30_set_ecm_capability(t30_state, details->option.ecm);
|
||||
t30_set_supported_compressions(t30_state, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION);
|
||||
}
|
||||
|
||||
|
@ -732,6 +734,13 @@ static char *spandsp_fax_cli_show_stats(int fd)
|
|||
return CLI_SUCCESS;
|
||||
}
|
||||
|
||||
/*! \brief Show res_fax_spandsp settings */
|
||||
static char *spandsp_fax_cli_show_settings(int fd)
|
||||
{
|
||||
/* no settings at the moment */
|
||||
return CLI_SUCCESS;
|
||||
}
|
||||
|
||||
/*! \brief unload res_fax_spandsp */
|
||||
static int unload_module(void)
|
||||
{
|
||||
|
|
Reference in New Issue