summaryrefslogtreecommitdiff
path: root/main/callerid.c
diff options
context:
space:
mode:
authorDoug Bailey <dbailey@digium.com>2007-08-06 19:52:40 +0000
committerDoug Bailey <dbailey@digium.com>2007-08-06 19:52:40 +0000
commit3e426df072336d404b0a3ba4359b014dc5aa3af8 (patch)
treee0afd225c0798db143d3f9595132802a471ea894 /main/callerid.c
parent8f17952065ac267e524701d383533a3ef45f6b62 (diff)
Change the fsk filter used in CID and TDD decode to an integer based implementation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/callerid.c')
-rw-r--r--main/callerid.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/main/callerid.c b/main/callerid.c
index 6e3cb9514..4777f1728 100644
--- a/main/callerid.c
+++ b/main/callerid.c
@@ -134,17 +134,23 @@ struct callerid_state *callerid_new(int cid_signalling)
struct callerid_state *cid;
if ((cid = ast_calloc(1, sizeof(*cid)))) {
- cid->fskd.spb = 7.0; /* 1200 baud */
+ cid->fskd.ispb = 7; /* 1200 baud */
+ /* Set up for 1200 / 8000 freq *32 to allow ints */
+ cid->fskd.pllispb = (int)(8000 * 32 / 1200);
+ cid->fskd.pllids = cid->fskd.pllispb/32;
+ cid->fskd.pllispb2 = cid->fskd.pllispb/2;
+
+ cid->fskd.icont = 0; /* PLL REset */
/* cid->fskd.hdlc = 0; */ /* Async */
cid->fskd.nbit = 8; /* 8 bits */
- cid->fskd.nstop = 1.0; /* 1 stop bit */
+ cid->fskd.instop = 1; /* 1 stop bit */
/* cid->fskd.paridad = 0; */ /* No parity */
cid->fskd.bw = 1; /* Filter 800 Hz */
if (cid_signalling == 2) { /* v23 signalling */
- cid->fskd.f_mark_idx = 4; /* 1300 Hz */
+ cid->fskd.f_mark_idx = 4; /* 1300 Hz */
cid->fskd.f_space_idx = 5; /* 2100 Hz */
} else { /* Bell 202 signalling as default */
- cid->fskd.f_mark_idx = 2; /* 1200 Hz */
+ cid->fskd.f_mark_idx = 2; /* 1200 Hz */
cid->fskd.f_space_idx = 3; /* 2200 Hz */
}
/* cid->fskd.pcola = 0; */ /* No clue */
@@ -153,6 +159,8 @@ struct callerid_state *callerid_new(int cid_signalling)
/* cid->fskd.state = 0; */
cid->flags = CID_UNKNOWN_NAME | CID_UNKNOWN_NUMBER;
/* cid->pos = 0; */
+
+ fskmodem_init(&cid->fskd);
}
return cid;