mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 19:28:53 +00:00
Version 0.1.11 from FTP
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
callerid.c
11
callerid.c
@@ -43,7 +43,8 @@ struct callerid_state {
|
|||||||
int len;
|
int len;
|
||||||
};
|
};
|
||||||
|
|
||||||
float dr[4], di[4];
|
|
||||||
|
float cid_dr[4], cid_di[4];
|
||||||
float clidsb = 8000.0 / 1200.0;
|
float clidsb = 8000.0 / 1200.0;
|
||||||
|
|
||||||
#define CALLERID_SPACE 2200.0 /* 2200 hz for "0" */
|
#define CALLERID_SPACE 2200.0 /* 2200 hz for "0" */
|
||||||
@@ -52,10 +53,10 @@ float clidsb = 8000.0 / 1200.0;
|
|||||||
void callerid_init(void)
|
void callerid_init(void)
|
||||||
{
|
{
|
||||||
/* Initialize stuff for inverse FFT */
|
/* Initialize stuff for inverse FFT */
|
||||||
dr[0] = cos(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
cid_dr[0] = cos(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||||
di[0] = sin(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
cid_di[0] = sin(CALLERID_SPACE * 2.0 * M_PI / 8000.0);
|
||||||
dr[1] = cos(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
cid_dr[1] = cos(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||||
di[1] = sin(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
cid_di[1] = sin(CALLERID_MARK * 2.0 * M_PI / 8000.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct callerid_state *callerid_new(void)
|
struct callerid_state *callerid_new(void)
|
||||||
|
@@ -139,16 +139,16 @@ extern int ast_isphonenumber(char *n);
|
|||||||
* routines (used by ADSI for example)
|
* routines (used by ADSI for example)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern float dr[4];
|
extern float cid_dr[4];
|
||||||
extern float di[4];
|
extern float cid_di[4];
|
||||||
extern float clidsb;
|
extern float clidsb;
|
||||||
|
|
||||||
static inline float callerid_getcarrier(float *cr, float *ci, int bit)
|
static inline float callerid_getcarrier(float *cr, float *ci, int bit)
|
||||||
{
|
{
|
||||||
/* Move along. There's nothing to see here... */
|
/* Move along. There's nothing to see here... */
|
||||||
float t;
|
float t;
|
||||||
t = *cr * dr[bit] - *ci * di[bit];
|
t = *cr * cid_dr[bit] - *ci * cid_di[bit];
|
||||||
*ci = *cr * di[bit] + *ci * dr[bit];
|
*ci = *cr * cid_di[bit] + *ci * cid_dr[bit];
|
||||||
*cr = t;
|
*cr = t;
|
||||||
|
|
||||||
t = 2.0 - (*cr * *cr + *ci * *ci);
|
t = 2.0 - (*cr * *cr + *ci * *ci);
|
||||||
|
Reference in New Issue
Block a user