e_ext.tout_disconnect = 120;
// e_ext.tout_hold = 900;
// e_ext.tout_park = 900;
- e_ext.rxvol = e_ext.txvol = 256;
+ e_ext.rxvol = e_ext.txvol = 0;
e_state = EPOINT_STATE_IDLE;
e_ext.number[0] = '\0';
e_extension_interface[0] = '\0';
/* set volume of rx and tx */
if (param->setup.callerinfo.itype == INFO_ITYPE_ISDN_EXTENSION)
- if (e_ext.txvol!=256 || e_ext.rxvol!=256)
+ if (e_ext.txvol!=0 || e_ext.rxvol!=0)
{
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
new_state(EPOINT_STATE_CONNECT);
/* set volume of rx and tx */
- if (e_ext.txvol!=256 || e_ext.rxvol!=256)
+ if (e_ext.txvol!=0 || e_ext.rxvol!=0)
{
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
message->param.mISDNsignal.message = mISDNSIGNAL_VOLUME;
case INFO_NOTIFY_USER_RESUMED:
/* set volume of rx and tx */
if (param->setup.callerinfo.itype == INFO_ITYPE_ISDN_EXTENSION)
- if (e_ext.txvol!=256 || e_ext.rxvol!=256)
+ if (e_ext.txvol!=0 || e_ext.rxvol!=0)
if (portlist)
{
message = message_create(ea_endpoint->ep_serial, portlist->port_id, EPOINT_TO_PORT, MESSAGE_mISDNSIGNAL);
ifport->nodtmf = 1;
return(0);
}
-#warning filter to be done
-#if 0
static int inter_filter(struct interface *interface, char *filename, int line, char *parameter, char *value)
{
+ char *p, *q;
+
+ /* seperate parameter from filter */
+ p = value;
+ while(*p > 32)
+ p++;
+ if (*p)
+ {
+ *p++ = 0;
+ while(*p > 0 && *p <= 32)
+ p++;
+ }
+
+ if (!strcasecmp(value, "gain"))
+ {
+ q = p;
+ while(*q > 32)
+ q++;
+ if (*q)
+ {
+ *q++ = 0;
+ while(*q > 0 && *q <= 32)
+ q++;
+ }
+ if (*p == 0 || *q == 0)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' expects two gain values.\n", filename, line, parameter, value);
+ return(-1);
+ }
+ if (atoi(p)<-8 || atoi(p)>8 || atoi(q)<-8 || atoi(q)>8)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' gain values not in range. (-8...8)\n", filename, line, parameter, value);
+ return(-1);
+ }
+ interface->gain_tx = atoi(p);
+ interface->gain_rx = atoi(q);
+ } else
+ if (!strcasecmp(value, "pipeline"))
+ {
+ if (*p == 0)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' expects pipeline string.\n", filename, line, parameter, value);
+ return(-1);
+ }
+ SCPY(interface->pipeline, p);
+ } else
+ if (!strcasecmp(value, "blowfish"))
+ {
+ unsigned char key[56];
+ int l;
+
+ if (!!strncmp(p, "0x", 2))
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' expects blowfish key starting with '0x'.\n", filename, line, parameter, value);
+ return(-1);
+ }
+ p += 2;
+ l = 0;
+ while(*p)
+ {
+ if (l == 56)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' key too long.\n", filename, line, parameter, value);
+ return(-1);
+ }
+ if (*p >= '0' && *p <= '9')
+ key[l] = (*p-'0')<<4;
+ else if (*p >= 'a' && *p <= 'f')
+ key[l] = (*p-'a'+10)<<4;
+ else if (*p >= 'A' && *p <= 'F')
+ key[l] = (*p-'A'+10)<<4;
+ else
+ {
+ digout:
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' key has digits out of range. (0...9, a...f)\n", filename, line, parameter, value);
+ return(-1);
+ }
+ p++;
+ if (*p == 0)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' key must end on an 8 bit boundary (two character boundary).\n", filename, line, parameter, value);
+ return(-1);
+ }
+ if (*p >= '0' && *p <= '9')
+ key[l] = (*p-'0')<<4;
+ else if (*p >= 'a' && *p <= 'f')
+ key[l] = (*p-'a'+10)<<4;
+ else if (*p >= 'A' && *p <= 'F')
+ key[l] = (*p-'A'+10)<<4;
+ else
+ goto digout;
+ p++;
+ l++;
+ }
+ if (l < 4)
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s %s' key must be at least 4 bytes (8 characters).\n", filename, line, parameter, value);
+ return(-1);
+ }
+ memcpy(interface->bf_key, key, l);
+ interface->bf_len = l;
+ } else
+ {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s' has unknown filter '%s'.\n", filename, line, parameter, value);
+ return(-1);
+ }
return(0);
}
-#endif
/*
"This parameter must follow a 'port' parameter."},
#endif
-#if 0
-#warning todo: filter, also in the PmISDN object
- {"filter", &inter_filter, "<filter> [parameters]",
+ {"filter", &inter_filter, "<filter> <parameters>",
"Adds/appends a filter. Filters are ordered in transmit direction.\n"
"gain <tx-volume> <rx-volume> - Changes volume (-8 .. 8)\n"
+ "pipeline <string> - Sets echo cancelation pipeline.\n"
"blowfish <key> - Adds encryption. Key must be 4-56 bytes (8-112 hex characters."},
-#endif
{NULL, NULL, NULL, NULL}
};
struct select_channel *selchannel;
struct interface_msn *ifmsn;
struct interface_screen *ifscreen;
- struct interface_filter *iffilter;
while(interface)
{
FREE(temp, sizeof(struct interface_screen));
memuse--;
}
- iffilter = interface->iffilter;
- while(iffilter)
- {
- temp = iffilter;
- iffilter = iffilter->next;
- FREE(temp, sizeof(struct interface_filter));
- memuse--;
- }
temp = interface;
interface = interface->next;
FREE(temp, sizeof(struct interface));
int result_present; /* presentation type */
};
-struct interface_filter {
- struct interface_filter *next;
- int filter; /* filter to use */
- char parameter[256]; /* filter parameter */
-};
-
struct interface {
struct interface *next;
char name[64]; /* name of interface */
struct interface_msn *ifmsn; /* link to interface msn list */
struct interface_screen *ifscreen_in; /* link to screening list */
struct interface_screen *ifscreen_out; /* link to screening list */
- struct interface_filter *iffilter; /* link to filter list */
+ int gain_tx, gain_rx; /* filter gain */
+ char pipeline[256]; /* filter pipeline */
+ unsigned char bf_key[56]; /* filter blowfish */
+ int bf_len; /* filter length of blowfish */
};
struct interface_param {
p_m_b_reserve = 0;
p_m_delete = 0;
p_m_hold = 0;
- p_m_txvol = p_m_rxvol = 0;
+ p_m_txvol = mISDNport->ifport->interface->gain_tx;
+ p_m_rxvol = mISDNport->ifport->interface->gain_rx;
p_m_conf = 0;
p_m_txdata = 0;
p_m_delay = 0;
p_m_timer = 0;
p_m_remote_ref = 0; /* channel shall be exported to given remote */
p_m_remote_id = 0; /* channel shall be exported to given remote */
-
+ SCPY(p_m_pipeline, mISDNport->ifport->interface->pipeline);
+
/* audio */
p_m_load = 0;
p_m_last_tv_sec = 0;
p_m_crypt_msg_len = 0;
p_m_crypt_msg[0] = '\0';
p_m_crypt_msg_current = 0;
- p_m_crypt_key[0] = '\0';
p_m_crypt_key_len = 0;
p_m_crypt_listen = 0;
p_m_crypt_listen_state = 0;
p_m_crypt_listen_len = 0;
p_m_crypt_listen_msg[0] = '\0';
p_m_crypt_listen_crc = 0;
+ if (mISDNport->ifport->interface->bf_len >= 4 && mISDNport->ifport->interface->bf_len <= 56)
+ {
+ memcpy(p_m_crypt_key, mISDNport->ifport->interface->bf_key, p_m_crypt_key_len);
+ p_m_crypt_key_len = mISDNport->ifport->interface->bf_len;
+ p_m_crypt = 1;
+ }
/* if any channel requested by constructor */
if (channel == CHANNEL_ANY)
ph_control(mISDNport, port, handle, VOL_CHANGE_TX, port->p_m_txvol, "DSP-TXVOL", port->p_m_txvol);
if (port->p_m_rxvol)
ph_control(mISDNport, port, handle, VOL_CHANGE_RX, port->p_m_rxvol, "DSP-RXVOL", port->p_m_rxvol);
+ if (port->p_m_pipeline[0])
+ ph_control_block(mISDNport, port, handle, PIPELINE_CFG, port->p_m_pipeline, strlen(port->p_m_pipeline)+1, "DSP-PIPELINE", 0);
if (port->p_m_conf)
ph_control(mISDNport, port, handle, CMX_CONF_JOIN, port->p_m_conf, "DSP-CONF", port->p_m_conf);
if (port->p_m_echo)
struct mISDNport *p_m_mISDNport; /* pointer to port */
int p_m_delay; /* use delay instead of dejitter */
int p_m_txvol, p_m_rxvol; /* volume shift (0 = no change) */
+ char p_m_pipeline[256]; /* filter pipeline */
int p_m_echo, p_m_conf; /* remote echo, conference number */
int p_m_tone; /* current kernel space tone */
int p_m_rxoff; /* rx from driver is disabled */
"strip", "Remove digits that were required to match this rule."},
{ PARAM_APPLICATION,
"application",PARAM_TYPE_STRING,
- "application", "Name of remote application to make call to."},
+ "application=<name>", "Name of remote application to make call to."},
{ 0, NULL, 0, NULL, NULL}
};
+
+fuer asterisk: dejitter tx_buffer in dsp.o
+
+
layer-2-hold interface feature
neue params zum aufbau eines externen/internen calls
neuen partyline-param dokumentieren
dokumentieren: aufzeichnung der ansage mit 0 ohne beep beenden
+doku: gain, pipeline, crypt
make asterisk call implementation