Coding style, formatting.
This commit is contained in:
parent
e7da2a3aed
commit
2c636c7484
135
chan_capi.c
135
chan_capi.c
|
@ -588,10 +588,12 @@ static void capi_echo_canceller(struct capi_pvt *i, int function)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((i->channeltype == CAPI_CHANNELTYPE_NULL) && (capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IP) == 0) {
|
||||
if ((i->channeltype == CAPI_CHANNELTYPE_NULL) &&
|
||||
(capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IP) == 0) {
|
||||
return;
|
||||
}
|
||||
if ((i->channeltype != CAPI_CHANNELTYPE_NULL) && (capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IFC) == 0) {
|
||||
if ((i->channeltype != CAPI_CHANNELTYPE_NULL) &&
|
||||
(capi_controllers[i->controller]->ecPath & EC_ECHOCANCEL_PATH_IFC) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -704,8 +706,10 @@ static void capi_diva_tone_processing_function(struct capi_pvt *i, unsigned char
|
|||
if (capi_check_diva_tone_function_allowed(i) != 0)
|
||||
return;
|
||||
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: Apply tone processing function %u (PLCI=%#x)\n", i->vname, function, i->PLCI);
|
||||
capi_sendf (i, 0, CAPI_FACILITY_REQ, i->PLCI, get_capi_MessageNumber(), "w(www())", 1, function, 0, 0);
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: Apply tone processing function %u (PLCI=%#x)\n",
|
||||
i->vname, function, i->PLCI);
|
||||
capi_sendf(i, 0, CAPI_FACILITY_REQ, i->PLCI, get_capi_MessageNumber(),
|
||||
"w(www())", 1, function, 0, 0);
|
||||
}
|
||||
|
||||
static void capi_diva_send_tone_function(struct capi_pvt *i, unsigned char tone)
|
||||
|
@ -717,7 +721,11 @@ static void capi_diva_send_tone_function(struct capi_pvt *i, unsigned char tone)
|
|||
FACILITYSELECTOR_DTMF, 252, /* send tone */ 0, 0, tone);
|
||||
}
|
||||
|
||||
static void capi_diva_pitch_control_command(struct capi_pvt *i, int enable, unsigned short rxpitch, unsigned short txpitch)
|
||||
static void capi_diva_pitch_control_command(
|
||||
struct capi_pvt *i,
|
||||
int enable,
|
||||
unsigned short rxpitch,
|
||||
unsigned short txpitch)
|
||||
{
|
||||
if (capi_check_diva_tone_function_allowed(i) != 0)
|
||||
return;
|
||||
|
@ -744,7 +752,8 @@ static int capi_detect_dtmf(struct capi_pvt *i, int flag)
|
|||
return 0;
|
||||
|
||||
if ((i->channeltype == CAPI_CHANNELTYPE_NULL) &&
|
||||
(((i->line_plci == NULL) && (null_plci_dtmf_support == 0)) || (i->resource_plci_type == CAPI_RESOURCE_PLCI_LINE))) {
|
||||
(((i->line_plci == NULL) && (null_plci_dtmf_support == 0)) ||
|
||||
(i->resource_plci_type == CAPI_RESOURCE_PLCI_LINE))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1343,8 @@ static int pbx_capi_hangup(struct ast_channel *c)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void pbx_capi_call_build_calling_party_number (struct ast_channel *c,
|
||||
static void pbx_capi_call_build_calling_party_number(
|
||||
struct ast_channel *c,
|
||||
char* calling,
|
||||
int max_calling,
|
||||
int use_defaultcid,
|
||||
|
@ -1698,7 +1708,6 @@ _cstruct diva_get_b1_conf (struct capi_pvt *i) {
|
|||
b1conf = (_cstruct)"\x06\x01\x04\x0f\x05\xa0\x00";
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
cc_log(LOG_ERROR, "%s: format %s(%d) invalid.\n",
|
||||
i->vname, ast_getformatname(i->codec), i->codec);
|
||||
|
@ -1948,67 +1957,6 @@ static int line_interconnect(struct capi_pvt *i0, struct capi_pvt *i1, int start
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* disconnect b3 and bring it up with another protocol
|
||||
*/
|
||||
static void cc_switch_b_protocol(struct capi_pvt *i)
|
||||
{
|
||||
int waitcount = 200;
|
||||
|
||||
cc_disconnect_b3(i, 1);
|
||||
|
||||
i->isdnstate |= CAPI_ISDN_STATE_B3_CHANGE;
|
||||
cc_select_b(i, NULL);
|
||||
|
||||
if (i->outgoing) {
|
||||
/* on outgoing call we must do the connect-b3 request */
|
||||
cc_start_b3(i);
|
||||
}
|
||||
|
||||
/* wait for the B3 layer to come up */
|
||||
while ((waitcount > 0) &&
|
||||
(!(i->isdnstate & CAPI_ISDN_STATE_B3_UP))) {
|
||||
usleep(10000);
|
||||
waitcount--;
|
||||
}
|
||||
if (!(i->isdnstate & CAPI_ISDN_STATE_B3_UP)) {
|
||||
cc_log(LOG_ERROR, "capi switch b3: no b3 up\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* set the b3 protocol to transparent
|
||||
*/
|
||||
static int cc_set_transparent(struct capi_pvt *i)
|
||||
{
|
||||
if (i->bproto != CC_BPROTO_RTP) {
|
||||
/* nothing to do */
|
||||
return 0;
|
||||
}
|
||||
|
||||
i->bproto = CC_BPROTO_TRANSPARENT;
|
||||
cc_switch_b_protocol(i);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* set the b3 protocol to RTP (if wanted)
|
||||
*/
|
||||
static void cc_unset_transparent(struct capi_pvt *i, int rtpwanted)
|
||||
{
|
||||
if ((!rtpwanted) ||
|
||||
(i->isdnstate & CAPI_ISDN_STATE_DISCONNECT))
|
||||
return;
|
||||
|
||||
i->bproto = CC_BPROTO_RTP;
|
||||
cc_switch_b_protocol(i);
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* try call transfer instead of bridge
|
||||
*/
|
||||
|
@ -4424,7 +4372,8 @@ static void capidev_handle_facility_indication(_cmsg *CMSG, unsigned int PLCI, u
|
|||
}
|
||||
}
|
||||
|
||||
static int pbx_capi_get_samples (struct capi_pvt *i, int length) {
|
||||
static int pbx_capi_get_samples(struct capi_pvt *i, int length)
|
||||
{
|
||||
switch (i->codec) {
|
||||
case AST_FORMAT_SLINEAR:
|
||||
#if defined(AST_FORMAT_SLINEAR16)
|
||||
|
@ -4449,7 +4398,8 @@ static int pbx_capi_get_samples (struct capi_pvt *i, int length) {
|
|||
/*
|
||||
* CAPI DATA_B3_IND
|
||||
*/
|
||||
static void capidev_handle_data_b3_indication(_cmsg *CMSG,
|
||||
static void capidev_handle_data_b3_indication(
|
||||
_cmsg *CMSG,
|
||||
unsigned int PLCI,
|
||||
unsigned int NCCI,
|
||||
struct capi_pvt *i,
|
||||
|
@ -4473,7 +4423,8 @@ static void capidev_handle_data_b3_indication(_cmsg *CMSG,
|
|||
} else {
|
||||
#ifdef DIVA_STREAMING
|
||||
dword i = 0, k = 0;
|
||||
b3len = (int)diva_streaming_read_vector_data (vind, vind_nr, &i, &k, b3buf, CAPI_MAX_B3_BLOCK_SIZE);
|
||||
b3len = (int)diva_streaming_read_vector_data(vind,
|
||||
vind_nr, &i, &k, b3buf, CAPI_MAX_B3_BLOCK_SIZE);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -4578,7 +4529,8 @@ static void capidev_handle_data_b3_indication(_cmsg *CMSG,
|
|||
}
|
||||
|
||||
#if defined(DIVA_STREAMING)
|
||||
void capidev_handle_data_b3_indication_vector (struct capi_pvt *i,
|
||||
void capidev_handle_data_b3_indication_vector(
|
||||
struct capi_pvt *i,
|
||||
struct _diva_streaming_vector* vind,
|
||||
int vind_nr)
|
||||
{
|
||||
|
@ -4644,13 +4596,15 @@ static void capidev_send_faxdata(struct capi_pvt *i)
|
|||
"()");
|
||||
}
|
||||
|
||||
static void capidev_read_name_from_diva_manufacturer_infications (const unsigned char* src,
|
||||
static void capidev_read_name_from_diva_manufacturer_infications(
|
||||
const unsigned char* src,
|
||||
const unsigned char* end,
|
||||
char* dst,
|
||||
int max_length,
|
||||
unsigned char* octet3a,
|
||||
const char *channelname,
|
||||
const char *nametype) {
|
||||
const char *nametype)
|
||||
{
|
||||
int length;
|
||||
|
||||
*dst = 0;
|
||||
|
@ -4661,10 +4615,12 @@ static void capidev_read_name_from_diva_manufacturer_infications (const unsigned
|
|||
dst[length] = 0;
|
||||
}
|
||||
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_3 "%s: received %s Name %02x '%s'\n", channelname, nametype, *octet3a, dst);
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_3 "%s: received %s Name %02x '%s'\n",
|
||||
channelname, nametype, *octet3a, dst);
|
||||
}
|
||||
|
||||
static void capidev_handle_diva_signaling_manufacturer_infications (struct capi_pvt *i, const unsigned char* data) {
|
||||
static void capidev_handle_diva_signaling_manufacturer_infications(struct capi_pvt *i, const unsigned char* data)
|
||||
{
|
||||
int length = *data++;
|
||||
char buffer[CAPI_MAX_STRING];
|
||||
unsigned char octet3a;
|
||||
|
@ -4675,7 +4631,6 @@ static void capidev_handle_diva_signaling_manufacturer_infications (struct capi_
|
|||
1-0 : Screening indicator, 00 - User provided not screened, 01 - User provided, verified and passed, 10 - User provided verified and failed, 11 - Nnetwork provided
|
||||
*/
|
||||
|
||||
|
||||
if (length >= 2) {
|
||||
unsigned short command = read_capi_word(data);
|
||||
data += 2;
|
||||
|
@ -4730,7 +4685,8 @@ static void capidev_handle_manufacturer_indication(_cmsg *CMSG, unsigned int PLC
|
|||
if (CMSG->Info == 0x000a && i->owner != 0) {
|
||||
capidev_handle_diva_signaling_manufacturer_infications(i, MANUFACTURER_IND_MANUDATA(CMSG));
|
||||
} else {
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_3 "%s: Ignored Diva MANUFACTURER_IND Id=0x%04x \n", i->vname, CMSG->Info);
|
||||
cc_verbose(3, 0, VERBOSE_PREFIX_3 "%s: Ignored Diva MANUFACTURER_IND Id=0x%04x \n",
|
||||
i->vname, CMSG->Info);
|
||||
}
|
||||
} else {
|
||||
cc_verbose(3, 1, VERBOSE_PREFIX_3 "%s: Ignored MANUFACTURER_IND Id=0x%x \n",
|
||||
|
@ -5038,7 +4994,8 @@ static void capidev_handle_disconnect_indication(_cmsg *CMSG, unsigned int PLCI,
|
|||
/*
|
||||
* CAPI CONNECT_IND
|
||||
*/
|
||||
static void capidev_handle_connect_indication(_cmsg *CMSG,
|
||||
static void capidev_handle_connect_indication(
|
||||
_cmsg *CMSG,
|
||||
unsigned int PLCI,
|
||||
unsigned int NCCI,
|
||||
struct capi_pvt **interface,
|
||||
|
@ -5260,7 +5217,11 @@ static void capidev_handle_connect_indication(_cmsg *CMSG,
|
|||
/*
|
||||
* CAPI FACILITY_CONF
|
||||
*/
|
||||
static void capidev_handle_facility_confirmation(_cmsg *CMSG, unsigned int PLCI, unsigned int NCCI, struct capi_pvt **i,
|
||||
static void capidev_handle_facility_confirmation(
|
||||
_cmsg *CMSG,
|
||||
unsigned int PLCI,
|
||||
unsigned int NCCI,
|
||||
struct capi_pvt **i,
|
||||
struct ast_channel** interface_owner)
|
||||
{
|
||||
int selector;
|
||||
|
@ -5329,7 +5290,8 @@ static void capidev_handle_facility_confirmation(_cmsg *CMSG, unsigned int PLCI,
|
|||
/*
|
||||
* show error in confirmation
|
||||
*/
|
||||
static void show_capi_conf_error(struct capi_pvt *i,
|
||||
static void show_capi_conf_error(
|
||||
struct capi_pvt *i,
|
||||
unsigned int PLCI, u_int16_t wInfo,
|
||||
u_int16_t wCmd)
|
||||
{
|
||||
|
@ -5714,8 +5676,8 @@ static void capidev_handle_msg(_cmsg *CMSG)
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
static struct capi_pvt* get_active_plci (struct ast_channel *c) {
|
||||
static struct capi_pvt* get_active_plci(struct ast_channel *c)
|
||||
{
|
||||
struct capi_pvt* i;
|
||||
|
||||
if (c->tech == &capi_tech) {
|
||||
|
@ -9070,9 +9032,8 @@ static void pbx_capi_add_diva_protocol_independent_extension (struct capi_pvt *i
|
|||
return;
|
||||
}
|
||||
|
||||
cc_format_t pbx_capi_get_controller_codecs (int controller) {
|
||||
cc_format_t pbx_capi_get_controller_codecs(int controller)
|
||||
{
|
||||
return (capi_controllers[controller]->rtpcodec);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -109,7 +109,8 @@ int pbx_capi_voicecommand(struct ast_channel *c, char *param)
|
|||
*/
|
||||
cc_mutex_lock(&i->lock);
|
||||
while ((cmd = pbx_capi_find_command(i, command[0])) != 0) {
|
||||
cc_verbose(2, 0, VERBOSE_PREFIX_4"%s: voicecommand:%s removed\n", i->vname, cmd->command_name);
|
||||
cc_verbose(2, 0, VERBOSE_PREFIX_4"%s: voicecommand:%s removed\n",
|
||||
i->vname, cmd->command_name);
|
||||
diva_q_remove(&i->channel_command_q, &cmd->link);
|
||||
ast_free (cmd);
|
||||
}
|
||||
|
|
|
@ -245,7 +245,13 @@ struct capi_pvt *capi_mknullif(struct ast_channel *c, unsigned long long control
|
|||
return tmp;
|
||||
}
|
||||
|
||||
struct capi_pvt *capi_mkresourceif(struct ast_channel *c, unsigned long long controllermask, struct capi_pvt *data_plci_ifc, cc_format_t codecs, int all) {
|
||||
struct capi_pvt *capi_mkresourceif(
|
||||
struct ast_channel *c,
|
||||
unsigned long long controllermask,
|
||||
struct capi_pvt *data_plci_ifc,
|
||||
cc_format_t codecs,
|
||||
int all)
|
||||
{
|
||||
struct capi_pvt *data_ifc /*, *line_ifc */;
|
||||
unsigned int controller = 1;
|
||||
int fmt = 0;
|
||||
|
|
Loading…
Reference in New Issue