Add extension for FAX paper formats and resolutions
This commit is contained in:
parent
8d2a77021a
commit
5904d40121
33
chan_capi.c
33
chan_capi.c
|
@ -2359,6 +2359,7 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
|
||||||
B3_PROTO_FAXG3 b3conf;
|
B3_PROTO_FAXG3 b3conf;
|
||||||
char buffer[CAPI_MAX_STRING];
|
char buffer[CAPI_MAX_STRING];
|
||||||
unsigned short b3_protocol_options = 0;
|
unsigned short b3_protocol_options = 0;
|
||||||
|
int extended_resolution = 0;
|
||||||
|
|
||||||
if (!data) { /* no data implies no filename or anything is present */
|
if (!data) { /* no data implies no filename or anything is present */
|
||||||
cc_log(LOG_WARNING, CC_MESSAGE_NAME " receivefax requires a filename\n");
|
cc_log(LOG_WARNING, CC_MESSAGE_NAME " receivefax requires a filename\n");
|
||||||
|
@ -2394,6 +2395,12 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
|
||||||
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Allow Fine resolution");
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Allow Fine resolution");
|
||||||
b3_protocol_options |= 0x0001;
|
b3_protocol_options |= 0x0001;
|
||||||
break;
|
break;
|
||||||
|
case 'u': /* use Fine resolution */
|
||||||
|
cc_verbose(3, 1,
|
||||||
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Allow Super/Ultra fine resolution");
|
||||||
|
b3_protocol_options |= 0x0001;
|
||||||
|
extended_resolution = 1;
|
||||||
|
break;
|
||||||
case 'j': /* enable JPEG encoding */
|
case 'j': /* enable JPEG encoding */
|
||||||
cc_verbose(3, 1,
|
cc_verbose(3, 1,
|
||||||
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: enable JPEG coding");
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: enable JPEG coding");
|
||||||
|
@ -2440,6 +2447,15 @@ static int pbx_capi_receive_fax(struct ast_channel *c, char *data)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (capi_controllers[i->controller]->divaExtendedFeaturesAvailable != 0 && extended_resolution != 0) {
|
||||||
|
/*
|
||||||
|
Per PLCI control is available only starting with Diva 9.0 SU1
|
||||||
|
Without per PLCI control setting is applied to controller
|
||||||
|
*/
|
||||||
|
capi_sendf (NULL, 0, CAPI_MANUFACTURER_REQ, i->PLCI, get_capi_MessageNumber(),
|
||||||
|
"dw(d)", _DI_MANU_ID, _DI_OPTIONS_REQUEST, 0x00000040L);
|
||||||
|
}
|
||||||
|
|
||||||
i->FaxState |= CAPI_FAX_STATE_ACTIVE;
|
i->FaxState |= CAPI_FAX_STATE_ACTIVE;
|
||||||
setup_b3_fax_config(&b3conf, FAX_SFF_FORMAT, stationid, headline, b3_protocol_options);
|
setup_b3_fax_config(&b3conf, FAX_SFF_FORMAT, stationid, headline, b3_protocol_options);
|
||||||
|
|
||||||
|
@ -2518,6 +2534,7 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
|
||||||
char buffer[CAPI_MAX_STRING];
|
char buffer[CAPI_MAX_STRING];
|
||||||
int file_format;
|
int file_format;
|
||||||
unsigned short b3_protocol_options = 0;
|
unsigned short b3_protocol_options = 0;
|
||||||
|
int extended_resolution = 0;
|
||||||
|
|
||||||
if (!data) { /* no data implies no filename or anything is present */
|
if (!data) { /* no data implies no filename or anything is present */
|
||||||
cc_log(LOG_WARNING, CC_MESSAGE_NAME " sendfax requires a filename\n");
|
cc_log(LOG_WARNING, CC_MESSAGE_NAME " sendfax requires a filename\n");
|
||||||
|
@ -2582,6 +2599,13 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
|
||||||
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Use Fine resolution");
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Use Fine resolution");
|
||||||
b3_protocol_options |= 0x0001;
|
b3_protocol_options |= 0x0001;
|
||||||
break;
|
break;
|
||||||
|
case 'u': /* use Fine resolution */
|
||||||
|
cc_verbose(3, 1,
|
||||||
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Allow Super/Ultra fine resolution");
|
||||||
|
b3_protocol_options |= 0x0001;
|
||||||
|
extended_resolution = 1;
|
||||||
|
break;
|
||||||
|
case 'j': /* enable JPEG encoding */
|
||||||
case 't': /* diasble T.85 encoding */
|
case 't': /* diasble T.85 encoding */
|
||||||
cc_verbose(3, 1,
|
cc_verbose(3, 1,
|
||||||
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Do not use T.85 coding");
|
VERBOSE_PREFIX_3 CC_MESSAGE_NAME " receivefax: Do not use T.85 coding");
|
||||||
|
@ -2610,6 +2634,15 @@ static int pbx_capi_send_fax(struct ast_channel *c, char *data)
|
||||||
options++;
|
options++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (capi_controllers[i->controller]->divaExtendedFeaturesAvailable != 0 && extended_resolution != 0) {
|
||||||
|
/*
|
||||||
|
Per PLCI control is available only starting with Diva 9.0 SU1
|
||||||
|
Without per PLCI control setting is applied to controller
|
||||||
|
*/
|
||||||
|
capi_sendf (NULL, 0, CAPI_MANUFACTURER_REQ, i->PLCI, get_capi_MessageNumber(),
|
||||||
|
"dw(d)", _DI_MANU_ID, _DI_OPTIONS_REQUEST, 0x00000040L);
|
||||||
|
}
|
||||||
|
|
||||||
i->FaxState |= (CAPI_FAX_STATE_ACTIVE | CAPI_FAX_STATE_SENDMODE);
|
i->FaxState |= (CAPI_FAX_STATE_ACTIVE | CAPI_FAX_STATE_SENDMODE);
|
||||||
setup_b3_fax_config(&b3conf, file_format, stationid, headline, b3_protocol_options);
|
setup_b3_fax_config(&b3conf, file_format, stationid, headline, b3_protocol_options);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue