]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
"Caller*ID failed checksum" on Wildcard TDM2400P and TDM410
authorRichard Mudgett <rmudgett@digium.com>
Mon, 14 Mar 2011 16:38:24 +0000 (16:38 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 14 Mar 2011 16:38:24 +0000 (16:38 +0000)
The last character in the caller id message is getting a framing error.

The checksum is the last character in the message.  A framing error in the
checksum could be because:
1) The sender did not send a full stop bit.
2) The sender cut off the FSK carrier too soon.
3) The sender opted to send zero of the specified zero to 10 trailing mark
bits and round-off errors in the code resulted in the code not being where
it thought it was in the demodulated bit stream.

Bit 8 of 'b' is set when parity error.
Bit 9 of 'b' is set when framing error.

Made ignore the framing and parity error bits if the errored character is
the checksum.  We can tolerate a framing/parity error there.  The checksum
character validates the message.

(closes issue #18474)
Reported by: nivek
Patches:
      callerid.c.1.patch uploaded by nivek (license 636) (with modifications)
Tested by: nivek

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@310633 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/callerid.c

index e08d96b4c6082fdece1a990dff3a95145cf494b1..10ad9f1437c20bee48c07829bc4d2f74207deea9 100644 (file)
@@ -572,9 +572,22 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
                        return -1;
                }
                if (res == 1) {
-                       /* Ignore invalid bytes */
-                       if (b > 0xff)
-                               continue;
+                       if (b > 0xff) {
+                               if (cid->sawflag != 5) {
+                                       /* Ignore invalid bytes */
+                                       continue;
+                               }
+                               /*
+                                * We can tollerate an error on the checksum character since the
+                                * checksum character is the last character in the message and
+                                * it validates the message.
+                                *
+                                * Remove character error flags.
+                                * Bit 8 : Parity error
+                                * Bit 9 : Framing error
+                                */
+                               b &= 0xff;
+                       }
                        switch(cid->sawflag) {
                        case 0: /* Look for flag */
                                if (b == 'U')