unsigned long *d = (unsigned long *)(buffer+MISDN_HEADER_LEN);
int ret;
- CDEBUG(NULL, NULL, "Sending PH_CONTROL %d,%d\n", c1, c2);
+ CDEBUG(NULL, NULL, "Sending PH_CONTROL %s %x,%x\n", trace_name, c1, c2);
ctrl->prim = PH_CONTROL_REQ;
ctrl->id = 0;
*d++ = c1;
ret = sendto(handle, buffer, MISDN_HEADER_LEN+sizeof(int)*2, 0, NULL, 0);
if (ret < 0)
CERROR(NULL, NULL, "Failed to send to socket %d\n", handle);
-#if 0
- chan_trace_header(mISDNport, isdnport, "BCHANNEL control", DIRECTION_OUT);
- if (c1 == CMX_CONF_JOIN)
- add_trace(trace_name, NULL, "0x%08x", trace_value);
- else
- add_trace(trace_name, NULL, "%d", trace_value);
- end_trace();
-#endif
}
static void ph_control_block(unsigned long handle, unsigned long c1, void *c2, int c2_len, char *trace_name, int trace_value)
unsigned long *d = (unsigned long *)(buffer+MISDN_HEADER_LEN);
int ret;
- CDEBUG(NULL, NULL, "Sending PH_CONTROL (block) %d\n", c1);
+ CDEBUG(NULL, NULL, "Sending PH_CONTROL (block) %s %x\n", trace_name, c1);
ctrl->prim = PH_CONTROL_REQ;
ctrl->id = 0;
*d++ = c1;
ret = sendto(handle, buffer, MISDN_HEADER_LEN+sizeof(int)+c2_len, 0, NULL, 0);
if (ret < 0)
CERROR(NULL, NULL, "Failed to send to socket %d\n", handle);
-#if 0
- chan_trace_header(mISDNport, isdnport, "BCHANNEL control", DIRECTION_OUT);
- add_trace(trace_name, NULL, "%d", trace_value);
- end_trace();
-#endif
}
add_trace("DTMF", NULL, "%c", cont & DTMF_TONE_MASK);
end_trace();
#endif
- if (bchannel->rx_dtmf)
- bchannel->rx_dtmf(bchannel, cont & DTMF_TONE_MASK);
+ if (bchannel->call)
+ lcr_in_dtmf(bchannel->call, cont & DTMF_TONE_MASK);
return;
}
switch(cont)
/*
+ * dtmf bchannel
+ */
+void bchannel_dtmf(struct bchannel *bchannel, int on)
+{
+ int handle;
+
+ handle = bchannel->b_sock;
+ bchannel->b_dtmf = 1;
+ if (bchannel->b_state == BSTATE_ACTIVE)
+ ph_control(handle, on?DTMF_TONE_START:DTMF_TONE_STOP, 0, "DSP-DTMF", 1);
+}
+
+
+/*
* main loop for processing messages from mISDN
*/
int bchannel_handle(void)