summaryrefslogtreecommitdiff
path: root/xpp/xpp_zap.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 23:18:31 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 23:18:31 +0000
commitee5282ac097e112e9baf1c760211e6ee0f2a4fe8 (patch)
tree6c1c0866487967f8bdfe847f78662918ed6f7238 /xpp/xpp_zap.c
parent6e2fdc4fdd1f8be1c6d192d5230393489051e40d (diff)
FXO caller-id now works.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1393 5390a7c7-147a-4af0-8ec9-7488f05a26cb
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);