From 9bf05e0bdb388ace37131b8400e05db848158ac5 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Mon, 2 Jan 2023 21:33:16 +0100 Subject: [PATCH] Caller ID: Send length of DTAS and mark signal correctly --- src/pstn/callerid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pstn/callerid.c b/src/pstn/callerid.c index 4258f88..5d8b132 100644 --- a/src/pstn/callerid.c +++ b/src/pstn/callerid.c @@ -45,7 +45,7 @@ #define DBV_TO_DBM -0.086 /* impedance 1020 Ohms */ #define DTAS_TX_DBV -16.0 /* relative to 1 Volt RMS */ -#define DTAS_DURATION 0.100 /* 100 ms */ +#define DTAS2_DURATION 0.080 /* 80 ms (DT-AS Off-Hook) */ #define FSK_TX_DBV -15.5 /* relative to 1 Volt RMS */ #define FSK_BAUD_RATE 1200 #define FSK_BIT_ADJUST 0.5 /* must be 0.5 to completely sync each bit */ @@ -235,7 +235,7 @@ int callerid_set(callerid_t *cid, int cw, int dt_as, const char *callerid, uint8 cid->pos = 0; cid->bpos = 0; cid->seize = (cw) ? 0 : 300; - cid->mark = 180; + cid->mark = (cw) ? 80 : 180; if (dt_as) { cid->state = CID_STATE_WAIT_DTAS; cid->wait = (int)(WAIT_CW_DTAS * (double)cid->samplerate); @@ -319,7 +319,7 @@ again: cid->dtas_phaseshift65536[1] = TONE_DTAS_2 / (double)cid->samplerate * 65536.0; cid->dtas_phase65536[0] = 0.0; cid->dtas_phase65536[1] = 0.0; - cid->dt_as_count = (int)(DTAS_DURATION * (double)cid->samplerate); + cid->dt_as_count = (int)(DTAS2_DURATION * (double)cid->samplerate); PDEBUG(DDSP, DEBUG_DEBUG, "Now start DT_AS transmission.\n"); break; case CID_STATE_WAIT_DTMF: