summaryrefslogtreecommitdiffstats
path: root/bchannel.c
diff options
context:
space:
mode:
authorSuper User2008-06-06 15:18:59 +0200
committerSuper User2008-06-06 15:18:59 +0200
commitcbc232643c7b26d64204ba7f6151007e9c0267e4 (patch)
treede9d04deac87922f6e8a6a6e0f1e4654d12a0706 /bchannel.c
parentfixed bad bug in opening bchannel (diff)
downloadlcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.tar.gz
lcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.tar.xz
lcr-cbc232643c7b26d64204ba7f6151007e9c0267e4.zip
work on chan_lcr: bridging works, interface selection possible
modified: Makefile modified: apppbx.cpp modified: apppbx.h modified: bchannel.c modified: bchannel.h modified: chan_lcr.c modified: chan_lcr.h modified: dss1.cpp modified: genext.c modified: joinremote.cpp modified: joinremote.h modified: mISDN.cpp modified: mISDN.h modified: macro.h modified: main.c modified: message.h modified: options.c modified: options.h modified: socket_server.c
Diffstat (limited to 'bchannel.c')
-rw-r--r--bchannel.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/bchannel.c b/bchannel.c
index 3db3bc5..9d7db44 100644
--- a/bchannel.c
+++ b/bchannel.c
@@ -70,7 +70,7 @@ static void ph_control(unsigned long handle, unsigned long c1, unsigned long c2,
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;
@@ -78,14 +78,6 @@ static void ph_control(unsigned long handle, unsigned long c1, unsigned long c2,
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)
@@ -95,7 +87,7 @@ static void ph_control_block(unsigned long handle, unsigned long c1, void *c2, i
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;
@@ -103,11 +95,6 @@ static void ph_control_block(unsigned long handle, unsigned long c1, void *c2, i
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
}
@@ -280,8 +267,8 @@ static void bchannel_receive(struct bchannel *bchannel, unsigned long prim, unsi
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)
@@ -411,6 +398,20 @@ void bchannel_join(struct bchannel *bchannel, unsigned short id)
/*
+ * 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)