int mISDN_initialize(void)
{
char filename[256];
- int ver;
/* try to open raw socket to check kernel */
mISDNsocket = socket(PF_ISDN, SOCK_RAW, ISDN_P_BASE);
// set debug printout function
myfn.prt_debug = my_mISDNlib_debug;
- ver = init_layer3(4, &myfn); // buffer of 4
+ init_layer3(4, &myfn); // buffer of 4
/* open debug, if enabled and not only stack debugging */
if (options.deb) {
p_m_inband_send_on = 0;
p_m_inband_receive_on = 0;
p_m_dtmf = !mISDNport->ifport->nodtmf;
+ p_m_dtmf_threshold = mISDNport->ifport->dtmf_threshold;
memset(&p_m_timeout, 0, sizeof(p_m_timeout));
add_timer(&p_m_timeout, mISDN_timeout, this, 0);
SCPY(p_m_pipeline, mISDNport->ifport->interface->pipeline);
struct mISDNhead *ctrl = (struct mISDNhead *)buffer;
unsigned int *d = (unsigned int *)(buffer+MISDN_HEADER_LEN);
int ret;
+ int len = 8;
if (sock < 0)
return;
+ if (c1 == DTMF_TONE_START && c2 == 0) {
+ len = 4;
+ }
+
ctrl->prim = PH_CONTROL_REQ;
ctrl->id = 0;
*d++ = c1;
*d++ = c2;
- ret = sendto(sock, buffer, MISDN_HEADER_LEN+sizeof(int)*2, 0, NULL, 0);
+ ret = sendto(sock, buffer, MISDN_HEADER_LEN+len, 0, NULL, 0);
if (ret <= 0)
PERROR("Failed to send to socket %d\n", sock);
chan_trace_header(mISDNport, isdnport, "BCHANNEL control", DIRECTION_OUT);
// if (port->p_m_txmix && mode == B_MODE_TRANSPARENT)
// ph_control(mISDNport, port, handle, DSP_MIX_ON, 0, "DSP-MIX", 1);
if (port->p_m_dtmf && mode == B_MODE_TRANSPARENT)
- ph_control(mISDNport, port, handle, DTMF_TONE_START, 0, "DSP-DTMF", 1);
+ ph_control(mISDNport, port, handle, DTMF_TONE_START, port->p_m_dtmf_threshold, "DSP-DTMF", 1);
if (port->p_m_crypt && mode == B_MODE_TRANSPARENT)
ph_control_block(mISDNport, port, handle, DSP_BF_ENABLE_KEY, port->p_m_crypt_key, port->p_m_crypt_key_len, "DSP-CRYPT", port->p_m_crypt_key_len);
}
class PmISDN *b_port = mISDNport->b_port[i];
int state = mISDNport->b_state[i];
int timer = -1; // no change
+#if 0
int p_m_tx_gain = 0;
int p_m_rx_gain = 0;
char *p_m_pipeline = NULL;
p_m_crypt_key_len = b_port->p_m_crypt_key_len;
p_m_crypt_key_type = /*b_port->p_m_crypt_key_type*/1;
}
+#endif
switch(event) {
case B_EVENT_USE:
if (p_type == PORT_TYPE_POTS_FXS_IN && p_state == PORT_STATE_IN_OVERLAP) {
class Pfxs *pfxs = (class Pfxs *)this;
if (!pfxs->p_m_fxs_allow_dtmf) {
- PDEBUG(DEBUG_PORT, "PmISDN(%s) DTMF for FXS not yet allowed\n", p_name);
+ PDEBUG(DEBUG_PORT, "PmISDN(%s) DTMF for FXS currently disabled\n", p_name);
return;
}
SCCAT(p_dialinginfo.id, cont & DTMF_TONE_MASK);
struct mbuffer *mb;
struct l3_msg *l3m;
char byte;
- int ret;
+ int __attribute__((__unused__)) ret;
/* unset global semaphore */
upqueue_avail = 0;
// this is no problem.
upqueue_avail = 1;
char byte = 0;
- int ret;
+ int __attribute__((__unused__)) ret;
ret = write(upqueue_pipe[1], &byte, 1);
}
return 0;
return (port);
}
+#ifdef ISDN_P_FXS_POTS
/* handle frames from pots */
static int pots_sock_callback(struct lcr_fd *fd, unsigned int what, void *instance, int i)
{
return 0;
}
+#endif
/*
* global function to add a new card (port)