Core issue
This problem occurs due to the presence of Cisco bug IDs CSCsg13065 and CSCin61143.
The reason for this behavior is when you Malloc space for the Calling Line ID (CLID) and Digital Number Identification Service (DNIS), you Malloc the proper amount (the strlen() plus 1 for a NULL terminator). However, you can switch to use snprintf() in order to populate these fields. This function takes the length of the string and always appends a NULL byte to it.
Since the length of the string (strlen(clid)) does not contain the NULL byte, when snprintf appends this byte, it overwrites the last character of the string. This causes the DNIS and CLID to be incorrect and the last digit to be stripped.
Resolution
As a workaround, download and upgrade the Cisco IOS software to any one of these Cisco IOS software releases:
12.4(7.18)
12.4(7.18)T
12.4(4)T03
12.2(31)SB
12.3(20.13)
12.4(11.3)
12.4(11.3)T
12.4(6)T03
12.4(4)XD02