[PATCH] AT2 module UDH decoding
Paul Bagyenda <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi people, Just came across a small discrepancy between how the SMPP module decodes MO SMS UDH and how the AT2 module does the same. (To be precise, somebody was testing the incoming concatenation patch I posted earlier, and tripped on this.) The short story is that the SMPP module includes the header length in the decoded UDH, while the AT2 module does not. The fix is a one- liner (not the cleanest I admit, but it works). Attached. Paul.
smsc_at.diff
(application/octet-stream, 611 B)
Index: gw/smsc/smsc_at.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_at.c,v
retrieving revision 1.32
diff -u -r1.32 smsc_at.c
--- gw/smsc/smsc_at.c 6 Oct 2006 15:24:39 -0000 1.32
+++ gw/smsc/smsc_at.c 24 Nov 2006 05:03:57 -0000
@@ -1731,7 +1731,7 @@
pos++;
if (udhlen + 1 > len)
goto msg_error;
- udh = octstr_copy(pdu, pos, udhlen);
+ udh = octstr_copy(pdu, pos-1, udhlen+1);
pos += udhlen;
len -= udhlen + 1;
} else if (len <= 0) /* len < 0 is impossible, but sure is sure */