int ret;
struct sockaddr_mISDN addr;
+ memset(&addr, 0, sizeof(addr));
+
if (mISDNport->b_sock[i].inuse) {
PERROR("Error: Socket already created for index %d\n", i);
return(0);
p_m_load = 0;
/* to send data, tone must be on */
- if ((p_tone_name[0] || p_m_crypt_msg_loops || p_m_inband_send_on) /* what tones? */
+ if ((p_tone_name[0] || p_dov_tx || p_m_crypt_msg_loops || p_m_inband_send_on) /* what tones? */
&& (p_m_load < p_m_preload) /* not too much load? */
&& (p_state==PORT_STATE_CONNECT || p_m_mISDNport->tones || p_m_inband_send_on)) { /* connected or inband-tones? */
int tosend = p_m_preload - p_m_load, length;
tosend -= length;
}
+ /* copy dov */
+ if (p_dov_tx) {
+ tosend -= dov_tx(p, tosend);
+ }
+
/* copy tones */
if (p_tone_name[0] && tosend) {
tosend -= read_audio(p, tosend);
return;
}
+ /* dov is processed */
+ if (p_dov_rx)
+ dov_rx(data, len);
+
/* inband is processed */
if (p_m_inband_receive_on)
inband_receive(data, len);
/* if no directory is given (by extension), we use interface.conf or options.conf */
if (!dir || !dir[0]) {
- if (p_m_mISDNport->ifport->tones_dir[0])
- dir = p_m_mISDNport->ifport->tones_dir;
- else if (options.tones_dir[0])
+ if (p_tones_interface[0])
+ dir = p_tones_interface;
+ else
dir = options.tones_dir;
}
}
+/* MESSAGE_VOOTP */
+void PmISDN::message_vootp(unsigned int epoint_id, int message_id, union parameter *param)
+{
+ struct lcr_msg *message;
+
+ message = message_create(p_serial, ACTIVE_EPOINT(p_epointlist), PORT_TO_EPOINT, MESSAGE_UPDATEBRIDGE);
+ message_put(message);
+
+#if 0
+does not make sense, since remote port may dejitter
+ if (param->vootp.enable) {
+ PDEBUG(DEBUG_ISDN, "PmISDN(%s) received vootp enable order, so we disable de-jitter.\n", p_name);
+ p_m_disable_dejitter = 1;
+ }
+#endif
+ update_rxoff();
+}
+
/*
* endpoint sends messages to the port
*/
int PmISDN::message_epoint(unsigned int epoint_id, int message_id, union parameter *param)
{
+ /* messages also handled by base class */
+ switch(message_id) {
+ case MESSAGE_VOOTP: /* crypt control command */
+ PDEBUG(DEBUG_ISDN, "PmISDN(%s) received VoOTP encryption\n", p_name);
+ message_vootp(epoint_id, message_id, param);
+ break;
+ }
+
if (Port::message_epoint(epoint_id, message_id, param)) {
if (message_id == MESSAGE_BRIDGE)
update_rxoff();
return 1;
}
+ /* messages not handled by base class */
switch(message_id) {
case MESSAGE_mISDNSIGNAL: /* user command */
PDEBUG(DEBUG_ISDN, "PmISDN(%s) received special ISDN SIGNAL %d.\n", p_name, param->mISDNsignal.message);
int tx_dejitter = 0;
/* call bridges in user space OR crypto OR recording */
- if (p_bridge || p_m_crypt_msg_loops || p_m_crypt_listen || p_record || p_tap || p_m_inband_receive_on) {
+ if (p_bridge || p_m_crypt_msg_loops || p_m_crypt_listen || p_record || p_tap || p_m_inband_receive_on || p_dov_rx) {
/* rx IS required */
if (p_m_rxoff) {
/* turn on RX */
struct mISDN_devinfo devinfo;
int port = 0, ret;
+ memset(&devinfo, 0, sizeof(devinfo));
+
/* resolve name */
while (port < cnt) {
devinfo.id = port;
struct mISDN_devinfo devinfo;
unsigned int protocol, prop;
+ memset(&devinfo, 0, sizeof(devinfo));
+
/* check port counts */
ret = ioctl(mISDNsocket, IMGETCOUNT, &cnt);
if (ret < 0) {
struct mISDNhead *hh = (struct mISDNhead *)buf;
int ret;
+ if ((ret = Port::bridge_rx(data, length)))
+ return ret;
+
if (p_m_b_index < 0)
return -EIO;
if (p_m_mISDNport->b_state[p_m_b_index] != B_STATE_ACTIVE)
/* check if high priority tones exist
* ignore data in this case
*/
- if (p_tone_name[0] || p_m_crypt_msg_loops || p_m_inband_send_on)
+ if (p_tone_name[0] || p_dov_tx || p_m_crypt_msg_loops || p_m_inband_send_on)
return -EBUSY;
/* preload procedure