Module: kamailio
Branch: master
Commit: 7be63c5b4218e6888220ccc2cce89f2e7ec7b93e
URL: 
https://github.com/kamailio/kamailio/commit/7be63c5b4218e6888220ccc2cce89f2e7ec7b93e

Author: Holger Hans Peter Freyther <hol...@moiji-mobile.com>
Committer: Holger Freyther <holger+git...@freyther.de>
Date: 2016-11-16T17:59:38+01:00

ss7ops: Solely rely on odd/even indicator for BCD decoding

In contrast to GSM we want to see the 'F' digits. Rely on the
odd/even indicator to see if the last nibble should be parsed
or not.

---

Modified: modules/ss7ops/isup_parsed.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7be63c5b4218e6888220ccc2cce89f2e7ec7b93e.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7be63c5b4218e6888220ccc2cce89f2e7ec7b93e.patch

---

diff --git a/modules/ss7ops/isup_parsed.c b/modules/ss7ops/isup_parsed.c
index 2c2efbe..df82cb4 100644
--- a/modules/ss7ops/isup_parsed.c
+++ b/modules/ss7ops/isup_parsed.c
@@ -180,14 +180,12 @@ static inline void decode_bcd(char *dest, const uint8_t 
*data, size_t len, int o
                uint8_t lo = data[i] & 0x0F;
                uint8_t hi = (data[i] & 0xF0) >> 4;
 
-               if (lo != 0x0F)
-                       *dest++ = from_bcd(lo);
+               *dest++ = from_bcd(lo);
 
                /* ignore the last digit */
                if (i + 1 == len && odd)
                        break;
-               if (hi != 0x0F)
-                       *dest++ = from_bcd(hi);
+               *dest++ = from_bcd(hi);
        }
        *dest = '\0';
 }


_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to