summaryrefslogtreecommitdiff
path: root/xpp/xpp_zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/xpp_zap.c')
-rw-r--r--xpp/xpp_zap.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c
index e0e3560..b6bb618 100644
--- a/xpp/xpp_zap.c
+++ b/xpp/xpp_zap.c
@@ -403,6 +403,10 @@ static int xpd_read_proc(char *page, char **start, off_t off, int count, int *eo
for_each_line(xpd, i) {
len += sprintf(page + len, "%d ", IS_SET(xpd->offhook, i));
}
+ len += sprintf(page + len, "\n\t%-17s: ", "cid_on");
+ for_each_line(xpd, i) {
+ len += sprintf(page + len, "%d ", IS_SET(xpd->cid_on, i));
+ }
len += sprintf(page + len, "\n\t%-17s: ", "ringing");
for_each_line(xpd, i) {
len += sprintf(page + len, "%d ", xpd->ringing[i]);
@@ -637,6 +641,7 @@ void update_line_status(xpd_t *xpd, int pos, bool to_offhook)
zt_hooksig(chan, ZT_RXSIG_OFFHOOK);
} else {
BIT_CLR(xpd->offhook, pos);
+ BIT_CLR(xpd->cid_on, pos);
zt_hooksig(chan, ZT_RXSIG_ONHOOK);
}
}
@@ -654,10 +659,13 @@ void update_zap_ring(xpd_t *xpd, int pos, bool on)
* it may call back into our xpp_hooksig() and cause
* a nested spinlock scenario
*/
- if(on)
+ if(on) {
+ BIT_CLR(xpd->cid_on, pos);
zt_hooksig(chan, ZT_RXSIG_RING);
- else
+ } else {
+ BIT_SET(xpd->cid_on, pos);
zt_hooksig(chan, ZT_RXSIG_OFFHOOK);
+ }
}
#ifdef CONFIG_PROC_FS
@@ -978,7 +986,7 @@ static void xpp_receiveprep(xpd_t *xpd)
}
for (i = 0; i < channels; i++) {
- if(IS_SET(xpd->offhook, i)) {
+ if(IS_SET(xpd->offhook, i) || IS_SET(xpd->cid_on, i)) {
// memset((u_char *)readchunk, 0x5A, ZT_CHUNKSIZE); // DEBUG
// fill_beep((u_char *)readchunk, 1); // DEBUG: BEEP
memcpy(chans[i].readchunk, (u_char *)readchunk, ZT_CHUNKSIZE);