blob: 75386f6b88df28a11e83046740e1fea212c4c746 [file] [log] [blame]
#include <time.h>
#include <ctype.h>
#include "os_type_def.h"
#include "sms_code.h"
#ifdef WIN32
#include <wchar.h>
#endif
#define NON_GSM (0x12a9+1311-0x17a8)
#define NON_GSM_P NON_GSM
extern T_zUfiSms_ConcatInfo g_zUfiSms_ConcatSms;static const wms_udh_s_type*
const_header;char g_zUfiSms_DigAscMap[(0x463+219-0x52e)]={
((char)(0x4e9+6897-0x1faa)),((char)(0x1466+1723-0x1af0)),
((char)(0x1839+2622-0x2245)),((char)(0x358+3838-0x1223)),
((char)(0xf5f+1843-0x165e)),((char)(0x57d+1589-0xb7d)),
((char)(0x1289+561-0x1484)),((char)(0x79c+1722-0xe1f)),
((char)(0x901+4092-0x18c5)),((char)(0x21c+8324-0x2267)),
((char)(0xf0+1887-0x80e)),((char)(0x4bc+6636-0x1e66)),
((char)(0x12fb+3089-0x1ec9)),((char)(0x2f8+8259-0x22f7)),
((char)(0xed1+4858-0x2186)),((char)(0x10fd+1322-0x15e1))};extern SMS_PARAM
g_zUfiSms_SendingSms;extern UINT16 g_zUfiSms_IsLanguageShift;extern int
g_zUfiSms_Language;static int SerializeNumbers_sms(const char*pSrc,char*pDst,int
nSrcLength);const unsigned short g_zUfiSms_AsciiToGsmdefaultTable[]={
((char)(0x1b59+2264-0x2411)),((char)(0xa4a+3435-0x1795)),
((char)(0x1e1c+1160-0x2284)),((char)(0xd62+6547-0x26d5)),
((char)(0x427+3775-0x12c6)),((char)(0x6d7+3747-0x155a)),
((char)(0x1f0+2282-0xaba)),((char)(0x1b53+3032-0x270b)),
((char)(0xbd4+4281-0x1c6d)),((char)(0x21c+3592-0x1004)),
((char)(0x3e8+2334-0xce6)),((char)(0x60b+4269-0x1698)),
((char)(0x1ec1+1243-0x237c)),((char)(0xa23+3666-0x1855)),
((char)(0x5f1+8083-0x2564)),((char)(0x52+1628-0x68e)),
((char)(0xd8b+4530-0x1f1d)),((char)(0x3cc+110-0x41a)),
((char)(0x13a8+4676-0x25cc)),((char)(0x230+4120-0x1228)),
((char)(0xd5c+321-0xe7d)),((char)(0x223f+445-0x23dc)),((char)(0x383+1870-0xab1))
,((char)(0xe77+2428-0x17d3)),((char)(0x129b+973-0x1648)),
((char)(0x6ad+5262-0x1b1b)),((char)(0x62a+6839-0x20c1)),
((char)(0x520+1058-0x922)),((char)(0x17c3+575-0x19e2)),
((char)(0x55a+4843-0x1825)),((char)(0x11f5+2066-0x19e7)),
((char)(0x6f+7558-0x1dd5)),((char)(0x10ef+470-0x12a5)),
((char)(0x1037+2812-0x1b12)),(0x1d2b+151-0x1da0),((char)(0x1160+2190-0x19cb)),
(0x1e52+219-0x1f2b),((char)(0x6ac+2145-0xee8)),((char)(0x18f8+1258-0x1dbc)),
(0x13fb+2283-0x1cbf),((char)(0x15b3+1410-0x1b0d)),((char)(0x347+7035-0x1e99)),
((char)(0x82b+1337-0xd3a)),((char)(0x581+1980-0xd12)),((char)(0x604+1415-0xb5f))
,((char)(0x82d+1071-0xc2f)),((char)(0x187d+3601-0x2660)),
((char)(0x12ef+4496-0x2450)),((char)(0xbd8+6248-0x2410)),
((char)(0x1d2a+133-0x1d7e)),((char)(0x193d+2996-0x24bf)),
((char)(0xb7d+3699-0x19bd)),((char)(0x6e1+2613-0x10e2)),
((char)(0x8dd+4977-0x1c19)),((char)(0xaff+4222-0x1b47)),
((char)(0xc2a+2109-0x1430)),((char)(0xffa+4448-0x2122)),
((char)(0x85d+1741-0xef1)),((char)(0x1012+1562-0x15f2)),
((char)(0xb93+4357-0x1c5d)),((char)(0x21f+2441-0xb6c)),
((char)(0x8a7+1615-0xeb9)),((char)(0xa6+5463-0x15bf)),
((char)(0x1a2b+2006-0x21c2)),(0xdd2+2737-0x1883),((char)(0x1e2+4361-0x12aa)),
((char)(0xb8a+2172-0x13c4)),((char)(0x5d6+8271-0x25e2)),
((char)(0x795+6381-0x203e)),((char)(0x111d+4348-0x21d4)),
((char)(0x1bfc+668-0x1e52)),((char)(0x1b5a+574-0x1d51)),
((char)(0xc98+2019-0x1433)),((char)(0x1df+5472-0x16f6)),
((char)(0x10a0+3258-0x1d10)),((char)(0x32d+6137-0x1adb)),
((char)(0x15dc+560-0x17c0)),((char)(0x183+1641-0x79f)),
((char)(0x291+4672-0x1483)),((char)(0xf4+6099-0x1878)),
((char)(0x212+7110-0x1d88)),((char)(0x1352+856-0x1659)),
((char)(0x1532+1852-0x1c1c)),((char)(0xca3+577-0xe91)),
((char)(0xd56+3936-0x1c62)),((char)(0x112b+3355-0x1df1)),
((char)(0xcbc+5816-0x231e)),((char)(0x3ff+2341-0xccd)),
((char)(0x1dbf+684-0x2013)),((char)(0xa90+4252-0x1ad3)),
((char)(0x242d+458-0x259d)),(0x231d+4987-0x1b5c),(0x2292+2641-0x11b4),
(0x1e35+5905-0x1a08),6932,(0x15da+3068-0x21c5),((char)(0x679+2781-0x1136)),
((char)(0x2d0+6132-0x1a63)),((char)(0x5e1+316-0x6bb)),((char)(0xdf+2026-0x866)),
((char)(0x2fc+3749-0x113d)),((char)(0x164+1850-0x839)),
((char)(0x145c+2838-0x1f0c)),((char)(0x1963+1887-0x205b)),
((char)(0x16a3+526-0x1849)),((char)(0x66b+5678-0x1c30)),
((char)(0x5d9+6593-0x1f30)),((char)(0x272+7929-0x2100)),
((char)(0x1295+1718-0x18df)),((char)(0x719+5120-0x1aac)),
((char)(0xb8+4168-0x1092)),((char)(0xd53+1971-0x1497)),
((char)(0x6a0+3130-0x126a)),((char)(0x15d4+2654-0x1fc1)),
((char)(0xa9d+1230-0xef9)),((char)(0xda+6269-0x18e4)),((char)(0xa14+459-0xb6b)),
((char)(0x29c+168-0x2cf)),((char)(0xb1a+4418-0x1be6)),
((char)(0x721+4214-0x1720)),((char)(0xa73+7141-0x25e0)),
((char)(0xd28+4791-0x1f66)),((char)(0x7b9+4694-0x1995)),(0x1d7c+5347-0x1737),
(0x1fb4+5129-0x187d),6953,(0x2306+1712-0xe79),((char)(0x72f+1004-0xafb)),
((char)(0x467+7882-0x2311)),((char)(0x1f1c+1174-0x2392)),
((char)(0x15d9+3826-0x24ab)),((char)(0xa5d+5388-0x1f49)),
((char)(0xbcd+4101-0x1bb2)),((char)(0x1188+5015-0x24ff)),
((char)(0x2261+987-0x261c)),((char)(0xd19+2999-0x18b0)),
((char)(0xd43+6068-0x24d7)),((char)(0x5e6+8039-0x252d)),
((char)(0xf5d+4130-0x1f5f)),((char)(0xc9f+1998-0x144d)),
((char)(0xd17+2733-0x17a4)),((char)(0x7fa+1285-0xcdf)),
((char)(0x1224+1229-0x16d1)),((char)(0x767+1385-0xcb0)),
((char)(0x13d8+1440-0x1958)),((char)(0xae3+5826-0x2185)),
((char)(0x7b8+288-0x8b8)),((char)(0x929+6220-0x2155)),
((char)(0xf5b+3668-0x1d8f)),((char)(0xb9b+6414-0x2489)),
((char)(0x753+7948-0x263f)),((char)(0x690+6104-0x1e48)),
((char)(0x6c0+2866-0x11d2)),((char)(0x1146+412-0x12c2)),
((char)(0x543+6055-0x1cca)),((char)(0x3e1+756-0x6b5)),
((char)(0x1252+2717-0x1ccf)),((char)(0xeb5+2125-0x16e2)),
((char)(0x1025+991-0x13e4)),((char)(0x1219+992-0x15d9)),
((char)(0x963+6252-0x21af)),(0x17ba+534-0x1990),((char)(0x8a3+4263-0x192a)),
(0x569+7857-0x2419),(0x3f9+3972-0x1359),(0xd18+3703-0x1b8c),
((char)(0x487+1539-0xa6a)),(0x1550+2073-0x1d0a),((char)(0x368+5504-0x18c8)),
((char)(0x16fc+1461-0x1c91)),((char)(0x25b+4912-0x156b)),
((char)(0x101f+1540-0x1603)),((char)(0x528+6874-0x1fe2)),
((char)(0x1194+4939-0x24bf)),((char)(0x117c+3790-0x202a)),
((char)(0x9d4+6997-0x2509)),((char)(0x221+3902-0x113f)),
((char)(0x7f1+7955-0x26e4)),((char)(0x574+4701-0x17b1)),
((char)(0xa8+7789-0x1ef5)),((char)(0xdb9+1550-0x13a7)),
((char)(0xd2f+6098-0x24e1)),((char)(0x1a25+2972-0x25a1)),
((char)(0x5b4+5501-0x1b11)),(0x3c1+1921-0xb37),((char)(0x1db9+461-0x1f66)),
((char)(0x95+9792-0x26b5)),((char)(0x8f2+1964-0x107e)),
((char)(0x1989+466-0x1b3b)),((char)(0x1557+3380-0x226b)),
((char)(0xc19+5250-0x207b)),(0x143+5416-0x160b),((char)(0x1c80+761-0x1f59)),
((char)(0x1973+78-0x19a1)),((char)(0x1710+37-0x1715)),((char)(0x15d+181-0x1f2)),
(0xa63+5237-0x1e7d),(0x9d5+3171-0x162a),(0x867+1706-0xef5),(0x162+6348-0x1a25),
((char)(0x172b+1863-0x1e52)),(0x1d07+1873-0x2439),((char)(0x46f+5952-0x1b8f)),
((char)(0x1be6+2304-0x24c6)),((char)(0x135f+3677-0x219c)),
((char)(0x194+6897-0x1c65)),((char)(0x24ac+208-0x255c)),
((char)(0x182+8480-0x2282)),((char)(0x15f8+2417-0x1f49)),(0x15c3+364-0x16d2),
((char)(0x7c7+7600-0x2557)),((char)(0xf82+1661-0x15df)),
((char)(0x1aa8+2881-0x25c9)),((char)(0x180+8285-0x21bd)),(0x42c+2006-0xba6),
((char)(0x2099+1360-0x25c9)),((char)(0xb00+1538-0x10e2)),
((char)(0xa1b+1144-0xe73)),((char)(0x206+9187-0x25c9)),
((char)(0xdf4+6457-0x270d)),(0x501+7852-0x234f),((char)(0x49b+6441-0x1da4)),
((char)(0x124b+3625-0x2054)),(0x1436+1395-0x198b),(0xee1+2907-0x19bd),
((char)(0x936+3282-0x15e8)),((char)(0x15d9+812-0x18e5)),
((char)(0x1474+4346-0x254e)),(0x1688+2996-0x21c1),(0x9b+7150-0x1c7a),
(0xd6c+1350-0x1295),((char)(0x180+1370-0x6ba)),(0x46c+2473-0xe11),
(0xe2d+1775-0x1517),((char)(0x301+3285-0xfb6)),((char)(0x1208+3021-0x1db5)),
(0x1670+3685-0x24ce),((char)(0x44f+3399-0x1176)),((char)(0xbf8+2705-0x1669)),
((char)(0x1766+1002-0x1b30)),((char)(0x7ca+7200-0x23ca)),(0x520+2182-0xd29),
(0x2db+7680-0x20d3),((char)(0x1103+821-0x1418)),((char)(0x6eb+6306-0x1f6d)),
((char)(0xfb7+4288-0x2057)),(0x7d6+3897-0x1693),((char)(0x53a+1656-0xb92)),
(0x1651+1201-0x1af6),(0x215a+1432-0x26ec),((char)(0x25+6607-0x19d4)),
((char)(0x18f+6593-0x1b30)),(0xf09+5467-0x23e6),((char)(0xb71+1639-0x11b8)),
((char)(0x77+9415-0x251e)),((char)(0x250+1925-0x9b5)),};const unsigned short
zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[][(0x19fc+1312-0x1f1a)]={{
(0x474+2098-0xc9d),(0x10d8+5061-0x23b6)},{(0xedc+766-0x11d0),(0x482+7307-0x2101)
},{(0x18fd+3084-0x24fc),(0x697+6277-0x1f0f)},{(0xc39+4122-0x1c3f),
(0xc31+4109-0x1be0)},{(0x178d+2903-0x22bc),(0x10ca+5220-0x24b3)},{
(0x349+5427-0x1853),(0x288+3391-0xf4a)},{(0x4a4+7724-0x22a1),
(0x160f+1496-0x1b8b)},{(0x1cc+3384-0xec8),(0x129b+2407-0x1ba7)},{
(0xe93+1681-0x14e7),(0x87b+978-0xbcf)},{(0xe5a+5541-0x23c1),(0xbaa+1814-0x1263)}
,{(0x1823+3460-0x2567),(0x9e8+3312-0x165c)},{(0x6d8+4657-0x18c8),
(0x9ca+331-0xa54)},{(0x2d1+7536-0x1ff8),(0x4e8+4081-0x140c)},{
(0x6f0+7156-0x2295),(0x131f+1436-0x17e8)},{(0x39b+1702-0x9ec),(0x4a2+3047-0xfaf)
},{(0x9fb+3555-0x177d),(0xbf5+4588-0x1d00)},{(0x5cd+4602-0x1762),8364},{
(0x52d+5888-0x1bc4),(0x6fa+5944-0x1d45)},{(0xae9+6671-0x2489),(0x24c3+70-0x2416)
},{(0x1396+4355-0x2424),(0x1055+5442-0x249d)},};const unsigned short
Ucs2_To_Gsm7_SPANISH_Table_UCS[][(0xc92+1124-0x10f4)]={{(0x18c4+70-0x18fa),
(0x17b5+170-0x14cb)},{(0xcea+4796-0x1f94),(0x1c1f+134-0x18ff)},{
(0x110d+2733-0x1ba7),(0x17dc+1109-0x189e)},{(0xa56+4763-0x1cdd),
(0xde9+1582-0x107c)},{(0x1954+2305-0x2240),(0x20b7+1030-0x2114)},{
(0x1557+1451-0x1aec),(0x182c+706-0x174e)},{(0x1cf9+2077-0x24ff),
(0x15fa+2656-0x1cb2)},{(0x131a+1741-0x19cf),(0x7d2+6929-0x1f40)},{
(0xef+1490-0x6a8),(0x510+8558-0x22e6)},{(0x192d+1204-0x1dc7),(0x1a14+307-0x17a9)
},};const unsigned char Ucs2_To_Gsm7_SPANISH_Table_ASC[]={NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
(0xf86+1667-0x15ff),NON_GSM,NON_GSM,(0x23bd+135-0x2437),NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x23a+3390-0xf58),(0x18b+7314-0x1dfc),
(0x837+180-0x8c9),(0x14bc+688-0x1749),(0x1146+2696-0x1bcc),(0x1361+1178-0x17d6),
(0x3d1+300-0x4d7),(0x6ed+6216-0x1f0e),(0xdf7+6054-0x2575),(0x748+5629-0x1d1c),
(0xb32+7135-0x26e7),(0x101d+3881-0x1f1b),(0xa46+3868-0x1936),(0xe25+5719-0x244f)
,(0xc95+6133-0x245c),(0x4b7+235-0x573),(0x424+6010-0x1b6e),(0x44b+4142-0x1448),
(0x56+6951-0x1b4b),(0xe9a+5139-0x227a),(0x1e1d+1258-0x22d3),(0x7ed+1983-0xf77),
(0x1c4a+2679-0x268b),(0xa01+6446-0x22f8),(0x1b66+309-0x1c63),(0x4b5+6499-0x1ddf)
,(0x9b+686-0x30f),(0x6e8+6548-0x2041),(0x1897+940-0x1c07),(0xab6+75-0xac4),
(0xd81+4006-0x1ce9),(0x10d9+5284-0x253e),(0x8d2+1349-0xe17),(0xb93+4461-0x1cbf),
(0x9b0+3216-0x15fe),(0x15bd+3332-0x227e),(0x917+6757-0x2338),
(0x1013+3634-0x1e00),(0x5f0+1855-0xce9),(0x52+1497-0x5e4),(0x9b6+7300-0x25f2),
(0xd1a+3398-0x1a17),(0x1413+1431-0x1960),(0x1471+2839-0x1f3d),
(0xb35+5853-0x21c6),(0xc6f+3611-0x1a3d),(0x1b65+2643-0x256a),
(0x1749+2259-0x1fcd),(0x60+2860-0xb3c),(0x13a3+902-0x16d8),(0x998+5321-0x1e0f),
(0xe26+5135-0x21e2),(0x3e2+4665-0x15c7),(0x1325+4328-0x23b8),(0xcbd+6512-0x25d7)
,(0x1fc0+1624-0x25c1),(0x1cb+1205-0x628),(0xf62+6028-0x2695),(0x9a3+3470-0x16d7)
,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x4bc+4549-0x1670),NON_GSM,(0xe7c+815-0x114a),
(0x1ccc+2485-0x261f),(0x479+5337-0x18ef),(0x910+3655-0x16f3),(0xdb3+4829-0x202b)
,(0x20a0+230-0x2120),(0xe0b+3132-0x19e0),(0x1b58+2569-0x24f9),
(0xf81+4394-0x2042),(0x1b23+2622-0x24f7),(0x5c5+3958-0x14d0),
(0x16e8+2902-0x21d2),(0x4f7+8328-0x2512),(0x143a+4229-0x2451),
(0x9ba+4944-0x1c9b),(0x1028+922-0x1352),(0x603+1124-0x9f6),(0x3ba+6040-0x1ae0),
(0x465+2999-0xfa9),(0x988+4109-0x1921),(0x465+2820-0xef4),(0x1af+2322-0xa4b),
(0x17d9+3717-0x25e7),(0x2301+825-0x25c2),(0x1354+2322-0x1bed),
(0x1acf+1890-0x21b7),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
(0x74d+285-0x84f),(0x14c+707-0x3cf),NON_GSM,(0x148d+4354-0x258e),
(0x218a+1117-0x25c3),(0x9a5+1876-0x10f6),NON_GSM,(0x723+3425-0x1425),NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,(0x658+6484-0x1f4c),NON_GSM,NON_GSM,NON_GSM,NON_GSM,
(0x1f3+9350-0x261e),(0x6a0+2209-0xf33),(0x14b+4361-0x1238),(0x4c+1122-0x4a5),
NON_GSM,(0x1d72+1034-0x215d),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,(0x4b6+1717-0xb0e),NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xaf9+6173-0x22ba),
NON_GSM,(0x18c1+412-0x1a52),NON_GSM,NON_GSM,NON_GSM,(0x1118+4577-0x229b),NON_GSM
,NON_GSM,(0x169+3534-0xf19),(0x4db+6988-0x1fa8),NON_GSM,NON_GSM,NON_GSM,
(0xd76+4568-0x1ed3),(0x1350+4604-0x253d),(0x1a6+4466-0x12fb),NON_GSM,
(0x19+9775-0x2644),(0xe3b+1307-0x1351),NON_GSM,NON_GSM,(0x4c9+7910-0x23a8),
NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x4b4+4391-0x155e),(0x13bc+2405-0x1d19),NON_GSM
,NON_GSM,NON_GSM,(0x347+4768-0x156b),NON_GSM,(0x9a+8173-0x207b),
(0x1bd+2281-0xaa0),NON_GSM,NON_GSM,(0x1962+193-0x19a5),NON_GSM,NON_GSM,NON_GSM};
const unsigned short zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[][
(0x452+8009-0x2399)]={{(0x1437+2965-0x1fc7),(0x909+1536-0xe1f)},{
(0x271+902-0x5ee),(0xaaf+873-0xd31)},{(0x141+8379-0x21f2),(0x1a7+2825-0xca4)},{
(0x4e3+86-0x52e),(0xe9a+3844-0x1cca)},{(0x189a+1021-0x1c8b),(0xf65+5318-0x2337)}
,{(0x1570+2326-0x1e79),(0xdc8+1603-0x13fe)},{(0xf50+1988-0x1706),
(0x75c+2114-0xedd)},{(0xc04+3880-0x1b1d),(0xa45+476-0xb40)},{(0x494+8304-0x24f2)
,(0x1621+3946-0x21e5)},{(0x1830+1943-0x1fb4),(0x99a+2726-0x10ad)},{
(0x208f+489-0x2264),(0x6b1+313-0x78c)},{(0x1cf5+1997-0x24ad),(0xf47+399-0xd2d)},
{(0x780+3921-0x16bb),(0x88c+6319-0x1d9b)},{(0x13bb+2444-0x1d30),
(0x125a+1836-0x15de)},{(0x865+7056-0x23dd),(0x8f1+5780-0x1be2)},{
(0xe02+4687-0x2038),(0x1fcc+1113-0x208d)},{(0x143+9226-0x252e),
(0xd01+1285-0x113c)},{(0xd4c+5482-0x228e),(0x19cb+2583-0x2367)},{
(0x601+4864-0x18d8),(0x619+6775-0x2013)},{(0x1686+1732-0x1d1b),
(0xd92+6035-0x24c9)},{(0x67b+6644-0x2033),(0x18b+651-0x3bb)},{
(0x67a+2881-0x117e),(0x753+4652-0x1901)},{(0xd4+4469-0x120b),
(0x17a5+1079-0x1b7f)},{(0x1241+1997-0x19ce),(0x9aa+7523-0x2691)},{
(0x18f+4497-0x12df),(0x15a4+3477-0x2279)},{(0x2464+458-0x25e5),
(0x122c+3772-0x201b)},{(0xd00+893-0x102e),(0x1486+4631-0x25ca)},{
(0x48d+933-0x7dd),(0x1d4a+1588-0x22a4)},{(0x7b4+5369-0x1c52),
(0x118d+3074-0x1ccc)},{(0x376+6097-0x1aeb),(0xda8+4065-0x1cb4)},{
(0xb85+2791-0x160b),(0x39a+6842-0x1d92)},{(0x154d+4619-0x26f3),8364},{
(0xf86+3432-0x1c85),(0xc58+2842-0x1685)},{(0xebd+2941-0x19cb),(0xd20+184-0xce5)}
,{(0x109a+5292-0x24d1),(0x1616+3501-0x22c9)},{(0xe5a+403-0xf72),
(0xa3c+4285-0x1a16)},{(0xe77+24-0xe13),(0x12d4+3117-0x1e0c)},{(0x606+1088-0x9c7)
,(0xc52+2656-0x15d0)},};const unsigned short Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[]
[(0x10ef+3025-0x1cbe)]={{(0x241b+641-0x268c),(0x158d+1573-0x181e)},{
(0x736+2214-0xfc7),8929},{(0x10e1+3472-0x1e59),8364},{(0xb91+6247-0x2393),
(0x24ed+6063-0x1bf0)},};const unsigned char Ucs2_To_Gsm7_PORTUGUESE_Table_ASC[]=
{NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM
,(0x87c+1075-0xca5),NON_GSM,NON_GSM,(0x19c9+807-0x1ce3),NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xcaf+5746-0x2301),(0x1771+922-0x1aea),
(0x643+7351-0x22d8),(0x1a14+1868-0x213d),(0xc1f+3912-0x1b65),(0x94+3808-0xf4f),
(0x1fb9+759-0x228a),(0x23a+7757-0x2060),(0xaf5+2167-0x1344),(0x148a+763-0x175c),
(0x191d+2029-0x20e0),(0x7f4+5302-0x1c7f),(0x132b+1148-0x177b),
(0x1744+1193-0x1bc0),(0xebd+4331-0x1f7a),(0xec5+3021-0x1a63),(0xa6b+5996-0x21a7)
,(0x1697+3046-0x224c),(0x809+2381-0x1124),(0x1176+85-0x1198),(0x5bf+4610-0x178d)
,(0x11f7+3961-0x213b),(0x1ce1+1006-0x2099),(0x1c5+8807-0x23f5),
(0x9a8+3224-0x1608),(0x7d3+970-0xb64),(0x9ea+3941-0x1915),(0x1431+2923-0x1f61),
(0x15ab+589-0x17bc),(0x925+4600-0x1ae0),(0xfad+3134-0x1bad),(0x7fb+7142-0x23a2),
(0xabd+1849-0x11f6),(0x4a8+97-0x4c8),(0x1bfa+2852-0x26dc),(0x5c5+6290-0x1e14),
(0x15f+2467-0xabe),(0x1cc4+2068-0x2493),(0xa0c+334-0xb14),(0xc3+1645-0x6e9),
(0x21d+6131-0x19c8),(0xa74+5369-0x1f24),(0xaa3+5627-0x2054),(0x9e7+841-0xce5),
(0x400+5158-0x17da),(0x909+4443-0x1a17),(0xd34+5748-0x235a),(0x438+2470-0xd8f),
(0x86a+4871-0x1b21),(0x8f9+5148-0x1cc4),(0x4ef+5409-0x19be),(0x1f6a+165-0x1fbc),
(0x251+7606-0x1fb3),(0x398+9041-0x2694),(0x6a6+3608-0x1468),(0x1b1c+2889-0x260e)
,(0xd41+1406-0x1267),(0x12d+7031-0x1c4b),(0x7cd+5512-0x1cfb),NON_GSM,
(0x12ca+5145-0x26cc),NON_GSM,(0x220+3394-0xf4c),(0xfe4+5087-0x23b2),
(0xb8a+4015-0x1abc),(0x10da+2471-0x1a20),(0xa7a+1793-0x1119),(0x244+2311-0xae8),
(0x141a+4792-0x266e),(0x6c2+6816-0x20fd),(0x282+6427-0x1b37),(0x382+1768-0xa03),
(0x61f+8125-0x2574),(0x284+3519-0xfda),(0x2032+1389-0x2535),(0xc51+3099-0x1801),
(0x109c+5749-0x26a5),(0xea+3541-0xe52),(0xae0+4070-0x1a58),(0x1ef8+1759-0x2568),
(0x15da+867-0x18cd),(0x1bc9+2479-0x2507),(0x30f+7974-0x21c3),
(0x1119+1496-0x167e),(0x80d+3599-0x15a8),(0x103c+5905-0x26d8),
(0xd25+3174-0x1915),(0x77c+665-0x99e),(0x1759+266-0x17eb),(0xedc+4392-0x1f8b),
(0x12ff+5184-0x26c5),NON_GSM,(0x1b6f+2576-0x2565),NON_GSM,(0x6a5+609-0x8a6),
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,(0x5bc+935-0x948),NON_GSM_P,NON_GSM,(0xf35+794-0x124e),
NON_GSM_P,(0xf85+3451-0x1cfd),NON_GSM,(0x1b08+708-0x1d6d),NON_GSM,NON_GSM,
(0x1b3b+1682-0x21bb),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x51d+3422-0x1257)
,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM
,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x503+1041-0x900),(0x4b+5586-0x160f),
(0x619+4911-0x192c),(0x1ebc+427-0x200c),NON_GSM_P,NON_GSM_P,NON_GSM_P,
(0x1a+5621-0x15fc),NON_GSM,(0x1509+2311-0x1df1),(0x1004+2655-0x1a45),NON_GSM,
NON_GSM,(0x13fd+1550-0x19cb),NON_GSM,NON_GSM,NON_GSM,NON_GSM_P,NON_GSM,
(0x1950+2184-0x21bf),(0x1e12+929-0x21a8),(0x149c+3736-0x22d8),NON_GSM_P,NON_GSM,
NON_GSM_P,NON_GSM,(0xf42+61-0xf22),NON_GSM,(0xf74+4101-0x1f1b),NON_GSM,NON_GSM,
NON_GSM_P,(0x1bd4+2896-0x26a5),(0x13ea+2709-0x1e70),(0x206+2908-0xd45),
(0x1a69+2954-0x2578),NON_GSM_P,NON_GSM_P,NON_GSM_P,(0x1508+1767-0x1be6),
NON_GSM_P,(0x299+5476-0x17f8),(0xf35+1156-0x13b5),NON_GSM,NON_GSM_P,
(0x8b3+5689-0x1ee5),NON_GSM,NON_GSM,NON_GSM,NON_GSM_P,NON_GSM_P,
(0x1305+1530-0x18f7),(0x56b+7569-0x22f0),(0x1202+3435-0x1ef1),NON_GSM_P,NON_GSM,
NON_GSM_P,NON_GSM_P,(0x195+9444-0x2673),NON_GSM,(0x14b1+3600-0x2243),NON_GSM,
NON_GSM,NON_GSM};const unsigned short zte_sms_GSMDefault_To_UCS2_Table_Ex[][
(0x1d63+1467-0x231c)]={{(0x12f8+165-0x1393),(0x936+6287-0x21b9)},{
(0x1318+2143-0x1b63),(0x2350+136-0x237a)},{(0xeca+3915-0x1ded),
(0x193d+3634-0x26f4)},{(0x7dd+7067-0x234f),(0xb34+1980-0x1273)},{
(0x130+9587-0x2674),(0xc3+7671-0x1e5e)},{(0x454+6292-0x1cac),(0x177+4399-0x124b)
},{(0xdd4+599-0xfee),(0xf3+2838-0xb8b)},{(0x22e5+160-0x2347),(0x5cf+2913-0x10d3)
},{(0x80b+1673-0xe54),(0x11e9+922-0x1507)},{(0xcf5+2789-0x1775),
(0x245f+5948-0x1aef)},};const unsigned short UCS2_To_GSMDefault_Table_UCS2[][
(0x129+1822-0x845)]={{(0x327+5735-0x197e),(0x1f68+1741-0x22a1)},{
(0xbcf+124-0xc39),(0xdc2+765-0xd19)},{(0x96c+1217-0xe1a),(0xc37+561-0xad5)},{
(0x1b3c+1168-0x1fb8),(0x121f+5548-0x2430)},{(0x1094+2671-0x1aee),
(0x958+967-0x976)},{(0x269+8432-0x2343),(0xa70+7668-0x24c4)},{
(0xb68+1820-0x126d),(0xb48+2604-0x11cc)},{(0x6c5+8146-0x267f),
(0x3dd+9169-0x240b)},{(0x53c+8659-0x26f6),(0x9f6+1946-0xdf8)},{
(0xaed+4740-0x1d57),(0x3c8+3987-0xfbd)},};const unsigned char
UCS2_To_GSMDefault_Table_ASC[]={NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xeb6+1409-0x142d),NON_GSM,NON_GSM,
(0xb7+1894-0x810),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,(0x38d+6073-0x1b26),(0x23f0+176-0x247f),(0x1833+3397-0x2556),
(0x243d+56-0x2452),(0x16a8+3865-0x25bf),(0x1857+3611-0x264d),(0x667+6756-0x20a5)
,(0x1362+4314-0x2415),(0x1a4b+2228-0x22d7),(0x7bb+5537-0x1d33),(0x4fd+309-0x608)
,(0x3ea+4773-0x1664),(0x1042+2517-0x19eb),(0x112f+4887-0x2419),
(0x726+5014-0x1a8e),(0x1223+143-0x1283),(0x1d7+4439-0x12fe),(0x962+5489-0x1ea2),
(0x13d+6150-0x1911),(0xbc8+6103-0x236c),(0x3bc+5821-0x1a45),(0x21ef+134-0x2240),
(0x4e6+1338-0x9ea),(0x1d7+7509-0x1ef5),(0x100c+3047-0x1bbb),(0x1434+4172-0x2447)
,(0xfc+2578-0xad4),(0xaf2+6772-0x252b),(0xa4b+1981-0x11cc),(0x6fc+2883-0x1202),
(0xd8b+2735-0x17fc),(0x1236+1092-0x163b),(0x763+5048-0x1b1b),(0xcad+5614-0x225a)
,(0x1e87+688-0x20f5),(0x204d+879-0x2379),(0xa73+577-0xc70),(0x95f+1338-0xe54),
(0x987+7577-0x26da),(0xff4+4035-0x1f70),(0x21b+3956-0x1147),(0x163c+2442-0x1f7d)
,(0x705+3359-0x13da),(0xc2f+2299-0x14df),(0x1609+850-0x190f),(0x759+6585-0x20c5)
,(0x736+6049-0x1e89),(0xdab+2789-0x1841),(0xac4+4221-0x1af1),(0x7f8+2990-0x1355)
,(0xce3+638-0xf0f),(0x122b+327-0x131f),(0x16b6+3254-0x2318),(0x3c4+84-0x3c3),
(0x11a6+3696-0x1fc0),(0x98c+2974-0x14d3),(0x8a8+985-0xc29),(0x6ba+396-0x7ed),
(0x22f2+389-0x241d),NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xd3a+5534-0x22c7),NON_GSM,
(0x18b+4685-0x1377),(0xb98+3382-0x186c),(0x45c+305-0x52a),(0x615+8057-0x252a),
(0xcbb+2056-0x145e),(0x15f8+3724-0x241e),(0x1086+5186-0x2461),
(0xe31+1351-0x1310),(0x346+2805-0xdd2),(0x113d+2230-0x1989),(0x20b+8310-0x2216),
(0x262+1686-0x88c),(0x707+2346-0xfc4),(0x1c06+572-0x1dd4),(0x23e0+570-0x25ab),
(0x2a1+1943-0x9c8),(0xa12+1016-0xd99),(0x294+5615-0x1811),(0x2ad+7734-0x2070),
(0x112c+5550-0x2666),(0xdda+1317-0x128a),(0x1074+345-0x1157),
(0x176b+3258-0x23ae),(0x219d+354-0x2287),(0x1008+4845-0x227c),
(0xb11+2983-0x163e),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
(0x1d7d+2222-0x2610),(0x173f+1211-0x1bba),NON_GSM,(0x10d4+1169-0x1564),
(0x45b+1102-0x885),(0x8e6+2459-0x127e),NON_GSM,(0x1013+3428-0x1d18),NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,NON_GSM,(0x29a+6141-0x1a37),NON_GSM,NON_GSM,NON_GSM,NON_GSM,
(0x136+2421-0xa50),(0x41b+2613-0xe42),(0x1e83+678-0x210d),(0x76+568-0x2a5),
NON_GSM,(0xe5b+3525-0x1c01),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
NON_GSM,(0x17ca+3640-0x25a5),NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x983+5307-0x1de2)
,NON_GSM,(0x7c6+3002-0x1375),NON_GSM,NON_GSM,NON_GSM,(0xb2a+3660-0x1918),NON_GSM
,NON_GSM,(0xd95+3959-0x1cee),(0xf8c+5274-0x23a7),NON_GSM,NON_GSM,NON_GSM,
(0x1268+3827-0x20e0),(0x1b1+7236-0x1de6),(0x9b0+5258-0x1e1d),NON_GSM,
(0xedd+1506-0x14bb),(0x5da+4344-0x16cd),NON_GSM,NON_GSM,(0xe42+2076-0x1657),
NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x148+7972-0x1fef),(0x4d5+1496-0xaa5),NON_GSM,
NON_GSM,NON_GSM,(0x1e98+247-0x1f13),NON_GSM,(0x93d+1326-0xe5f),
(0x494+7914-0x2378),NON_GSM,NON_GSM,(0xc2c+5402-0x20c8),NON_GSM,NON_GSM,NON_GSM}
;const unsigned short zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[]={
(0x15d+9062-0x2483),(0x1b79+1262-0x1fc4),(0x1dec+1805-0x24d5),
(0x89c+5804-0x1ea3),(0x2ec+8791-0x2459),(0x10e0+679-0x129e),(0x100f+2157-0x1782)
,(0x708+8052-0x258f),(0x180a+3971-0x269a),(0x43b+3363-0x1077),
(0x543+7911-0x2420),(0x8e7+5360-0x1d03),(0x1d0a+2229-0x24cb),(0xc82+2356-0x15a9)
,(0x12e2+5010-0x25b3),(0x1eb8+1728-0x2497),(0x1799+4304-0x24d5),
(0x394+2243-0xbf8),(0xc6+6197-0x1851),(0x146+8292-0x20e3),(0x9c5+1972-0x10b9),
8734,(0x1160+2681-0x1b7b),(0x2ca+1491-0x841),(0x246c+3505-0x1171),
(0x7a0+5670-0x1cf3),(0x64f+5412-0x1af7),(0x129+8291-0x20ec),(0x3af+2193-0xb7e),
(0x22b1+964-0x2593),(0x487+565-0x5f2),(0xe6c+1992-0x156b),(0x38d+7610-0x2127),
(0x12d3+573-0x14ef),(0x20cb+1249-0x258a),(0x34a+1754-0xa01),(0x1130+2137-0x18d9)
,(0x1560+2456-0x1ed3),(0x211+9140-0x259f),(0x607+4562-0x17b2),
(0x18a7+713-0x1b48),(0x166c+15-0x1652),(0x16f2+3084-0x22d4),(0x291+5748-0x18da),
(0x153b+1924-0x1c93),(0xe31+5682-0x2436),(0xf6b+1907-0x16b0),(0x872+2093-0x1070)
,(0x1101+1809-0x17e2),(0xf08+728-0x11af),(0x5f+7052-0x1bb9),(0x1f55+1262-0x2410)
,(0x20d+1200-0x689),(0x136d+1341-0x1875),(0x1cf1+868-0x201f),
(0x1365+1301-0x1843),(0x593+712-0x823),(0x76b+726-0xa08),(0x166f+3917-0x2582),
(0x510+6287-0x1d64),(0x1c57+763-0x1f16),(0x3af+2227-0xc25),(0x612+1053-0x9f1),
(0xca3+6240-0x24c4),(0x167+1589-0x6cf),(0x176+549-0x35a),(0x1515+1782-0x1bc9),
(0x2209+1160-0x264e),(0x375+4076-0x131d),(0x1ee4+1874-0x25f1),
(0xf43+4901-0x2222),(0x13c3+1678-0x1a0a),(0x3aa+7789-0x21cf),
(0x1154+3691-0x1f76),(0x160d+3834-0x24bd),(0x88+5875-0x1730),(0x749+5966-0x1e4b)
,(0x870+355-0x986),(0x20e1+104-0x20fb),(0xe06+152-0xe4f),(0x2206+1072-0x25e6),
(0x1a57+21-0x1a1b),(0x11b8+3206-0x1dec),(0x543+632-0x768),(0x12e8+5111-0x268b),
(0x38b+50-0x368),(0x8dd+5044-0x1c3b),(0x1846+3015-0x23b6),(0xa17+7170-0x25c1),
(0x7dc+4271-0x1832),(0xd52+971-0x10c3),(0x2cb+2912-0xd68),(0x2060+927-0x232a),
(0x11a5+21-0x10e0),(0xa05+2363-0x1264),(0x1164+394-0x1247),(0x909+2879-0x13ca),
(0x619+3711-0x1437),(0x3f7+8013-0x22e2),(0x17c+6823-0x1bc0),(0xdd5+3792-0x1c41),
(0x14dd+2311-0x1d7f),(0x3c1+2724-0xdff),(0x18b5+2770-0x2320),(0x2a3+243-0x32e),
(0x127+2787-0xba1),(0x289+4773-0x14c4),(0x626+5477-0x1b20),(0x1ca5+2534-0x261f),
(0x1a6b+1521-0x1fef),(0x20c+8336-0x222e),(0x20ff+1028-0x2494),
(0x17e2+2050-0x1f74),(0x4f9+3926-0x13de),(0x1945+2137-0x212c),
(0xa20+7163-0x25a8),(0x43c+6074-0x1b82),(0x17f5+1152-0x1c00),(0x2e8+77-0x2bf),
(0x747+8107-0x267b),(0x7af+5909-0x1e4c),(0x13c0+4904-0x266f),(0x2384+424-0x24b2)
,(0x71f+3735-0x14d3),(0x2195+1344-0x25e0),(0xada+5736-0x20e2),
(0x5e7+8678-0x26d1),(0xf2f+1933-0x15dc)};const unsigned short
zte_sms_GSMDefault_To_UCS2_Table[]={(0xe36+1629-0x1453),(0x1757+209-0x1785),
(0xa84+4970-0x1dca),(0xc4+5219-0x1482),(0x1298+2434-0x1b32),(0x393+7847-0x2151),
(0x16d1+3989-0x256d),(0x1457+2326-0x1c81),(0x597+3862-0x13bb),
(0x3ca+4651-0x152e),(0x7d6+6131-0x1fbf),(0x2179+1094-0x24e7),(0x1150+522-0x1262)
,(0xb29+6713-0x2555),(0xb25+489-0xc49),(0xd89+5487-0x2213),(0x17a3+423-0x15b6),
(0x3c7+810-0x692),(0xa6c+4534-0x187c),(0x1645+985-0x168b),(0x120d+2864-0x19a2),
(0x1e09+1303-0x1f77),(0x1233+5216-0x22f3),(0x1e86+2086-0x2304),
(0x186d+2668-0x1f36),(0x1e28+1863-0x21d7),(0x1441+3008-0x1c63),
(0xa3+5211-0x145e),(0x1b50+1984-0x224a),(0x2af+8090-0x2163),(0x18d3+601-0x1a4d),
(0x282+6351-0x1a88),(0x759+4391-0x1860),(0x93d+1547-0xf27),(0x696+907-0x9ff),
(0x926+6093-0x20d0),(0x12df+4763-0x24d6),(0x171+3662-0xf9a),(0x98c+31-0x985),
(0x321+6398-0x1bf8),(0x5ba+147-0x625),(0xa9b+1420-0xffe),(0x5c1+7042-0x2119),
(0x1079+2439-0x19d5),(0x1bdd+1796-0x22b5),(0x604+1053-0x9f4),
(0x16e5+2802-0x21a9),(0xe5c+3865-0x1d46),(0x232+1541-0x807),(0xbe1+4368-0x1cc0),
(0x133d+560-0x153b),(0x481+6651-0x1e49),(0x213a+937-0x24af),(0x193c+1000-0x1cef)
,(0x139b+3044-0x1f49),(0x1215+2253-0x1aab),(0xec6+2053-0x1693),
(0x943+3515-0x16c5),(0x6df+3385-0x13de),(0xe10+5226-0x223f),(0x723+3887-0x1616),
(0x11b5+3279-0x1e47),(0x134f+1287-0x1818),(0x1f49+1173-0x239f),
(0x17db+3245-0x23e7),(0x1988+346-0x1aa1),(0xb3a+6176-0x2318),
(0x1074+4847-0x2320),(0x1e84+1689-0x24d9),(0x5cf+688-0x83a),(0x699+2550-0x1049),
(0xe1+7276-0x1d06),(0x6c0+6298-0x1f12),(0x378+8506-0x2469),(0x1bd0+2465-0x2527),
(0x1bc+9269-0x25a6),(0xc36+3729-0x1a7b),(0x1bed+1337-0x20d9),(0x7d0+1373-0xcdf),
(0x16bf+3337-0x2379),(0xcc5+1509-0x125a),(0x7a3+6556-0x20ee),
(0x1af0+3174-0x2704),(0x1806+48-0x17e3),(0x1b8d+2025-0x2322),
(0x12ca+4514-0x2417),(0x674+6241-0x1e7f),(0x1106+4854-0x23a5),
(0x1626+2149-0x1e33),(0x314+7696-0x20cb),(0x556+3456-0x127c),(0x23c7+454-0x24c9)
,(0x20bc+933-0x238b),(0x13d5+5123-0x2707),(0x1aa0+1139-0x1e37),
(0xeb+8170-0x202e),(0xaf9+3203-0x16bd),(0x1c5a+1887-0x2358),(0x9a6+5288-0x1dec),
(0x7e6+2241-0x1044),(0x11dd+246-0x126f),(0x8df+4896-0x1b9a),(0x1d4f+1504-0x22c9)
,(0x124+7687-0x1ec4),(0x12ac+3789-0x2111),(0x926+6721-0x22fe),
(0x1210+4474-0x2320),(0x17d9+2599-0x2195),(0x20d+7910-0x2087),
(0x165b+3432-0x2356),(0x271+381-0x380),(0x95d+2511-0x12bd),(0xa20+5110-0x1da6),
(0x626+6554-0x1f4f),(0x101a+3869-0x1ec5),(0x649+4737-0x1857),(0xbfb+6055-0x232e)
,(0x1500+2417-0x1dfc),(0x1265+3887-0x211e),(0x1621+2140-0x1e06),
(0x3c8+5443-0x1893),(0x10ab+3179-0x1c9d),(0x17c+1101-0x54f),(0x2a0+2682-0xc36),
(0x1f53+1991-0x2624),(0x14c9+3298-0x20ba),(0xc43+3257-0x1800),
(0x500+6810-0x1eba)};int Bytes2String(const unsigned char*pSrc,char*pDst,int
nSrcLength){const char tab[]="0123456789ABCDEF";int i=(0x952+6293-0x21e7);if(
pSrc==NULL||pDst==NULL||nSrcLength<(0x134f+609-0x15b0)){return-
(0xdbb+985-0x1193);}for(i=(0x1683+2809-0x217c);i<nSrcLength;i++){*pDst++=tab[*
pSrc>>(0x1016+3045-0x1bf7)];*pDst++=tab[*pSrc&(0x1671+2637-0x20af)];pSrc++;}*
pDst='\0';return nSrcLength*(0x8ef+7178-0x24f7);}int String2Bytes(const char*
pSrc,unsigned char*pDst,int nSrcLength){int i=(0xaf1+3835-0x19ec);if(pSrc==NULL
||pDst==NULL||nSrcLength<(0x65a+6771-0x20cd)){return-(0x84d+1945-0xfe5);}for(i=
(0xc64+6487-0x25bb);i<nSrcLength;i+=(0xc24+4373-0x1d37)){if(*pSrc>=
((char)(0x1112+4523-0x228d))&&*pSrc<=((char)(0x1498+4736-0x26df))){*pDst=(*pSrc-
((char)(0xe2f+2083-0x1622)))<<(0x6d+4342-0x115f);}else{*pDst=((toupper(*pSrc)-
((char)(0x1d83+795-0x205d)))+(0x2cc+5104-0x16b2))<<(0x104+6478-0x1a4e);}pSrc++;
if(*pSrc>=((char)(0xea1+61-0xeae))&&*pSrc<=((char)(0x6ec+2861-0x11e0))){*pDst|=*
pSrc-((char)(0x1066+2350-0x1964));}else{*pDst|=(toupper(*pSrc)-
((char)(0x1a7+4219-0x11e1)))+(0xd4f+5753-0x23be);}pSrc++;pDst++;}return
nSrcLength/(0x97+9082-0x240f);}int EncodeUcs2(const char*pSrc,unsigned char*pDst
,int nSrcLength){if(pSrc==NULL||pDst==NULL||nSrcLength<(0x94a+4240-0x19da)){
return-(0x9d+9061-0x2401);}(void)String2Bytes(pSrc,pDst,(int)nSrcLength);return
nSrcLength/(0xe2d+3542-0x1c01);}int Encode7bit(const char*pSrc,unsigned char*
pDst,int nSrcLength){int nSrc;int nDst;int nChar;unsigned char nLeft=
(0x9e8+1598-0x1026);if(pSrc==NULL||pDst==NULL||nSrcLength<(0x6eb+72-0x733)){
return-(0x1423+3603-0x2235);}nSrc=(0x11f5+4977-0x2566);nDst=(0x854+3009-0x1415);
while(nSrc<nSrcLength){nChar=nSrc&(0x22d8+278-0x23e7);if(nChar==
(0x810+6416-0x2120)){nLeft=*pSrc;if((g_zUfiSms_ConcatSms.total_msg>
(0x1b8+3791-0x1086))&&(nSrc==(nSrcLength-(0xe13+5348-0x22f6)))){nDst++;}}else{*
pDst=(*pSrc<<((0x94f+2946-0x14c9)-nChar))|nLeft;nLeft=*pSrc>>nChar;pDst++;nDst++
;}pSrc++;nSrc++;}return nDst;}SINT32 zUfiSms_EncodePdu_DeliverReport(CHAR*pDst,
UINT8 TP_FCS){SINT32 nLength=(0x22c+6102-0x1a02);SINT32 nDstLength=
(0x11a3+3187-0x1e16);UINT8 buf[(0xb7a+4419-0x1bbd)]={(0xda5+4913-0x20d6)};if(
NULL==pDst){return-(0x1356+3917-0x22a2);}if(TP_FCS!=(0x674+3993-0x160d)){buf[
(0x70b+8067-0x268e)]=(0x3a7+8747-0x25d2);buf[(0x113+3111-0xd39)]=TP_FCS;buf[
(0x15d2+3479-0x2367)]=(0x1482+2649-0x1edb);nDstLength+=Bytes2String(buf,&pDst[
nDstLength],(0x1751+4008-0x26f6));}else{buf[(0x1929+1873-0x207a)]=
(0xa00+3161-0x1659);buf[(0x189+9340-0x2604)]=(0x457+7912-0x233f);nDstLength+=
Bytes2String(buf,&pDst[nDstLength],(0x1212+904-0x1598));}return nDstLength;}
unsigned long zUfiSms_ConvertAsciiToGsmDefault(const unsigned char*inputs,
unsigned char*outputs,unsigned long len){unsigned long i=(0x7fd+446-0x9bb);
unsigned long j=(0xd34+4016-0x1ce4);unsigned long k=(0x18b9+2773-0x238e);if(NULL
==inputs||NULL==outputs){printf(
"\x7a\x74\x65\x5f\x73\x6d\x73\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73"
);return(0x381+4753-0x1612);}for(i=(0x966+3844-0x186a);i<len;i++){j=inputs[i];if
(g_zUfiSms_AsciiToGsmdefaultTable[j]<(0x522+5403-0x193e)){outputs[k]=
g_zUfiSms_AsciiToGsmdefaultTable[j];}else{outputs[k]=(
g_zUfiSms_AsciiToGsmdefaultTable[j]&65280)>>(0x1425+3340-0x2129);k++;outputs[k]=
(g_zUfiSms_AsciiToGsmdefaultTable[j]&(0x1057+5869-0x2645));}k++;}return k;}
unsigned long zUfiSms_ConvertUcs2ToSpanish(const unsigned char*def,unsigned char
*gsm_default,unsigned long len){unsigned long i=(0x3f6+8945-0x26e7);unsigned
long k=(0x585+6310-0x1e2b);unsigned long p=(0x9d2+2079-0x11f1);unsigned long tmp
=(0xb4c+653-0xdd9);unsigned long s1=(0x7f3+4290-0x18b5),s2=(0x37c+3660-0x11c8);
unsigned long q=(0x9b3+5037-0x1d60);s1=sizeof(
zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex)/sizeof(
zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[(0xc44+734-0xf22)]);s2=sizeof(
Ucs2_To_Gsm7_SPANISH_Table_UCS)/sizeof(Ucs2_To_Gsm7_SPANISH_Table_UCS[
(0x11f3+4758-0x2489)]);for(i=(0x12b+2657-0xb8c);i<len;i++){if(def[i]==
(0x2266+369-0x23d7)){i++;if(Ucs2_To_Gsm7_SPANISH_Table_ASC[def[i]]!=NON_GSM){
gsm_default[k]=Ucs2_To_Gsm7_SPANISH_Table_ASC[def[i]];k++;continue;}else if((
Ucs2_To_Gsm7_SPANISH_Table_ASC[def[i]]==NON_GSM)&&(def[i]==(0xdb3+3956-0x1d07)))
{gsm_default[k]=(0x10c+6847-0x1bab);k++;continue;}for(q=(0x1706+3013-0x22cb);q<
s1;q++){if(def[i]==zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[q][(0x22a6+888-0x261d)]
){gsm_default[k]=(0x625+5580-0x1bd6);k++;gsm_default[k]=
zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[q][(0x1065+2885-0x1baa)];break;}}}else{tmp
=(def[i]<<(0x6c5+3056-0x12ad))+def[i+(0x69+2460-0xa04)];i++;if(tmp==8364){
gsm_default[k]=(0xab+4035-0x1053);k++;gsm_default[k]=(0x5e2+584-0x7c5);k++;}for(
p=(0xa57+1913-0x11d0);p<s2;p++){if(tmp==Ucs2_To_Gsm7_SPANISH_Table_UCS[p][
(0xd71+6155-0x257b)]){gsm_default[k]=Ucs2_To_Gsm7_SPANISH_Table_UCS[p][
(0x6a7+3229-0x1344)];break;}}}k++;}gsm_default[k]='\0';return k;}unsigned long
zUfiSms_ConvertUcs2ToPortuguese(const unsigned char*def,unsigned char*
gsm_default,unsigned long len){unsigned long i=(0xcab+2064-0x14bb);unsigned long
k=(0x826+9-0x82f);unsigned long p=(0x363+1702-0xa09);unsigned long tmp=
(0x1129+4455-0x2290);unsigned long s1=(0x53b+8054-0x24b1),s2=
(0x16d4+1216-0x1b94);unsigned long q=(0x20b+7950-0x2119);s1=sizeof(
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex)/sizeof(
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[(0x5e6+7944-0x24ee)]);s2=sizeof(
Ucs2_To_Gsm7_PORTUGUESE_Table_UCS)/sizeof(Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[
(0x261f+229-0x2704)]);for(i=(0x32c+7708-0x2148);i<len;i++){if(def[i]==
(0x191+479-0x370)){i++;if(Ucs2_To_Gsm7_PORTUGUESE_Table_ASC[def[i]]!=NON_GSM){
gsm_default[k]=Ucs2_To_Gsm7_PORTUGUESE_Table_ASC[def[i]];k++;continue;}else if((
Ucs2_To_Gsm7_PORTUGUESE_Table_ASC[def[i]]==NON_GSM)&&(def[i]==
(0x76f+6517-0x20c4))){gsm_default[k]=(0x64f+6327-0x1ee6);k++;continue;}for(q=
(0xf10+4988-0x228c);q<s1;q++){if(def[i]==
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[q][(0x6a5+7881-0x256d)]){gsm_default[k]
=(0xdb7+3300-0x1a80);k++;gsm_default[k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex
[q][(0x10c4+2804-0x1bb8)];break;}}}else{tmp=(def[i]<<(0xec1+5459-0x240c))+def[i+
(0x1776+1877-0x1eca)];i++;if(tmp==(0x23cc+1598-0x95e)){gsm_default[k]=
(0x20b3+1578-0x26c2);k++;gsm_default[k]=(0xd2f+4200-0x1d32);k++;continue;}for(p=
(0xe67+5775-0x24f6);p<s2;p++){if(tmp==Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[p][
(0xc07+5677-0x2233)]){gsm_default[k]=Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[p][
(0x1bbb+2535-0x25a2)];break;}}}k++;}gsm_default[k]='\0';return k;}unsigned long
zUfiSms_ConvertUcs2ToGsmDefault(const unsigned char*def,unsigned char*
gsm_default,unsigned long len){unsigned long i=(0xc23+5515-0x21ae);unsigned long
k=(0x1c36+1708-0x22e2);unsigned long p=(0xef9+1072-0x1329);unsigned long tmp=
(0x1e1a+110-0x1e88);unsigned long s1=(0xf68+343-0x10bf),s2=(0x15fc+272-0x170c);
unsigned long q=(0xaad+5477-0x2012);s1=sizeof(
zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex[
(0xd90+5585-0x2361)]);s2=sizeof(UCS2_To_GSMDefault_Table_UCS2)/sizeof(
UCS2_To_GSMDefault_Table_UCS2[(0xdbf+3918-0x1d0d)]);for(i=(0x1cb+5828-0x188f);i<
len;i++){if(def[i]==(0x1a03+1031-0x1e0a)){i++;if(UCS2_To_GSMDefault_Table_ASC[
def[i]]!=NON_GSM){gsm_default[k]=UCS2_To_GSMDefault_Table_ASC[def[i]];k++;
continue;}else if((UCS2_To_GSMDefault_Table_ASC[def[i]]==NON_GSM)&&(def[i]==
(0x1560+2852-0x2064))){gsm_default[k]=(0xf76+3597-0x1d63);k++;continue;}for(q=
(0xc6b+3052-0x1857);q<s1;q++){if(def[i]==zte_sms_GSMDefault_To_UCS2_Table_Ex[q][
(0xde6+1508-0x13c9)]){gsm_default[k]=(0x36d+8358-0x23f8);k++;gsm_default[k]=
zte_sms_GSMDefault_To_UCS2_Table_Ex[q][(0x65a+434-0x80c)];break;}}}else{tmp=(def
[i]<<(0x7d1+2368-0x1109))+def[i+(0x12af+3896-0x21e6)];i++;if(tmp==8364){
gsm_default[k]=(0x14e8+4368-0x25dd);k++;gsm_default[k]=(0xe91+2611-0x185f);k++;
continue;}for(p=(0x72c+5867-0x1e17);p<s2;p++){if(tmp==
UCS2_To_GSMDefault_Table_UCS2[p][(0x4a1+8616-0x2648)]){gsm_default[k]=
UCS2_To_GSMDefault_Table_UCS2[p][(0xda1+1819-0x14bc)];break;}}}k++;}gsm_default[
k]='\0';return k;}UINT8 zUfiSms_TsIntToBcd(const UINT8 i){return(UINT8)(((i%
(0x709+7240-0x2347))+((i/(0x113b+2343-0x1a58))<<(0x9b4+1265-0xea1))));}void
zUfiSms_DecodeRelativeTime(UINT8 iValidTime,T_zUfiSms_TimeStamp*ptTimeStamp){
uint32 i=(0x15a5+3597-0x23b2);if(ptTimeStamp!=NULL){memset((void*)ptTimeStamp,
(0x5d7+1230-0xaa5),sizeof(wms_timestamp_s_type));if(iValidTime<
(0x12d8+1203-0x16fb)){i=(iValidTime+(0x419+2621-0xe55))*(0x2a1+6516-0x1c10);
ptTimeStamp->hour=(UINT8)zUfiSms_TsIntToBcd((UINT8)(i/(0x689+1542-0xc53)));
ptTimeStamp->minute=(UINT8)zUfiSms_TsIntToBcd((UINT8)(i%(0x3dc+5393-0x18b1)));}
else if(iValidTime<(0x502+7806-0x22d9)){i=(iValidTime-(0xc7d+5250-0x2070))*
(0x1b26+2871-0x263f);ptTimeStamp->hour=(UINT8)zUfiSms_TsIntToBcd((UINT8)(
(0x222d+881-0x2592)+i/(0x45+9058-0x236b)));ptTimeStamp->minute=(UINT8)
zUfiSms_TsIntToBcd((UINT8)(i%(0x1dff+987-0x219e)));}else if(iValidTime<
(0x153+102-0xf4)){i=iValidTime-(0x417+436-0x525);ptTimeStamp->month=(UINT8)
zUfiSms_TsIntToBcd((UINT8)(i/(0x980+2474-0x130c)));ptTimeStamp->day=(UINT8)
zUfiSms_TsIntToBcd((UINT8)(i%(0x16b4+1716-0x1d4a)));}else{i=(iValidTime-
(0x2b1+7615-0x1fb0))*(0x1227+2850-0x1d42);ptTimeStamp->year=(UINT8)
zUfiSms_TsIntToBcd((UINT8)(i/(0x38b+8755-0x2451)));ptTimeStamp->month=(UINT8)
zUfiSms_TsIntToBcd((UINT8)((i%(0x11e9+2841-0x1b95))/(0x1160+5031-0x24e9)));
ptTimeStamp->day=(UINT8)zUfiSms_TsIntToBcd((UINT8)((i%(0x291+1177-0x5bd))%
(0x13d4+3534-0x2184)));}}else{printf(
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x72\x65\x6c\x61\x74\x69\x76\x65\x5f\x74\x69\x6d\x65"
);}}int zUfiSms_CharToInt(char*pCharArray,int iLen,unsigned char*pIntArray){int
i=(0x1ce8+312-0x1e20);if(pIntArray==NULL||pCharArray==NULL){return ZUFI_FAIL;}
for(i=(0x1064+1359-0x15b3);i<iLen;i++){pIntArray[i]=pCharArray[i]-
((char)(0x443+6338-0x1cd5));}return ZUFI_SUCC;}void zUfiSms_FillGlobalTpudGsm7(
T_zUfiSms_SubmitTpdu*ptSubmit,T_zUfiSms_ConcatInfo*ptConcatSms,
T_zUfiSms_DbStoreData*ptDbSaveData){int i=(0x1997+1869-0x20e4);if(ptConcatSms->
total_msg>(0x44+6031-0x17d2)){g_zUfiSms_SendingSms.TP_UDHI=(0xe85+4031-0x1e43);
g_zUfiSms_SendingSms.TP_UD[(0x23d+4712-0x14a5)]=(0x8d8+4497-0x1a64);
g_zUfiSms_SendingSms.TP_UD[(0x8f7+957-0xcb3)]=(0x15e7+2460-0x1f7e);
g_zUfiSms_SendingSms.TP_UD[(0x10ea+4316-0x21c4)]=(0x2299+415-0x2435);
g_zUfiSms_SendingSms.TP_UD[(0x511+8567-0x2685)]=(char)ptDbSaveData->concat_info[
(0x13fd+1254-0x18e3)]%(0x8f6+1400-0xd6f);g_zUfiSms_SendingSms.TP_UD[
(0x1878+2366-0x21b2)]=(char)ptConcatSms->total_msg;g_zUfiSms_SendingSms.TP_UD[
(0x1e7c+1247-0x2356)]=(char)ptConcatSms->current_sending+(0x25db+137-0x2663);
g_zUfiSms_SendingSms.TP_UD[(0x1a56+1978-0x220a)]=(0x192d+1281-0x1e28);for(i=
(0x1fd+9359-0x268c);i<ptSubmit->user_data.sm_len;i++){g_zUfiSms_SendingSms.TP_UD
[i+(0x44f+7147-0x2033)]=ptSubmit->user_data.sm_data[i];}g_zUfiSms_SendingSms.
TP_UDLength=ptSubmit->user_data.sm_len+(0xa26+4256-0x1abf);}else{for(i=
(0xd78+22-0xd8e);i<ptSubmit->user_data.sm_len;i++){g_zUfiSms_SendingSms.TP_UD[i]
=ptSubmit->user_data.sm_data[i];}g_zUfiSms_SendingSms.TP_UDLength=ptSubmit->
user_data.sm_len;}}void zUfiSms_FillGlobalTpudUcs2(T_zUfiSms_SubmitTpdu*ptSubmit
,T_zUfiSms_ConcatInfo*ptConcatSms,T_zUfiSms_DbStoreData*ptDbSaveData){if(
ptConcatSms->total_msg>(0x72b+2885-0x126f)){g_zUfiSms_SendingSms.TP_UDHI=
(0x798+1402-0xd11);g_zUfiSms_SendingSms.TP_UD[(0x2278+17-0x2289)]=
(0x1b7d+1039-0x1f87);g_zUfiSms_SendingSms.TP_UD[(0x512+6197-0x1d46)]=
(0xcc5+4515-0x1e63);g_zUfiSms_SendingSms.TP_UD[(0x1fe4+255-0x20e1)]=
(0x1408+928-0x17a5);g_zUfiSms_SendingSms.TP_UD[(0x182c+1895-0x1f90)]=(char)
ptDbSaveData->concat_info[(0x1d11+350-0x1e6f)]%(0xa94+32-0x9b5);
g_zUfiSms_SendingSms.TP_UD[(0x2aa+3542-0x107c)]=(char)ptConcatSms->total_msg;
g_zUfiSms_SendingSms.TP_UD[(0x149+1531-0x73f)]=(char)ptConcatSms->
current_sending+(0x14c1+2862-0x1fee);(void)Bytes2String(ptSubmit->user_data.
sm_data,&g_zUfiSms_SendingSms.TP_UD[(0x71+6190-0x1899)],ptSubmit->user_data.
sm_len);}else{(void)Bytes2String(ptSubmit->user_data.sm_data,
g_zUfiSms_SendingSms.TP_UD,ptSubmit->user_data.sm_len);}}unsigned char
zUfiSms_Low2High(unsigned char x){if(x>=((char)(0x1617+1602-0x1bf8))&&x<
((char)(0xd27+5916-0x23dc))){x=(x-((char)(0xbb3+7021-0x26bf)))+
((char)(0x46f+8218-0x2448));}return x;}unsigned char zUfiSms_Char2Dec(unsigned
char x){unsigned char d=(0x189+395-0x314);if(x>=((char)(0xc73+2126-0x1480))&&x<
((char)(0x449+2096-0xc32))){d=(x-((char)(0xfb1+1118-0x13ce)))+
(0x1356+689-0x15fd);}else{d=x-((char)(0x19e8+1030-0x1dbe));}return d;}unsigned
char zUfiSms_Char2Byte(unsigned char a,unsigned char b){unsigned char data=
(0xe56+1410-0x13d8);unsigned char l=(0x2ad+4043-0x1278),h=(0x159b+2361-0x1ed4);a
=zUfiSms_Low2High(a);b=zUfiSms_Low2High(b);h=zUfiSms_Char2Dec(a);l=
zUfiSms_Char2Dec(b);data=h*(0xa9c+2237-0x1349)+l;return data;}void
zUfiSms_Str2Bytes(unsigned char*text,int text_len,unsigned char*data,int
data_len){int i=(0x476+5592-0x1a4e);while((0xc29+6108-0x2403)*i+
(0x358+5788-0x19f3)<text_len){data[i]=zUfiSms_Char2Byte(text[(0x185+1585-0x7b4)*
i],text[(0xdba+13-0xdc5)*i+(0x267+5321-0x172f)]);i++;}}int zUfiSms_SplitString(
char*input,char***output,char cMatchChar){int src=(0x15f5+4032-0x25b5);int dst=
(0x1644+3564-0x2430);int count=(0x47b+1436-0xa17);int size=(0x1b62+2824-0x2662);
char quoted=(0x4d7+4526-0x1685);char**tmpout=NULL;*output=(char**)malloc(sizeof(
char*)*size);if(NULL==*output){return-(0x266+5476-0x17c9);}(*output)[count++]=
input;for(src=dst=(0x1b0d+2080-0x232d);input[src];){char cInputChar=input[src];
if(!quoted&&cInputChar==cMatchChar){input[dst++]=(0x188f+549-0x1ab4);while(input
[++src]&&(int)isspace(input[src])){};if(count>=size){size+=(0x94a+3195-0x15b5);
tmpout=(char**)realloc(*output,sizeof(char*)*size);if(NULL==tmpout){return-
(0xf58+9-0xf60);}*output=tmpout;}(*output)[count++]=input+dst;}else if(!quoted&&
(cInputChar=='\''||cInputChar==((char)(0xac6+6539-0x242f)))){quoted=cInputChar;
src++;}else if(cInputChar==quoted){quoted=(0xd16+1124-0x117a);src++;}else{if(
cInputChar=='\\'&&quoted!='\''){src++;cInputChar=input[src];if(!cInputChar){free
(*output);*output=NULL;return-(0x1075+5067-0x243f);}}input[dst++]=cInputChar;src
++;}}input[dst]=(0xaf4+7054-0x2682);if(quoted){free(*output);*output=NULL;return
-(0x8f6+3498-0x169f);}return count;}int zUfiSms_atohex(char c){int result=
(0xff0+5138-0x2402);if(c>=((char)(0xf57+4735-0x21a6))&&c<=
((char)(0x64+115-0x9e))){result=c-((char)(0x2eb+270-0x3c9));}else if(c>=
((char)(0x1ccc+467-0x1e3e))&&c<=((char)(0x1327+4912-0x25f1))){result=(c-
((char)(0x545+6387-0x1dd7)))+(0x2dc+5156-0x16f6);}else if(c>=
((char)(0x7da+4560-0x1969))&&c<=((char)(0xa5f+5737-0x2082))){result=(c-
((char)(0x460+1866-0xb69)))+(0x4c7+1114-0x917);}else{at_print(LOG_DEBUG,
"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x61\x74\x6f\x68\x65\x78\x20\x65\x72\x72\x6f\x72\x2c\x63\x61\x6e\x20\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x63\x68\x61\x72\x3a\x25\x63" "\n"
,c);return result;}return result;}int zUfiSms_DispatchWtoi(unsigned char*in_ptr,
int iLength,unsigned char*out_ptr){int low=(0x16f4+736-0x19d4);int high=
(0x1d9d+1045-0x21b2);if(in_ptr==NULL||out_ptr==NULL){printf(
"\x7a\x74\x65\x5f\x73\x6d\x73\x3a\x69\x6e\x76\x61\x69\x6c\x64\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72" "\n"
);return ZUFI_FAIL;}while(iLength>(0xd41+259-0xe44)){low=in_ptr[iLength-
(0xf66+3960-0x1edd)]&(0x745+4716-0x19a2);high=(in_ptr[iLength-
(0xbdc+6509-0x2548)]&(0xa36+7101-0x2503))>>(0xa2+5379-0x15a1);out_ptr[
(0x137+4052-0x1109)*iLength-(0x131+5378-0x1632)]=g_zUfiSms_DigAscMap[low];
out_ptr[(0x17ea+2520-0x21c0)*iLength-(0xfdc+3684-0x1e3e)]=g_zUfiSms_DigAscMap[
high];iLength--;}return ZUFI_SUCC;}unsigned int
zte_wms_convert_PORTUGUESE_To_UCS2(const unsigned char*gsmdef,unsigned char*ucs2
,unsigned int len){unsigned int i=(0x31+804-0x355);unsigned int j=
(0x723+7394-0x2405);unsigned int k=(0x309+9082-0x2683);unsigned int p=
(0x5c4+7712-0x23e4);unsigned int s=(0x622+8356-0x26c6);s=sizeof(
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex)/sizeof(
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[(0x6fa+909-0xa87)]);for(i=
(0xb10+6410-0x241a);i<len;i++){j=gsmdef[i];if(j==(0x906+5187-0x1d2e)){i++;for(p=
(0x9a7+3001-0x1560);p<s;p++){if(zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p][
(0xc8d+70-0xcd3)]==gsmdef[i]){ucs2[k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p
][(0xea4+2408-0x180b)]>>(0xd02+1657-0x1373);k++;ucs2[k]=(unsigned char)(
zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p][(0x12d8+693-0x158c)]);break;}}}else{
ucs2[k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]>>(0x785+6371-0x2060);k++;ucs2[k
]=(unsigned char)(zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]);}k++;}ucs2[k]='\0';
return k;}unsigned int zte_wms_convert_PORTUGUESE_To_UCS2_USE_GSM7_SS_PORTU_LS(
const unsigned char*gsmdef,unsigned char*ucs2,unsigned int len){unsigned int i=
(0x868+340-0x9bc);unsigned int j=(0x2153+914-0x24e5);unsigned int k=
(0x2a3+6101-0x1a78);unsigned int p=(0x6c4+6773-0x2139);unsigned int s=
(0xa5c+7127-0x2633);s=sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof(
zte_sms_GSMDefault_To_UCS2_Table_Ex[(0x22af+689-0x2560)]);for(i=
(0xcef+6676-0x2703);i<len;i++){j=gsmdef[i];if(j==(0x129c+3788-0x214d)){i++;for(p
=(0x1171+4803-0x2434);p<s;p++){if(zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
(0x1249+691-0x14fc)]==gsmdef[i]){ucs2[k]=zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
(0x762+2052-0xf65)]>>(0x3f7+6971-0x1f2a);k++;ucs2[k]=(unsigned char)(
zte_sms_GSMDefault_To_UCS2_Table_Ex[p][(0xcd7+4700-0x1f32)]);break;}}}else{ucs2[
k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]>>(0x269b+54-0x26c9);k++;ucs2[k]=(
unsigned char)(zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]);}k++;}ucs2[k]='\0';
return k;}unsigned long zte_wms_convert_GSMDefault_to_UCS2(const unsigned char*
gsmdef,unsigned char*ucs2,unsigned long len){unsigned long i=(0xa72+107-0xadd);
unsigned long j=(0x74+9003-0x239f);unsigned long k=(0x1310+339-0x1463);unsigned
long p=(0x7d3+1062-0xbf9);unsigned long s=(0x570+8002-0x24b2);unsigned long
is_find=(0x8c+8712-0x2294);s=sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof(
zte_sms_GSMDefault_To_UCS2_Table_Ex[(0x189d+552-0x1ac5)]);for(i=
(0x38c+6751-0x1deb);i<len;i++){j=gsmdef[i];if(j==(0x1e02+535-0x1ffe)){i++;for(p=
(0x12c8+794-0x15e2);p<s;p++){if(zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
(0x744+1022-0xb42)]==gsmdef[i]){ucs2[k]=zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
(0x974+5411-0x1e96)]>>(0x761+5644-0x1d65);k++;ucs2[k]=(unsigned char)(
zte_sms_GSMDefault_To_UCS2_Table_Ex[p][(0x9d7+69-0xa1b)]);is_find=
(0xcfa+2132-0x154d);break;}}if(!is_find){at_print(LOG_DEBUG,
"\x7a\x74\x65\x5f\x73\x6d\x73\x3a\x20\x64\x61\x74\x61\x20\x3d\x20\x25\x64\x20\x6e\x6f\x74\x20\x66\x69\x6e\x64\x20\x69\x6e\x20\x67\x73\x6d\x64\x65\x66\x61\x75\x6c\x74\x20\x65\x78\x74\x65\x6e\x73\x69\x6f\x6e\x20\x74\x61\x62\x6c\x65" "\n"
,gsmdef[i]);i--;ucs2[k]=zte_sms_GSMDefault_To_UCS2_Table[j]>>(0xa2+7525-0x1dff);
k++;ucs2[k]=(unsigned char)(zte_sms_GSMDefault_To_UCS2_Table[j]);}}else{ucs2[k]=
zte_sms_GSMDefault_To_UCS2_Table[j]>>(0x428+4271-0x14cf);k++;ucs2[k]=(unsigned
char)(zte_sms_GSMDefault_To_UCS2_Table[j]);}k++;}ucs2[k]='\0';return k;}void
zUfiSms_ConvertUcs2(char*data,UINT16 sms_len,char*out_content){char
ascii_content[(0x1050+698-0x1308)*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX+
(0x1769+376-0x18e0)]={(0xa88+3942-0x19ee)};UINT16 len=(0x563+5964-0x1caf);switch
(g_zUfiSms_Language){case DCS_PORTUGUESE:if(g_zUfiSms_IsLanguageShift==
WMS_UDH_NAT_LANG_SS){len=zte_wms_convert_PORTUGUESE_To_UCS2((const UINT8*)data,(
UINT8*)ascii_content,sms_len);}else if(g_zUfiSms_IsLanguageShift==
WMS_UDH_NAT_LANG_LS){len=zte_wms_convert_PORTUGUESE_To_UCS2_USE_GSM7_SS_PORTU_LS
((const UINT8*)data,(UINT8*)ascii_content,sms_len);}break;case DCS_USC:default:
len=zte_wms_convert_GSMDefault_to_UCS2((const UINT8*)data,(UINT8*)ascii_content,
sms_len);break;}(void)zUfiSms_DispatchWtoi((char*)ascii_content,len,(char*)
out_content);}boolean zUfiSms_DecodeContent(char*msg_content,UINT16 sms_len,
boolean isEsc,char*out_content){boolean endEsc=FALSE;char*p=NULL;static char
data[(0x1b23+1513-0x210b)+(0x1021+1808-0x1691)+(0x337+5177-0x176f)]={
(0x1674+455-0x183b)};int len=(0x1041+3236-0x1ce5);if(msg_content==NULL||
out_content==NULL||sms_len>(0x12e6+441-0x135f)||sms_len<(0x446+7183-0x2053)){
return endEsc;}len=sms_len;memset(data,(0x844+3346-0x1556),(0x1539+2780-0x1f73))
;p=data;if(isEsc){*p=(0xa0d+6594-0x23b4);p++;}zUfiSms_Str2Bytes((unsigned char*)
msg_content,len,(unsigned char*)p,(0xc94+6378-0x24de));if(p[len/
(0x1387+2180-0x1c09)-(0x688+6997-0x21dc)]==(0x806+4381-0x1908)){endEsc=TRUE;}
zUfiSms_ConvertUcs2(data,len/(0x1fd0+1728-0x268e)+(isEsc?(0x17b1+1177-0x1c49):
(0x14ed+2324-0x1e01))-(endEsc?(0x108+6990-0x1c55):(0x4e6+2958-0x1074)),
out_content);return endEsc;}byte*zUfiSms_SmsiUtilitoa(uint32 v,byte*s,UINT16 r){
byte buf[(0x958+4652-0x1b63)],c;int n;n=sizeof(buf)-(0x998+652-0xc23);buf[n]=
'\0';do{c=(byte)(v%r);if(n<=(0x13b9+2358-0x1cef)){printf(
"\x4f\x56\x45\x52\x46\x4c\x4f\x57\x20");break;}buf[--n]=(byte)((c>
(0x11d+2816-0xc14))?c+((char)(0x1954+1989-0x20d8))-(0x10d8+1456-0x167e):c+
((char)(0xe0b+527-0xfea)));}while((v/=r)>(0x1212+3125-0x1e47));while((*s++=buf[n
++])!=(0x1480+2431-0x1dff));return(s-(0x212+583-0x458));}byte*
zUfiSms_SmsiAddrToStr(wms_address_s_type addr,byte*res_ptr,UINT8*type_of_addr){
byte bcd_idx=(0x9d9+5623-0x1fd0);UINT8 temp=(0xacc+6837-0x2581);*type_of_addr=
(0xf8a+295-0x10b1);temp=(UINT8)((uint32)addr.number_type&(0x15db+3647-0x2413));*
type_of_addr=(UINT8)((*type_of_addr|temp)<<(0x762+5886-0x1e5c));temp=(UINT8)((
uint32)addr.number_plan&(0x1de3+1007-0x21cb));*type_of_addr=*type_of_addr|temp;*
type_of_addr=*type_of_addr|(0x1115+4007-0x203c);while(bcd_idx<addr.
number_of_digits){if(addr.digits[bcd_idx]==(0x279+152-0x307)){addr.digits[
bcd_idx]=(0x3b7+5016-0x174f);}res_ptr=zUfiSms_SmsiUtilitoa((uint32)addr.digits[
bcd_idx],res_ptr,(0x323+1449-0x8bc));bcd_idx++;}return res_ptr;}byte*
zUfiSms_SmsiUtilitoaFill(word v,byte*rb_ptr){int n;byte c,*ptr;ptr=rb_ptr+
(0x5e9+655-0x876);*ptr='\0';for(n=(0x1315+411-0x14b0);n<(0x756+6837-0x2209);++n)
{c=(byte)(v%(0x784+1503-0xd59));v/=(0xb6b+53-0xb96);*--ptr=(c+
((char)(0xe20+5627-0x23eb)));}return rb_ptr+(0x12ed+4015-0x229a);}void
zUfiSms_SprintfTime(char*str_time,int len,int t){if(t<(0x102f+3992-0x1fbd)){
snprintf(str_time,len,"\x30\x25\x78",t);}else{snprintf(str_time,len,"\x25\x78",t
);}}static void zUfiSms_ParseDeliverConcat8(T_zUfiSms_UdhConcat8*concat_8,
T_zUfiSms_DbStoreData*db_data){int mux=(0x2257+931-0x25fa);concat_8->seq_num--;
if(concat_8->total_sm>ZTE_WMS_CONCAT_SMS_COUNT_MAX){mux=(concat_8->seq_num-
concat_8->seq_num%ZTE_WMS_CONCAT_SMS_COUNT_MAX)/ZTE_WMS_CONCAT_SMS_COUNT_MAX;}
db_data->concat_sms=(0x4dd+798-0x7fa);db_data->concat_info[(0xc85+2718-0x1723)]=
(0x16f1+1900-0x1d5e)*mux+concat_8->msg_ref;db_data->concat_info[
(0x1ad+4968-0x1513)]=concat_8->seq_num%ZTE_WMS_CONCAT_SMS_COUNT_MAX+
(0xd2a+958-0x10e7);db_data->concat_info[(0x1ddb+375-0x1f51)]=concat_8->total_sm-
ZTE_WMS_CONCAT_SMS_COUNT_MAX*mux>ZTE_WMS_CONCAT_SMS_COUNT_MAX-
(0x514+6132-0x1d07)?ZTE_WMS_CONCAT_SMS_COUNT_MAX:(concat_8->total_sm%
ZTE_WMS_CONCAT_SMS_COUNT_MAX);}static void zUfiSms_ParserLangSs(wms_udh_s_type*
user_data_header){if(user_data_header==NULL){return;}switch(user_data_header->u.
nat_lang_ss.nat_lang_id){case WMS_UDH_NAT_LANG_PORTUGUESE:g_zUfiSms_Language=
DCS_PORTUGUESE;break;default:break;}}static void zUfiSms_ParserLangLs(
T_zUfiSms_Udh*user_data_header){if(user_data_header==NULL){return;}switch(
user_data_header->u.nat_lang_ss.nat_lang_id){case WMS_UDH_NAT_LANG_PORTUGUESE:
g_zUfiSms_Language=DCS_PORTUGUESE;break;default:break;}}static void
zUfiSms_ParseDeliverConcat16(T_zUfiSms_UdhConcat16*concat_16,
T_zUfiSms_DbStoreData*db_data){int mux=(0x1d10+2478-0x26be);concat_16->seq_num--
;db_data->concat_sms=(0x40+3044-0xc23);
#if (0x1793+1386-0x1cfd)
db_data->concat_info[(0x10f5+660-0x1389)]=concat_16->msg_ref;db_data->
concat_info[(0xaa+3377-0xdda)]=concat_16->total_sm;db_data->concat_info[
(0xc93+1739-0x135c)]=concat_16->seq_num;
#endif
if(concat_16->total_sm>ZTE_WMS_CONCAT_SMS_COUNT_MAX){mux=(concat_16->seq_num-
concat_16->seq_num%ZTE_WMS_CONCAT_SMS_COUNT_MAX)/ZTE_WMS_CONCAT_SMS_COUNT_MAX;}
db_data->concat_info[(0xd0c+305-0xe3d)]=(0x1624+1827-0x1c48)*mux+concat_16->
msg_ref;db_data->concat_info[(0xf97+1764-0x1679)]=concat_16->seq_num%
ZTE_WMS_CONCAT_SMS_COUNT_MAX+(0x1c0+1129-0x628);db_data->concat_info[
(0xfc2+4864-0x22c1)]=concat_16->total_sm-ZTE_WMS_CONCAT_SMS_COUNT_MAX*mux>
ZTE_WMS_CONCAT_SMS_COUNT_MAX-(0xbd6+2079-0x13f4)?ZTE_WMS_CONCAT_SMS_COUNT_MAX:(
concat_16->total_sm%ZTE_WMS_CONCAT_SMS_COUNT_MAX);}static int
zUfiSms_ParseUdhiData(T_zUfiSms_Udh*user_data_header,T_zUfiSms_DbStoreData*
db_data){if(NULL==user_data_header||NULL==db_data){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73\x2e");return ZUFI_FAIL
;}switch(user_data_header->header_id){case WMS_UDH_CONCAT_8:db_data->concat_sms=
(0x878+2372-0x11bb);zUfiSms_ParseDeliverConcat8(&(user_data_header->u.concat_8),
db_data);break;case WMS_UDH_CONCAT_16:db_data->concat_sms=(0x622+2791-0x1108);
zUfiSms_ParseDeliverConcat16(&(user_data_header->u.concat_16),db_data);break;
case WMS_UDH_NAT_LANG_SS:g_zUfiSms_IsLanguageShift=WMS_UDH_NAT_LANG_SS;
zUfiSms_ParserLangSs(user_data_header);break;case WMS_UDH_NAT_LANG_LS:
g_zUfiSms_IsLanguageShift=WMS_UDH_NAT_LANG_LS;zUfiSms_ParserLangLs(
user_data_header);break;default:printf(
"\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x74\x68\x6f\x73\x65\x20\x75\x73\x65\x72\x20\x68\x65\x61\x64\x65\x72"
);break;}return ZUFI_SUCC;}int zUfiSms_FormatDeliverDbdata(
T_zUfiSms_ClientTsData*ts_data_ptr,T_zUfiSms_DbStoreData*db_data){int result=
ZUFI_SUCC;wms_address_s_type*address_ptr=NULL;wms_gw_alphabet_e_type tp_dcs=
WMS_GW_ALPHABET_MAX32;int i=(0x714+3221-0x13a9);int ind=(0x23d5+607-0x2634);if((
NULL==ts_data_ptr)||(NULL==db_data)){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73\x2e");return ZUFI_FAIL
;}address_ptr=&(ts_data_ptr->u.gw_pp.u.deliver.address);if(
WMS_NUMBER_INTERNATIONAL==address_ptr->number_type){memset(db_data->number,
(0x896+6819-0x2339),ZTE_WMS_ADDRESS_LEN_MAX+(0xe92+920-0x1229));db_data->number[
(0x1954+2514-0x2326)]=((char)(0x343+228-0x3fc));for(i=(0x1004+3943-0x1f6b);i<
address_ptr->number_of_digits;i++){if((0x12bc+4759-0x2549)==address_ptr->digits[
i]){db_data->number[i+(0x1082+5615-0x2670)]=((char)(0x11c1+1576-0x17b9));}else{
db_data->number[i+(0xfa6+3485-0x1d42)]=((char)(0x314+6009-0x1a5d))+address_ptr->
digits[i];}}}else if(WMS_NUMBER_ALPHANUMERIC==address_ptr->number_type){memcpy(
db_data->number,address_ptr->digits,address_ptr->number_of_digits);}else{if(
address_ptr->digit_mode==WMS_DIGIT_MODE_8_BIT){memcpy(&(db_data->number[
(0x774+5835-0x1e3e)]),address_ptr->digits,address_ptr->number_of_digits);}else{
for(i=(0x6ed+1600-0xd2d);i<address_ptr->number_of_digits;i++){if(
(0xeef+2345-0x180e)==address_ptr->digits[i]){db_data->number[i]=
((char)(0x1061+2524-0x1a0d));}else{db_data->number[i]=((char)(0x127+2347-0xa22))
+address_ptr->digits[i];}}}}(void)zUfiSms_UtilTimeStamp(ts_data_ptr->u.gw_pp.u.
deliver.timestamp,db_data->tp_scts,&db_data->julian_date);if(ts_data_ptr->u.
gw_pp.u.deliver.user_data_header_present){db_data->tp_udhi=(0xbd3+5891-0x22d5);}
else{db_data->tp_udhi=(0xcd2+2742-0x1788);}if(db_data->tp_udhi==
(0x12c6+1308-0x17e1)){for(ind=(0xbc5+6959-0x26f4);ind<ts_data_ptr->u.gw_pp.u.
deliver.user_data.num_headers;ind++){result=zUfiSms_ParseUdhiData(&(ts_data_ptr
->u.gw_pp.u.deliver.user_data.headers[ind]),db_data);if(
ZTE_WMS_CONCAT_SMS_COUNT_MAX<db_data->concat_info[(0x48d+2376-0xdd4)]){printf(
"\x74\x68\x65\x20\x63\x6f\x6e\x63\x61\x74\x20\x73\x6d\x73\x20\x73\x65\x67\x6d\x65\x6e\x74\x20\x69\x73\x20\x25\x64\x2c\x61\x6e\x64\x20\x6c\x61\x72\x67\x65\x72\x20\x74\x68\x65\x6e\x20\x74\x68\x65\x20\x20\x73\x75\x70\x70\x6f\x72\x74\x65\x64\x20\x25\x64\x20\x73\x65\x67\x6d\x65\x6e\x74\x73\x2c\x73\x6f\x20\x64\x69\x64\x20\x6e\x6f\x74\x20\x64\x65\x61\x6c\x20\x74\x68\x65\x20\x63\x6f\x6e\x63\x61\x74\x20\x73\x6d\x73\x2e\x20"
,db_data->concat_info[(0x109+4679-0x134f)],ZTE_WMS_CONCAT_SMS_COUNT_MAX);if(
WMS_STORAGE_TYPE_NV_V01==db_data->mem_store){zUfiSms_DelModemSms(db_data->index)
;}result=ZUFI_FAIL;}}}tp_dcs=ts_data_ptr->u.gw_pp.u.deliver.dcs.alphabet;db_data
->sms_class=ts_data_ptr->u.gw_pp.u.deliver.dcs.msg_class;if(
WMS_GW_ALPHABET_8_BIT>=tp_dcs){db_data->tp_dcs=(unsigned char)
(0x833+4064-0x1812);}else if(WMS_GW_ALPHABET_UCS2==tp_dcs){db_data->tp_dcs=(
unsigned char)(0x4c5+1967-0xc72);}else{printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x74\x70\x5f\x64\x63\x73\x3d\x25\x64",tp_dcs);}
db_data->tp_pid=(unsigned char)ts_data_ptr->u.gw_pp.u.deliver.pid;if(ts_data_ptr
->u.gw_pp.u.deliver.dcs.alphabet==WMS_GW_ALPHABET_UCS2){result=
zUfiSms_DispatchWtoi(ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_data,
ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_len,db_data->sms_content);db_data->
alphabet=WMS_GW_ALPHABET_UCS2;}else if(ts_data_ptr->u.gw_pp.u.deliver.dcs.
alphabet==WMS_GW_ALPHABET_8_BIT){for(ind=(0x302+2343-0xc29);ind<ts_data_ptr->u.
gw_pp.u.deliver.user_data.sm_len;ind++){db_data->sms_content[(0x8d6+110-0x940)*
ind]=((char)(0x230+3654-0x1046));db_data->sms_content[(0xa7b+1960-0x121f)*ind+
(0x1ac+664-0x443)]=((char)(0xf59+2950-0x1aaf));db_data->sms_content[
(0x68d+5268-0x1b1d)*ind+(0x387+6605-0x1d52)]=g_zUfiSms_DigAscMap[((ts_data_ptr->
u.gw_pp.u.deliver.user_data.sm_data[ind]&(0xccd+894-0xf5b))>>(0x19fc+62-0x1a36))
];db_data->sms_content[(0x10f5+4585-0x22da)*ind+(0x92a+4517-0x1acc)]=
g_zUfiSms_DigAscMap[(ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_data[ind]&
(0x154c+4399-0x266c))];db_data->alphabet=WMS_GW_ALPHABET_UCS2;}}else if(
ts_data_ptr->u.gw_pp.u.deliver.dcs.alphabet==WMS_GW_ALPHABET_7_BIT_DEFAULT){
result=zUfiSms_DispatchWtoi(ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_data,
ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_len,db_data->sms_content);db_data->
alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;db_data->tp_dcs=(unsigned char)
(0xefc+6080-0x26ba);}return result;}int zUfiSms_FormatSubmitDbdata(
T_zUfiSms_ClientTsData*ts_data_ptr,T_zUfiSms_DbStoreData*db_data){int result=
ZUFI_SUCC;wms_address_s_type*address_ptr=NULL;wms_gw_alphabet_e_type tp_dcs=
WMS_GW_ALPHABET_MAX32;int i=(0x1b4f+2865-0x2680);int ind=(0x11a+5097-0x1503);if(
(NULL==ts_data_ptr)||(NULL==db_data)){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73\x2e");return ZUFI_FAIL
;}address_ptr=&(ts_data_ptr->u.gw_pp.u.submit.address);if((
WMS_NUMBER_INTERNATIONAL==address_ptr->number_type)){db_data->number[
(0x3af+8740-0x25d3)]=((char)(0x19bf+2713-0x242d));for(i=(0x3b+3797-0xf10);i<
address_ptr->number_of_digits;i++){if((0x77b+7763-0x25c4)==address_ptr->digits[i
]){db_data->number[i+(0x1071+233-0x1159)]=((char)(0x2b6+4679-0x14cd));}else{
db_data->number[i+(0x1d83+1697-0x2423)]=((char)(0x14fc+2238-0x1d8a))+address_ptr
->digits[i];}}}else{for(i=(0x5ca+5277-0x1a67);i<address_ptr->number_of_digits;i
++){if((0x414+7766-0x2260)==address_ptr->digits[i]){db_data->number[i]=
((char)(0xaf+2981-0xc24));}else{db_data->number[i]=((char)(0x479+7202-0x206b))+
address_ptr->digits[i];}}}tp_dcs=ts_data_ptr->u.gw_pp.u.submit.dcs.alphabet;
db_data->sms_class=ts_data_ptr->u.gw_pp.u.submit.dcs.msg_class;if(
WMS_GW_ALPHABET_8_BIT>=tp_dcs){db_data->tp_dcs=(unsigned char)
(0x1e45+1164-0x22d0);}else if(WMS_GW_ALPHABET_UCS2==tp_dcs){db_data->tp_dcs=(
unsigned char)(0x25a3+110-0x260f);}else{printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x74\x70\x5f\x64\x63\x73\x3d\x25\x64",tp_dcs);}
db_data->tp_pid=(unsigned char)ts_data_ptr->u.gw_pp.u.submit.pid;db_data->
msg_ref=(unsigned char)ts_data_ptr->u.gw_pp.u.submit.message_reference;if(
ts_data_ptr->u.gw_pp.u.submit.user_data_header_present){db_data->tp_udhi=
(0x452+2705-0xee2);}else{db_data->tp_udhi=(0x415+3013-0xfda);}if(db_data->
tp_udhi==(0x3df+2418-0xd50)){for(ind=(0x2b+1436-0x5c7);ind<ts_data_ptr->u.gw_pp.
u.submit.user_data.num_headers;ind++){result=zUfiSms_ParseUdhiData(&(ts_data_ptr
->u.gw_pp.u.submit.user_data.headers[ind]),db_data);if(
ZTE_WMS_CONCAT_SMS_COUNT_MAX<db_data->concat_info[(0x564+7263-0x21c2)]){printf(
"\x74\x68\x65\x20\x63\x6f\x6e\x63\x61\x74\x20\x73\x6d\x73\x20\x73\x65\x67\x6d\x65\x6e\x74\x20\x69\x73\x20\x6c\x61\x72\x67\x65\x72\x20\x74\x68\x65\x6e\x20\x74\x68\x65\x20\x20\x73\x75\x70\x70\x6f\x72\x74\x65\x64\x20\x73\x65\x67\x6d\x65\x6e\x74\x73\x2c\x73\x6f\x20\x64\x69\x64\x20\x6e\x6f\x74\x20\x64\x65\x61\x6c\x20\x74\x68\x65\x20\x63\x6f\x6e\x63\x61\x74\x20\x73\x6d\x73\x2e"
);if(WMS_STORAGE_TYPE_NV_V01==db_data->mem_store){zUfiSms_DelModemSms(db_data->
index);}result=ZUFI_FAIL;}}}if(ts_data_ptr->u.gw_pp.u.submit.dcs.alphabet==
WMS_GW_ALPHABET_UCS2){result=zUfiSms_DispatchWtoi(ts_data_ptr->u.gw_pp.u.submit.
user_data.sm_data,ts_data_ptr->u.gw_pp.u.submit.user_data.sm_len,db_data->
sms_content);db_data->alphabet=WMS_GW_ALPHABET_UCS2;}else if(ts_data_ptr->u.
gw_pp.u.submit.dcs.alphabet==WMS_GW_ALPHABET_8_BIT){for(ind=(0x1bb+8226-0x21dd);
ind<ts_data_ptr->u.gw_pp.u.submit.user_data.sm_len;ind++){db_data->sms_content[
(0x9+8457-0x210e)*ind]=((char)(0x525+4088-0x14ed));db_data->sms_content[
(0xbd7+5785-0x226c)*ind+(0x11f7+4947-0x2549)]=((char)(0x8b+6563-0x19fe));db_data
->sms_content[(0x182f+479-0x1a0a)*ind+(0x117+1344-0x655)]=g_zUfiSms_DigAscMap[((
ts_data_ptr->u.gw_pp.u.submit.user_data.sm_data[ind]&(0x627+1920-0xcb7))>>
(0x5b2+3787-0x1479))];db_data->sms_content[(0x474+9-0x479)*ind+
(0x1c5b+2220-0x2504)]=g_zUfiSms_DigAscMap[(ts_data_ptr->u.gw_pp.u.submit.
user_data.sm_data[ind]&(0x10d+2683-0xb79))];db_data->alphabet=
WMS_GW_ALPHABET_UCS2;}}else if(ts_data_ptr->u.gw_pp.u.submit.dcs.alphabet==
WMS_GW_ALPHABET_7_BIT_DEFAULT){result=zUfiSms_DispatchWtoi(ts_data_ptr->u.gw_pp.
u.submit.user_data.sm_data,ts_data_ptr->u.gw_pp.u.submit.user_data.sm_len,
db_data->sms_content);db_data->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;db_data->
tp_dcs=(unsigned char)(0x17c9+2899-0x231a);}return result;}int InvertNumbers(
const char*pSrc,char*pDst,int nSrcLength){int nDstLength;char ch;int i=
(0x546+3786-0x1410);if(pSrc==NULL||pDst==NULL||nSrcLength<(0x15f0+995-0x19d3)){
return-(0x2a0+5032-0x1647);}nDstLength=nSrcLength;for(i=(0x15eb+3155-0x223e);i<
nSrcLength;i+=(0xa30+4257-0x1acf)){ch=*pSrc++;*pDst++=*pSrc++;*pDst++=ch;}if(
nSrcLength&(0xd32+1671-0x13b8)){*(pDst-(0x434+841-0x77b))=
((char)(0x2191+922-0x24e5));nDstLength++;}*pDst='\0';return nDstLength;}int
code_is_gsm7(const SMS_PARAM*pSrc,unsigned char buf[],int nLength){if(pSrc->
TP_UDHI==(0x8a8+3752-0x174f)){buf[(0xcb1+1043-0x10c1)]=(unsigned char)nLength;
buf[(0x245+5619-0x1834)]=(unsigned char)pSrc->TP_UD[(0xd73+6547-0x2706)];buf[
(0x7f8+1817-0xf0c)]=(0xa3f+4800-0x1cff);buf[(0x3a1+4710-0x1601)]=(unsigned char)
pSrc->TP_UD[(0x1627+1769-0x1d0e)];buf[(0x1ab8+2077-0x22ce)]=(unsigned char)pSrc
->TP_UD[(0x82f+755-0xb1f)];buf[(0x108c+775-0x138b)]=(unsigned char)pSrc->TP_UD[
(0xe2f+5855-0x250a)];buf[(0xa7f+7017-0x25df)]=(unsigned char)pSrc->TP_UD[
(0x1853+384-0x19ce)];buf[(0x13d1+1805-0x1ad4)]=(unsigned char)pSrc->TP_UD[
(0xa69+2211-0x1305)];buf[(0x1122+2804-0x1c0c)]=(unsigned char)(buf[
(0x6d6+3371-0x13f7)]<<(0xca4+5569-0x2264));nLength=nLength-(0x14b+6343-0x1a0b);
nLength=Encode7bit(&(pSrc->TP_UD[(0xc45+1940-0x13d1)]),&buf[(0xb7a+1061-0xf94)],
nLength+(0xc07+156-0xca2))+(0xdd0+1389-0x1339)+(0x83+2698-0xb07);
#if (0x14bf+2826-0x1fc9)
nLength+=(0x69+3454-0xde5);
#endif
}else{nLength=pSrc->TP_UDLength;buf[(0x1728+282-0x183f)]=nLength;nLength=
Encode7bit(pSrc->TP_UD,&buf[(0x196+6242-0x19f4)],nLength+(0x9b4+2683-0x142e))+
(0x11c+319-0x257);}at_print(LOG_DEBUG,
"\x62\x75\x66\x20\x69\x73\x20\x25\x73" "\n",buf);return nLength;}int
code_is_ucs2(const SMS_PARAM*pSrc,unsigned char buf[],int nLength){nLength=
strlen(pSrc->TP_UD);if(pSrc->TP_UDHI==(0x301+3236-0xfa4)){buf[
(0x1938+1924-0x20b9)]=(unsigned char)nLength;buf[(0x222a+182-0x22dc)]=(unsigned
char)pSrc->TP_UD[(0xcdc+3153-0x192d)];buf[(0x192d+2867-0x245b)]=
(0xba7+2758-0x166d);buf[(0xe66+2183-0x16e7)]=(unsigned char)pSrc->TP_UD[
(0xa79+2303-0x1376)];buf[(0x15db+4123-0x25ef)]=(unsigned char)pSrc->TP_UD[
(0xc4c+3715-0x1acc)];buf[(0x1ea9+582-0x20e7)]=(unsigned char)pSrc->TP_UD[
(0xc43+4304-0x1d0f)];buf[(0x180+5242-0x15f1)]=(unsigned char)pSrc->TP_UD[
(0x14c0+2847-0x1fda)];buf[(0x339+89-0x38f)]=(unsigned char)(EncodeUcs2(&(pSrc->
TP_UD[(0x537+6870-0x2007)]),&buf[(0x2061+256-0x2157)],nLength-
(0x25a+8583-0x23db))+(0x1147+3818-0x202b));nLength=buf[(0xf07+5133-0x2311)]+
(0xda3+2128-0x15ef);}else{buf[(0x1191+3656-0x1fd6)]=EncodeUcs2(pSrc->TP_UD,&buf[
(0x670+7483-0x23a7)],nLength);nLength=buf[(0x3ac+7633-0x217a)]+
(0xe1d+2513-0x17ea);}return nLength;}int Encode8bit(const char*pSrc,unsigned
char*pDst,int nSrcLength){if(pSrc==NULL||pDst==NULL||nSrcLength<
(0x3c2+1748-0xa96)){return-(0x132d+2485-0x1ce1);}memcpy(pDst,pSrc,nSrcLength);
return nSrcLength;}int EncodePdu_Submit(const SMS_PARAM*pSrc,char*pDst){int
nLength=(0x5b0+3116-0x11dc);int nDstLength=(0x1194+160-0x1234);unsigned char buf
[(0x125+7543-0x1d9c)]={(0xcd5+3521-0x1a96)};char tmpSCA[(0x1e4c+207-0x1ef7)]={
(0xc59+6028-0x23e5)};int check_udl=(0x15e1+1466-0x1b9b);memset(tmpSCA,
(0x18c+4058-0x1166),sizeof(tmpSCA));if(pSrc==NULL||pDst==NULL){return-
(0x15c3+2490-0x1f7c);}
#if (0x1dc6+1598-0x2403)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x20\x45\x6e\x63\x6f\x64\x65\x50\x64\x75\x5f\x53\x75\x62\x6d\x69\x74\x20\x6d\x61\x6b\x65\x20\x70\x64\x75\x20\x64\x61\x74\x61" "\n"
);printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x74\x70\x75\x64\x3a\x25\x73" "\n",pSrc
->TP_UD);printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x31\x3a\x25\x73" "\n",
pDst);printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x73\x63\x61\x3a\x25\x73" "\n",pSrc->
SCA);
#endif
nLength=strlen(pSrc->SCA);buf[(0x1f02+1417-0x248b)]=(char)(((nLength)&
(0xbef+3622-0x1a14))==(0x6bb+5094-0x1aa1)?(nLength):nLength+(0x193d+2736-0x23ec)
)/(0x1c6+4557-0x1391)+(0x15+7014-0x1b7a);buf[(0x40c+4275-0x14be)]=
(0x148c+2538-0x1df5);strncpy(tmpSCA,pSrc->SCA,sizeof(tmpSCA)-
(0x1f39+1812-0x264c));if(!(strncmp(pSrc->SCA,"\x30\x30\x38\x36",
(0x376+3309-0x105f)))){memset(tmpSCA,(0x542+3515-0x12fd),sizeof(tmpSCA));nLength
=nLength-(0x3ab+6983-0x1ef1);
#if (0xfd+4599-0x12f3)
nLength=nLength-(0x16f7+2381-0x2043);strncpy(tmpSCA,&(pSrc->SCA[
(0x8f5+1060-0xd17)]),sizeof(tmpSCA)-(0x1b75+1510-0x215a));
#else
tmpSCA[(0x20b0+837-0x23f5)]=((char)(0x711+1787-0xde1));strcpy(&(tmpSCA[
(0x142f+3126-0x2064)]),&(pSrc->SCA[(0x21+2136-0x877)]));
#endif
buf[(0xc7d+972-0x1049)]=(char)((nLength&(0x141d+2362-0x1d56))==
(0x9cd+5567-0x1f8c)?nLength:nLength+(0x8a8+2712-0x133f))/(0x1357+327-0x149c)+
(0x10f4+1927-0x187a);buf[(0x126+6447-0x1a54)]=(0x3e2+4639-0x1570);}else if(
((char)(0x1506+1331-0x1a0e))==pSrc->SCA[(0x549+4188-0x15a5)]){memset(tmpSCA,
(0xab+1347-0x5ee),sizeof(tmpSCA));
#if (0x23+9935-0x26f1)
nLength=nLength-(0x1ac4+2142-0x2321);strncpy(tmpSCA,&(pSrc->SCA[(0xc47+82-0xc98)
]),sizeof(tmpSCA)-(0x845+4295-0x190b));
#else
strcpy(tmpSCA,pSrc->SCA);
#endif
buf[(0x170+6840-0x1c28)]=(char)((nLength&(0x1483+1179-0x191d))==
(0xe5d+1262-0x134b)?(nLength):nLength+(0x14a7+1093-0x18eb))/(0x634+1212-0xaee)+
(0x142a+2430-0x1da7);buf[(0x15bf+2181-0x1e43)]=(0xdc+1016-0x443);}
#if (0x305+2370-0xc46)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x32\x3a\x25\x73" "\n",
pDst);
#endif
if(nLength<(0x462+8527-0x25b0)||nLength>=sizeof(tmpSCA))return-
(0x5e1+5684-0x1c14);nDstLength=Bytes2String(buf,pDst,(0xa2+1381-0x605));
nDstLength+=InvertNumbers(tmpSCA,&pDst[nDstLength],nLength);
#if (0xda0+3198-0x1a1d)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x33\x3a\x25\x73" "\n",
pDst);
#endif
if(pSrc->TPA[(0x37+7047-0x1bbe)]==((char)(0x55+8201-0x2033))){nLength=strlen(&(
pSrc->TPA[(0x10a9+194-0x116a)]));}else{nLength=strlen(pSrc->TPA);}if(pSrc->
TP_UDHI==(0xb3d+6729-0x2586)){if(pSrc->TP_SRR==(0xc04+1215-0x10c3)){buf[
(0x64d+3998-0x15eb)]=(0x72a+6573-0x20c6);}if(pSrc->TP_SRR==(0x69b+688-0x94a)){
buf[(0x7e6+334-0x934)]=(0x1d1a+1496-0x22c1);}}if(pSrc->TP_UDHI==
(0x236+4328-0x131d)){if(pSrc->TP_SRR==(0x6f7+1355-0xc42)){buf[(0x584+914-0x916)]
=(0xabf+6960-0x259e);}if(pSrc->TP_SRR==(0xfdb+1844-0x170e)){buf[
(0xaf9+6854-0x25bf)]=(0x1980+1847-0x2046);}}buf[(0x11e3+1817-0x18fb)]=
(0xa4b+2521-0x1424);buf[(0x139+6250-0x19a1)]=(char)nLength;if(pSrc->TPA[
(0xa95+1815-0x11ac)]==((char)(0x97a+7053-0x24dc))){buf[(0x138d+4039-0x2351)]=
(0x1700+2779-0x214a);nDstLength+=Bytes2String(buf,&pDst[nDstLength],
(0x12b9+2677-0x1d2a));nDstLength+=InvertNumbers(&(pSrc->TPA[(0x8f4+3826-0x17e5)]
),&pDst[nDstLength],nLength);}else if(!(strncmp(pSrc->TPA,"\x30\x30\x38\x36",
(0x1438+4720-0x26a4)))){buf[(0x1bdc+2821-0x26df)]=(char)nLength-
(0xa0c+500-0xbfe);buf[(0x1135+1845-0x1867)]=(0x3c5+8493-0x2461);nDstLength+=
Bytes2String(buf,&pDst[nDstLength],(0x2f2+7189-0x1f03));nDstLength+=
InvertNumbers(&(pSrc->TPA[(0x9ab+7361-0x266a)]),&pDst[nDstLength],nLength-
(0x1da8+404-0x1f3a));}else{buf[(0xc40+3574-0x1a33)]=(0x884+1739-0xece);
nDstLength+=Bytes2String(buf,&pDst[nDstLength],(0xbfc+6200-0x2430));nDstLength+=
InvertNumbers(pSrc->TPA,&pDst[nDstLength],nLength);}
#if (0x1170+4031-0x212e)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x34\x3a\x25\x73" "\n",
pDst);
#endif
nLength=(int)pSrc->TP_UDLength;buf[(0x22fa+253-0x23f7)]=pSrc->TP_PID;buf[
(0x16d1+1162-0x1b5a)]=pSrc->TP_DCS;buf[(0xdc0+4636-0x1fda)]=pSrc->TP_VP;if(pSrc
->TP_DCS==CODE_GSM7){nLength=code_is_gsm7(pSrc,buf,nLength);}else if(pSrc->
TP_DCS==CODE_UCS2){nLength=code_is_ucs2(pSrc,buf,nLength);}else{nLength=strlen(
pSrc->TP_UD);if(pSrc->TP_UDHI==(0x884+3253-0x1538)){buf[(0x671+2451-0x1001)]=(
unsigned char)nLength;buf[(0x5f9+5778-0x1c87)]=(unsigned char)pSrc->TP_UD[
(0xc9f+3347-0x19b2)];buf[(0xf7b+2718-0x1a14)]=(0x76b+3939-0x16ce);buf[
(0xb59+1948-0x12ef)]=(unsigned char)pSrc->TP_UD[(0x1010+1274-0x1508)];buf[
(0x13eb+2119-0x1c2b)]=(unsigned char)pSrc->TP_UD[(0x9c3+3130-0x15fa)];buf[
(0x1208+436-0x13b4)]=(unsigned char)pSrc->TP_UD[(0xb52+5807-0x21fd)];buf[
(0x526+5716-0x1b71)]=(unsigned char)pSrc->TP_UD[(0x3d3+3248-0x107e)];if(nLength-
(0x1282+2181-0x1b01)<=(0x655+4947-0x19a8)||nLength-(0x1465+3925-0x23b4)>=sizeof(
buf)-(0x5a0+8327-0x261d))return-(0x1db+8705-0x23db);buf[(0x78+1881-0x7ce)]=(
unsigned char)(Encode8bit(&(pSrc->TP_UD[(0xcc2+2604-0x16e8)]),&buf[
(0xa30+5811-0x20d9)],(unsigned short)(nLength-(0x1081+638-0x12f9)))+
(0x51b+687-0x7c4));nLength=buf[(0x178f+3351-0x24a3)]+(0x877+1565-0xe90);}else{if
(nLength<=(0x1f2+4610-0x13f4)||nLength>=sizeof(buf)-(0x24f+3602-0x105d))return-
(0x103d+4882-0x234e);buf[(0x151b+255-0x1617)]=Encode8bit(pSrc->TP_UD,&buf[
(0x1f8b+1927-0x270e)],nLength);nLength=buf[(0x11fc+1143-0x1670)]+
(0x445+3421-0x119e);}}check_udl=nLength-(0x236f+434-0x251d);nDstLength+=
Bytes2String(buf,&pDst[nDstLength],nLength);cfg_set(NV_CHECK_UDL,"");if(
check_udl>(0xbba+6180-0x2352)){cfg_set(NV_CHECK_UDL,"\x65\x72\x72\x6f\x72");}
#if (0x1e11+1270-0x2306)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x20\x45\x6e\x63\x6f\x64\x65\x50\x64\x75\x5f\x53\x75\x62\x6d\x69\x74\x20\x65\x6e\x64\x20\x6d\x61\x6b\x65\x20\x70\x64\x75\x20\x64\x61\x74\x61" "\n"
);printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x6c\x65\x6e\x3a\x25\x64\x2c\x20\x74\x70\x75\x64\x3a\x25\x73" "\n"
,nDstLength,pSrc->TP_UD);
#endif
#if (0x16af+3437-0x241b)
printf(
"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x35\x3a\x25\x73" "\n",
pDst);
#endif
return nDstLength;}int Decode7bit(const unsigned char*pSrc,char*pDst,int
nSrcLength){int nSrc;int nDst;int nByte;unsigned char nLeft;if(pSrc==NULL||pDst
==NULL||nSrcLength<(0x482+8841-0x270b)){return-(0xfd4+4528-0x2183);}nSrc=
(0x688+7239-0x22cf);nDst=(0x1014+4997-0x2399);nByte=(0xa74+5463-0x1fcb);nLeft=
(0xe05+5330-0x22d7);while(nSrc<nSrcLength){*pDst=((*pSrc<<nByte)|nLeft)&
(0x953+3954-0x1846);nLeft=*pSrc>>((0x789+5610-0x1d6c)-nByte);pDst++;nDst++;nByte
++;if(nByte==(0x11b3+3053-0x1d99)){*pDst=nLeft;pDst++;nDst++;nByte=
(0xfc1+2540-0x19ad);nLeft=(0x1541+2822-0x2047);}pSrc++;nSrc++;}*pDst='\0';return
nDst;}int DecodePushPdu(const char*pSrcPdu,SMS_PARAM*pDst){int nDstLength=
(0x1045+3981-0x1fd2);unsigned char tmp=(0x20d+2507-0xbd8);int ud_length=
(0x6d5+3161-0x132e);unsigned char buf[(0x1f47+1365-0x239c)]={
(0x1d37+2087-0x255e)};char temp_num[(0x6bd+699-0x914)]={(0x7ed+204-0x8b9)};
unsigned char first_octet=(0xe71+3341-0x1b7e);unsigned char udhl=
(0x880+2812-0x137c);unsigned int halftmp=(0x94a+5552-0x1efa);char tp_ra[
(0x8c8+2361-0x11fe)]={(0xd+8954-0x2307)};int tmplen=(0x164+4977-0x14d5);unsigned
char IEIDL;int pushType=(0x12e4+660-0x1578);const char*pSrc=pSrcPdu;if(pSrcPdu
==NULL||pDst==NULL){printf(
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x70\x61\x72\x61\x20\x6e\x75\x6c\x6c\x2e\x20" "\n"
);return-(0x450+8770-0x2691);}String2Bytes(pSrc,&tmp,(0x415+3405-0x1160));
at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x74\x6d\x70\x20\x3d\x20\x25\x64\x2e" "\n"
,tmp);if(tmp==(0x377+8288-0x23d7)){pSrc+=(0x343+7512-0x2099);}else{tmp=(tmp-
(0x1238+4081-0x2228))*(0xbbf+2785-0x169e);pSrc+=(0x169b+2444-0x2023);if(tmp>
(0x875+6875-0x2330)){SerializeNumbers_sms(pSrc,pDst->SCA,(0xab5+1086-0xed3));tmp
=(0x7da+6270-0x2038);}else{SerializeNumbers_sms(pSrc,pDst->SCA,tmp);}pSrc+=tmp;}
String2Bytes(pSrc,&tmp,(0x198f+629-0x1c02));first_octet=tmp;pSrc+=
(0xfd2+2040-0x17c8);String2Bytes(pSrc,&tmp,(0x3d5+1185-0x874));halftmp=tmp;if(
tmp&(0x22a+4263-0x12d0))tmp+=(0x22b0+16-0x22bf);pSrc+=(0x91b+6358-0x21ef);memset
(tp_ra,(0xa55+1378-0xfb7),sizeof(tp_ra));String2Bytes(pSrc,tp_ra,
(0x116b+2434-0x1aeb));pSrc+=(0xa46+5511-0x1fcb);if((tp_ra[(0x1768+2636-0x21b4)]&
(0x81+1707-0x6dc))==(0x74d+6012-0x1e79)){char tempra[(0x4c6+5776-0x1ad6)];char
acAsc[(0x16c9+1403-0x1bc4)];if(halftmp>=(0x16a0+2594-0x20b4)){halftmp=(tmp/
(0x4d5+5419-0x19fe))/(0x1fe5+1274-0x24d8)+(tmp/(0x241+1308-0x75b));}else{halftmp
=tmp/(0x1c9c+384-0x1e1a);}memset(tempra,(0x1df0+2322-0x2702),sizeof(tempra));
memcpy(tempra,pSrc,tmp);memset(acAsc,(0x123+1481-0x6ec),sizeof(acAsc));
nDstLength=String2Bytes(tempra,buf,halftmp&(0x5cb+2083-0xde7)?(int)halftmp*
(0x54a+1135-0x9b2)/(0xc5c+206-0xd26)+(0x12c9+354-0x1429):(int)halftmp*
(0x7b0+5884-0x1ea5)/(0x80d+5577-0x1dd2));halftmp=Decode7bit(buf,acAsc,nDstLength
);memset(pDst->TPA,(0x18b+2104-0x9c3),sizeof(pDst->TPA));if(halftmp>
(0x600+4077-0x15cd)){memcpy(pDst->TPA,acAsc,(0x84+8658-0x2236));tmp=
(0x490+1426-0xa02);}else{memcpy(pDst->TPA,acAsc,halftmp);}}else{if(tmp>
(0x9e7+5695-0x2006)){SerializeNumbers_sms(pSrc,pDst->TPA,(0x73+8359-0x20fa));}
else{SerializeNumbers_sms(pSrc,pDst->TPA,tmp);}if((tp_ra[(0x125f+164-0x1303)]&
(0x2127+381-0x2213))==(0x1af9+2603-0x2493)){memset(temp_num,(0xcb6+3901-0x1bf3),
sizeof(temp_num));if(pDst->TPA[(0x1da6+2181-0x262b)]!=
((char)(0x1d43+1458-0x22ca))){snprintf(temp_num,sizeof(temp_num),
"\x25\x73\x25\x73","\x2b",pDst->TPA);if(strlen(temp_num)>(0x1130+1744-0x17e0)){
snprintf(pDst->TPA,sizeof(pDst->TPA),"\x25\x33\x32\x73",temp_num);}else{snprintf
(pDst->TPA,sizeof(pDst->TPA),"\x25\x73",temp_num);}}}}pSrc+=tmp;String2Bytes(
pSrc,(unsigned char*)&pDst->TP_PID,(0x953+383-0xad0));pSrc+=(0xc52+1556-0x1264);
String2Bytes(pSrc,(unsigned char*)&pDst->TP_DCS,(0x994+6022-0x2118));pSrc+=
(0x1042+225-0x1121);SerializeNumbers_sms(pSrc,pDst->TP_SCTS,(0xa23+2681-0x148e))
;pSrc+=(0x38f+7173-0x1f86);String2Bytes(pSrc,&tmp,(0x324+7463-0x2049));pSrc+=
(0x213a+475-0x2313);memset(pDst->TP_UD,(0x1e6a+683-0x2115),sizeof(pDst->TP_UD));
at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x66\x69\x72\x73\x74\x5f\x6f\x63\x74\x65\x74\x20\x3d\x20\x30\x78\x25\x30\x32\x78\x2e" "\n"
,first_octet);if(first_octet&(0x15d0+3801-0x2469)){const char*temp=pSrc;unsigned
char pduType;unsigned char wspLen;unsigned char udhLen;unsigned char DestPort1;
unsigned char DestPort2;unsigned char RefNum1;unsigned char RefNum2;pushType=
SMS_NO_PUSH;String2Bytes(temp,&udhl,(0x60b+4979-0x197c));temp+=
(0xe86+2195-0x1717);tmplen=String2Bytes(temp,&pDst->TP_IEI,(0x5af+4682-0x17f7));
at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x54\x50\x5f\x49\x45\x49\x20\x3d\x20\x30\x78\x25\x30\x32\x78\x2e" "\n"
,pDst->TP_IEI);if(pDst->TP_IEI==(0xecd+1692-0x1564)){temp+=(0x5d0+2874-0x1108)*
tmplen+(0xa53+820-0xd85);tmplen=String2Bytes(temp,&DestPort1,
(0x1c8b+2567-0x2690));at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x44\x65\x73\x74\x50\x6f\x72\x74\x31\x20\x3d\x20\x30\x78\x25\x30\x32\x78\x2e" "\n"
,DestPort1);temp+=(0x1b28+2413-0x2493)*tmplen;tmplen=String2Bytes(temp,&
DestPort2,(0x1d8a+1582-0x23b6));at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x44\x65\x73\x74\x50\x6f\x72\x74\x32\x20\x3d\x20\x30\x78\x25\x30\x32\x78\x2e" "\n"
,DestPort2);if((DestPort1==(0x1c04+2273-0x24da))&&((DestPort2==
(0x2e3+2161-0xad0))||(DestPort2==(0x18d7+2867-0x2385)))){pushType=SMS_PUSH;}}if(
SMS_PUSH!=pushType){return pushType;}temp=pSrc+udhl*(0x6a3+4082-0x1693)+
(0x14a1+3062-0x2093);tmplen=String2Bytes(temp,&pduType,(0x16f+5337-0x1646));if(
pduType==(0x1283+3365-0x1fa2)){pushType=SMS_PUSH;temp+=(0xe22+855-0x1175);tmplen
=String2Bytes(temp,&pduType,(0x9d5+28-0x9ef));if(pduType==(0x3c2+2981-0xea3)){
pushType=SMS_NOTIFICATION;}else{temp+=(0x613+6595-0x1fd2);tmplen=String2Bytes(
temp,&pduType,(0x937+5916-0x2051));if((pduType==(0x1eb8+2269-0x26d3))||(pduType
==(0xfaa+2289-0x17e5))){pushType=SMS_BOOTSTRAP;}}}if((pDst->TP_IEI==
(0x86a+5538-0x1e08))||(pDst->TP_IEI==(0x1097+3693-0x1eff))||(pDst->TP_IEI==
(0xb5b+6376-0x243b))){temp=pSrc+(0x166b+2081-0x1e88);tmplen=String2Bytes(temp,&
IEIDL,(0x323+4627-0x1534));if(IEIDL==(udhl-(0x32f+1622-0x983))){}else{temp+=
(0x1b22+1067-0x1f4b)*(0x110a+5066-0x24ce);tmplen=String2Bytes(temp,&udhLen,
(0x5ed+1424-0xb7b));if(udhLen==(0x2fc+5851-0x19d4)){temp+=(0x12e5+393-0x146c)*
tmplen;tmplen=String2Bytes(temp,&RefNum1,(0x93b+643-0xbbc));pDst->TP_ReferNum=
RefNum1;temp+=(0xebd+2730-0x1965)*tmplen;tmplen=String2Bytes(temp,&pDst->
TP_AllPieceNum,(0x4ad+3471-0x123a));temp+=(0x1527+4462-0x2693)*tmplen;tmplen=
String2Bytes(temp,&pDst->TP_CurrentPieceNum,(0xe2f+3422-0x1b8b));temp+=
(0x166+4156-0x11a0)*tmplen;}else if(udhLen==(0xfb1+2627-0x19f0)){temp+=
(0x1363+4104-0x2369)*tmplen;tmplen=String2Bytes(temp,&RefNum1,(0x8b+1673-0x712))
;temp+=(0x1151+3351-0x1e66)*tmplen;tmplen=String2Bytes(temp,&RefNum2,
(0x7f7+3197-0x1472));int ReferNum=RefNum2+RefNum1*(0x1601+4227-0x2584);pDst->
TP_ReferNum=ReferNum;temp+=(0xd08+2810-0x1800)*tmplen;tmplen=String2Bytes(temp,&
pDst->TP_AllPieceNum,(0x607+60-0x641));temp+=(0x16dd+1716-0x1d8f)*tmplen;tmplen=
String2Bytes(temp,&pDst->TP_CurrentPieceNum,(0x241+1289-0x748));temp+=
(0x202a+1026-0x242a)*tmplen;}}}at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64\x2c\x41\x6c\x6c\x4e\x75\x6d\x20\x3d\x25\x64\x2c\x43\x75\x72\x4e\x75\x6d\x20\x3d\x25\x64\x2e" "\n"
,pDst->TP_ReferNum,pDst->TP_AllPieceNum,pDst->TP_CurrentPieceNum);if(
SMS_NOTIFICATION==pushType){temp=pSrc+udhl*(0x608+6103-0x1ddd)+
(0x30a+3283-0xfd7);tmplen=String2Bytes(temp,&wspLen,(0x7a8+3201-0x1427));temp=
temp+wspLen*(0x1d1d+2320-0x262b)+(0x40+5440-0x157e);}else{temp=pSrc+udhl*
(0x28a+4892-0x15a4)+(0xfe3+1722-0x169b);}nDstLength=((strlen(temp)<sizeof(pDst->
TP_UD))?strlen(temp):(sizeof(pDst->TP_UD)-(0x1304+1347-0x1846)));memcpy(pDst->
TP_UD,temp,nDstLength);at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x70\x44\x73\x74\x2d\x3e\x54\x50\x5f\x55\x44\x20\x3d\x20\x25\x73\x2e" "\n"
,pDst->TP_UD);}at_print(LOG_DEBUG,
"\x44\x65\x63\x6f\x64\x65\x50\x75\x73\x68\x50\x64\x75\x20\x70\x75\x73\x68\x54\x79\x70\x65\x20\x3d\x20\x25\x64\x2e" "\n"
,pushType);return pushType;}static int SerializeNumbers_sms(const char*pSrc,char
*pDst,int nSrcLength){int nDstLength;char ch;int i=(0x18e7+689-0x1b98);if(pSrc==
NULL||pDst==NULL||nSrcLength<(0x630+1290-0xb3a)){return-(0x2618+214-0x26ed);}
nDstLength=nSrcLength;for(i=(0x9ad+3174-0x1613);i<nSrcLength;i+=
(0x2e1+8030-0x223d)){ch=*pSrc++;*pDst++=*pSrc++;*pDst++=ch;}if(*(pDst-
(0xe0b+1274-0x1304))==((char)(0x1a5+1957-0x904))){pDst--;nDstLength--;}*pDst=
'\0';return nDstLength;}UINT16 wms_ts_pack_gw_7_bit_chars(const UINT8*in,UINT16
in_len,UINT16 shift,UINT16 out_len_max,UINT8*out){UINT16 i=(0x945+2952-0x14cd);
UINT16 pos=(0x392+4736-0x1612);if(in==NULL||out==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x70\x61\x63\x6b\x5f\x67\x77\x5f\x37\x5f\x62\x69\x74\x5f\x63\x68\x61\x72\x73"
);return(0x99c+5148-0x1db8);}shift%=(0x1445+934-0x17e4);if(shift!=
(0x1101+5114-0x24fb)){out[pos]|=(UINT8)(in[i]<<shift);shift=((0x20f2+251-0x21e6)
-shift)+(0x15f7+924-0x1992);if(shift==(0x74b+2947-0x12c7)){shift=
(0x6b+498-0x25d);i++;}pos++;}for(;pos<out_len_max&&i<in_len;pos++,i++){out[pos]=
in[i]>>shift;if(i+(0x9cc+2569-0x13d4)<in_len){out[pos]|=(UINT8)(in[i+
(0x124b+3176-0x1eb2)]<<((0x6b2+5473-0x1c0c)-shift));shift++;if(shift==
(0x158+5780-0x17e5)){shift=(0x1dd3+1657-0x244c);i++;}}}return pos;}UINT8
wms_ts_encode_address(const wms_address_s_type*addr,UINT8*data){UINT8 i,pos=
(0x6f6+2090-0xf20);if(addr->number_of_digits>WMS_GW_ADDRESS_MAX){at_print(
LOG_DEBUG,
"\x41\x64\x64\x72\x20\x6c\x65\x6e\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x20\x25\x64"
,addr->number_of_digits);return(0x10cf+2834-0x1be1);}if(addr->number_type==
WMS_NUMBER_ALPHANUMERIC){data[pos]=(UINT8)((addr->number_of_digits*
(0xb4a+6451-0x2476)+(0x11ea+2042-0x19e1))/(0x584+7731-0x23b3));}else{data[pos]=
addr->number_of_digits;}pos++;data[pos]=(0x1888+1069-0x1c35);data[pos]|=(UINT8)(
(UINT8)addr->number_type<<(0x1b68+2125-0x23b1));data[pos]|=(UINT8)addr->
number_plan;pos++;if(addr->number_type==WMS_NUMBER_ALPHANUMERIC){pos+=(UINT8)
wms_ts_pack_gw_7_bit_chars(addr->digits,addr->number_of_digits,
(0xa67+6630-0x244d),WMS_GW_ADDRESS_MAX,&data[pos]);}else{for(i=
(0x1881+2694-0x2307);i<addr->number_of_digits;i++){data[pos]=(UINT8)(addr->
digits[i++]&(0x1ba9+381-0x1d17));{data[pos]|=(UINT8)(addr->digits[i]<<
(0x133+7334-0x1dd5));}pos++;}}return pos;}UINT8 wms_ts_encode_dcs(const
wms_gw_dcs_s_type*dcs,UINT8*data){UINT8 pos=(0x43b+1608-0xa83);if(dcs->
msg_waiting==WMS_GW_MSG_WAITING_NONE){data[pos]=dcs->is_compressed?
(0x6ab+7654-0x2471):(0x1007+2001-0x17d8);data[pos]|=(dcs->msg_class!=
WMS_MESSAGE_CLASS_NONE)?(0x13c+3317-0xe21):(0xaa8+1169-0xf39);data[pos]|=dcs->
alphabet<<(0x7dd+5532-0x1d77);data[pos]|=dcs->msg_class&(0x1cf9+636-0x1f72);}
else if(dcs->msg_waiting==WMS_GW_MSG_WAITING_NONE_1111){data[pos]=
(0xd89+6740-0x26ed);if(dcs->alphabet==WMS_GW_ALPHABET_8_BIT)data[pos]|=
(0x135d+187-0x1414);data[pos]|=dcs->msg_class&(0xd8a+5949-0x24c4);}else{if(dcs->
msg_waiting==WMS_GW_MSG_WAITING_DISCARD){data[pos]=(0x19ed+688-0x1bdd);}else if(
dcs->msg_waiting==WMS_GW_MSG_WAITING_STORE&&dcs->alphabet==
WMS_GW_ALPHABET_7_BIT_DEFAULT){data[pos]=(0x1549+2463-0x1e18);}else{data[pos]=
(0xe4d+3595-0x1b78);}data[pos]|=(dcs->msg_waiting_active==TRUE)?
(0xafa+3258-0x17ac):(0x6d2+7891-0x25a5);data[pos]|=dcs->msg_waiting_kind&
(0x1926+2493-0x22e0);}pos++;return pos;}UINT8 wms_ts_bcd_to_int(const UINT8 bcd,
UINT8*result){unsigned char low_bit=(bcd&(0x1c90+2499-0x2644));unsigned char
high_bit=((bcd&(0x1cbf+2088-0x23f7))>>(0x10fb+3612-0x1f13));if(low_bit>
(0x49+9909-0x26f5)||high_bit>(0x15ef+578-0x1828)){at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x64\x69\x67\x69\x74\x21");*
result=(0x133b+356-0x149f);return FALSE;}else{*result=((bcd&(0x3ff+7117-0x1fbd))
+(((bcd&(0x1600+3075-0x2113))>>(0x1294+4948-0x25e4))*(0x933+7162-0x2523)));
return TRUE;}}UINT8 wms_ts_encode_timestamp(const wms_timestamp_s_type*timestamp
,UINT8*data){sint7 i;UINT8 pos=(0x200+297-0x329),j;if(!wms_ts_bcd_to_int(
timestamp->year,&j)){return(0x17f6+3200-0x2476);}data[pos]=((timestamp->year&
(0x254d+7-0x2545))<<(0x97a+5565-0x1f33))+((timestamp->year&(0x1ae5+2603-0x2420))
>>(0x16f6+1499-0x1ccd));pos++;if(wms_ts_bcd_to_int(timestamp->month,&j)){if(j>
(0x211c+546-0x2332)||j<(0x1bf+8075-0x2149)){at_print(LOG_DEBUG,
"\x4d\x6f\x6e\x74\x68\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);return(0xa18+2743-0x14cf);}}else{return(0x80a+566-0xa40);}data[pos]=((
timestamp->month&(0x1355+3025-0x1f17))<<(0x14b6+3531-0x227d))+((timestamp->month
&(0x14c7+4294-0x249d))>>(0x2a1+9235-0x26b0));pos++;if(wms_ts_bcd_to_int(
timestamp->day,&j)){if(j>(0x129b+2982-0x1e22)||j<(0x457+6872-0x1f2e)){at_print(
LOG_DEBUG,
"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);
return(0x576+3650-0x13b8);}}else{return(0x599+7298-0x221b);}data[pos]=((
timestamp->day&(0x17f1+3778-0x26a4))<<(0xde7+1848-0x151b))+((timestamp->day&
(0x444+940-0x700))>>(0x50a+7118-0x20d4));pos++;if(wms_ts_bcd_to_int(timestamp->
hour,&j)){if(j>(0x1573+1287-0x1a63)){at_print(LOG_DEBUG,
"\x48\x6f\x75\x72\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j
);return(0xb6b+4971-0x1ed6);}}else{return(0x8a0+2440-0x1228);}data[pos]=((
timestamp->hour&(0x7e8+797-0xaf6))<<(0x919+3498-0x16bf))+((timestamp->hour&
(0x1307+4888-0x252f))>>(0x1a7+3740-0x103f));pos++;if(wms_ts_bcd_to_int(timestamp
->minute,&j)){if(j>(0xba8+6154-0x2377)){at_print(LOG_DEBUG,
"\x4d\x69\x6e\x75\x74\x65\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);return(0x45+8299-0x20b0);}}else{return(0x5a5+6567-0x1f4c);}data[pos]=((
timestamp->minute&(0xa7d+1894-0x11d4))<<(0x261+8410-0x2337))+((timestamp->minute
&(0x2a6+5035-0x1561))>>(0x1414+2232-0x1cc8));pos++;if(wms_ts_bcd_to_int(
timestamp->second,&j)){if(j>(0x1af+961-0x535)){at_print(LOG_DEBUG,
"\x53\x65\x63\x6f\x6e\x64\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);return(0x10a6+295-0x11cd);}}else{return(0x1a9+3969-0x112a);}data[pos]=((
timestamp->second&(0x70+4809-0x132a))<<(0x940+2876-0x1478))+((timestamp->second&
(0x4c5+6467-0x1d18))>>(0x20cb+1602-0x2709));pos++;i=(sint7)timestamp->timezone;
if(i>(0x4a5+7946-0x237f)||i<-(0x10f3+3903-0x2002)){at_print(LOG_DEBUG,
"\x54\x69\x6d\x65\x7a\x6f\x6e\x65\x20\x69\x73\x20\x6f\x75\x74\x20\x6f\x66\x20\x62\x6f\x75\x6e\x64\x3a\x20\x25\x64"
,i);return(0x19b7+2324-0x22cb);}if(i>=(0xe15+5515-0x23a0)){data[pos]=(UINT8)(((
UINT8)(i%(0xba2+3101-0x17b5)))<<(0xdfb+6129-0x25e8));data[pos]|=(i/
(0xef3+489-0x10d2));}else{i*=(-(0x167+5644-0x1772));data[pos]=(UINT8)(((UINT8)(i
%(0x121f+2132-0x1a69)))<<(0x6b1+1808-0xdbd));data[pos]|=(i/(0x34b+3199-0xfc0));
data[pos]|=(0xf57+941-0x12fc);}pos++;return pos;}UINT8 wms_ts_get_udh_length(
const wms_udh_s_type*udh){UINT8 length=(0x232+7582-0x1fd0);if(udh!=NULL){switch(
udh->header_id){case WMS_UDH_CONCAT_8:length=(0x1a6c+1219-0x1f2e)+
(0xee1+3480-0x1c78)+WMS_UDH_OCTETS_CONCAT8;break;case WMS_UDH_CONCAT_16:length=
(0xe0d+1401-0x1385)+(0x91c+6408-0x2223)+WMS_UDH_OCTETS_CONCAT16;break;case
WMS_UDH_SPECIAL_SM:length=(0x72a+2721-0x11ca)+(0x1987+1045-0x1d9b)+
WMS_UDH_OCTETS_SPECIAL_SM;break;case WMS_UDH_PORT_8:length=(0x140b+1359-0x1959)+
(0x2005+494-0x21f2)+WMS_UDH_OCTETS_PORT8;break;case WMS_UDH_PORT_16:length=
(0x719+1988-0xedc)+(0x1602+3231-0x22a0)+WMS_UDH_OCTETS_PORT16;break;case
WMS_UDH_SMSC_CONTROL:length=(0x4ef+6906-0x1fe8)+(0xbf5+5468-0x2150)+udh->u.other
.header_length;break;case WMS_UDH_SOURCE:length=(0x1647+2317-0x1f53)+
(0x10f3+1595-0x172d)+udh->u.other.header_length;break;case WMS_UDH_WCMP:length=
(0x11ac+3260-0x1e67)+(0x39+3461-0xdbd)+udh->u.other.header_length;break;case
WMS_UDH_TEXT_FORMATING:if(!udh->u.text_formating.is_color_present){length=
(0xfad+5313-0x246d)+(0x313+4353-0x1413)+WMS_UDH_OCTETS_TEXT_FORMATTING;}else{
length=(0x1448+1119-0x18a6)+(0x1aba+323-0x1bfc)+WMS_UDH_OCTETS_TEXT_FORMATTING+
(0x14af+56-0x14e6);}break;case WMS_UDH_PRE_DEF_SOUND:length=(0x37a+5520-0x1909)+
(0xb69+1360-0x10b8)+WMS_UDH_OCTETS_PRE_DEF;break;case WMS_UDH_USER_DEF_SOUND:
length=(0xc9d+5090-0x207e)+(0x15e4+2531-0x1fc6)+udh->u.user_def_sound.
data_length+(0x515+4526-0x16c2);break;case WMS_UDH_PRE_DEF_ANIM:length=
(0x66d+326-0x7b2)+(0xdf1+6412-0x26fc)+WMS_UDH_OCTETS_PRE_DEF;break;case
WMS_UDH_LARGE_ANIM:length=(0x1045+3859-0x1f57)+(0xc82+3655-0x1ac8)+
WMS_UDH_LARGE_BITMAP_SIZE*WMS_UDH_ANIM_NUM_BITMAPS+(0xc0b+1572-0x122e);break;
case WMS_UDH_SMALL_ANIM:length=(0xe9+4521-0x1291)+(0x219+697-0x4d1)+
WMS_UDH_SMALL_BITMAP_SIZE*WMS_UDH_ANIM_NUM_BITMAPS+(0xf14+3261-0x1bd0);break;
case WMS_UDH_LARGE_PICTURE:length=(0x1360+2675-0x1dd2)+(0x1928+351-0x1a86)+
WMS_UDH_LARGE_PIC_SIZE+(0x1277+5061-0x263b);break;case WMS_UDH_SMALL_PICTURE:
length=(0xedf+2179-0x1761)+(0x1307+1142-0x177c)+WMS_UDH_SMALL_PIC_SIZE+
(0x854+5591-0x1e2a);break;case WMS_UDH_VAR_PICTURE:length=(0x167+344-0x2be)+
(0x19fc+1301-0x1f10)+(UINT8)(udh->u.var_picture.height*udh->u.var_picture.width/
(0x931+4020-0x18dd))+(0x2f1+121-0x367);break;case WMS_UDH_RFC822:length=
(0x1e7+9419-0x26b1)+(0x65c+4142-0x1689)+WMS_UDH_OCTETS_RFC822;break;case
WMS_UDH_NAT_LANG_SS:length=(0xfcf+4411-0x2109)+(0x20ea+1473-0x26aa)+
WMS_UDH_OCTETS_NAT_LANG_SS;break;case WMS_UDH_NAT_LANG_LS:length=
(0x1211+2692-0x1c94)+(0x15+5073-0x13e5)+WMS_UDH_OCTETS_NAT_LANG_LS;break;case
WMS_UDH_USER_PROMPT:length=(0x55f+5233-0x19cf)+(0x114b+1924-0x18ce)+
WMS_UDH_OCTETS_USER_PROMPT;break;case WMS_UDH_EXTENDED_OBJECT:length=
(0x1403+34-0x1424)+(0x1393+619-0x15fd)+udh->u.eo.content.length;if(udh->u.eo.
first_segment==TRUE){length+=WMS_UDH_OCTETS_EO_HEADER;}break;default:length=
(0x969+4080-0x1958)+(0x36f+858-0x6c8)+udh->u.other.header_length;break;}}return
length;}uint32 wms_ts_compute_user_data_header_length(const UINT8 num_headers,
const wms_udh_s_type*headers){uint32 length=(0xd35+2573-0x1742);uint32 i;if(
headers==NULL){at_print(LOG_DEBUG,
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x63\x6f\x6d\x70\x75\x74\x65\x5f\x75\x73\x65\x72\x5f\x64\x61\x74\x61\x5f\x68\x65\x61\x64\x65\x72\x5f\x6c\x65\x6e\x67\x74\x68\x21"
);return(0x5e3+3867-0x14fe);}if(num_headers>(0xfe3+3275-0x1cae)){length+=
(0x121a+4873-0x2522);for(i=(0x43c+7489-0x217d);i<num_headers&&i<
WMS_MAX_UD_HEADERS;i++){length+=(uint32)wms_ts_get_udh_length(&headers[i]);}}
return length;}uint32 wms_ts_compute_gw_user_data_length(const wms_gw_dcs_s_type
*dcs,const wms_gw_user_data_s_type*user_data){uint32 length=(0x2006+486-0x21ec);
if(dcs==NULL||user_data==NULL){at_print(LOG_DEBUG,
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x63\x6f\x6d\x70\x75\x74\x65\x5f\x67\x77\x5f\x75\x73\x65\x72\x5f\x64\x61\x74\x61\x5f\x6c\x65\x6e\x67\x74\x68\x21"
);return(0x1c9+815-0x4f8);}length+=wms_ts_compute_user_data_header_length(
user_data->num_headers,user_data->headers);if(dcs->alphabet==
WMS_GW_ALPHABET_7_BIT_DEFAULT){length+=((user_data->sm_len*(0x7f1+4886-0x1b00))+
(0x1348+3450-0x20bb))/(0xa80+1380-0xfdc);}else{length+=user_data->sm_len;}return
length;}static int wms_ts_encode_udh_concat_8(UINT8*udh){int pos=
(0x4c7+4508-0x1663);if(const_header->u.concat_8.total_sm==(0x159d+2186-0x1e27)||
const_header->u.concat_8.seq_num==(0x22c6+125-0x2343)||const_header->u.concat_8.
seq_num>const_header->u.concat_8.total_sm){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x69\x64\x20\x25\x64\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x6e\x6f\x20\x44\x61\x74\x61"
,const_header->header_id);return(0x454+8860-0x26f0);}udh[pos++]=(UINT8)
WMS_UDH_CONCAT_8;udh[pos++]=(UINT8)WMS_UDH_OCTETS_CONCAT8;udh[pos++]=
const_header->u.concat_8.msg_ref;udh[pos++]=const_header->u.concat_8.total_sm;
udh[pos++]=const_header->u.concat_8.seq_num;return pos;}static int
wms_ts_encode_udh_concat16(UINT8*udh){int pos=(0xe94+214-0xf6a);if(const_header
->u.concat_16.total_sm==(0xb7b+6154-0x2385)||const_header->u.concat_16.seq_num==
(0x1251+5231-0x26c0)||const_header->u.concat_16.seq_num>const_header->u.
concat_16.total_sm){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x69\x64\x20\x25\x64\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x6e\x6f\x20\x44\x61\x74\x61"
,const_header->header_id);return(0x1133+3516-0x1eef);}udh[pos++]=(UINT8)
WMS_UDH_CONCAT_16;udh[pos++]=(UINT8)WMS_UDH_OCTETS_CONCAT16;udh[pos++]=(UINT8)((
const_header->u.concat_16.msg_ref&65280)>>(0x8d0+5482-0x1e32));udh[pos++]=(UINT8
)(const_header->u.concat_16.msg_ref&(0x64a+2654-0xfa9));udh[pos++]=const_header
->u.concat_16.total_sm;udh[pos++]=const_header->u.concat_16.seq_num;return pos;}
int wms_ts_encode_udh_nat_lang_ss(UINT8*udh){int pos=(0x35d+8701-0x255a);udh[pos
++]=(UINT8)WMS_UDH_NAT_LANG_SS;udh[pos++]=(UINT8)WMS_UDH_OCTETS_NAT_LANG_SS;udh[
pos++]=(UINT8)const_header->u.nat_lang_ss.nat_lang_id;return pos;}int
wms_ts_encode_udh_nat_lang_ls(UINT8*udh){int pos=(0x10ca+220-0x11a6);udh[pos++]=
(UINT8)WMS_UDH_NAT_LANG_LS;udh[pos++]=(UINT8)WMS_UDH_OCTETS_NAT_LANG_LS;udh[pos
++]=(UINT8)const_header->u.nat_lang_ls.nat_lang_id;return pos;}int
wms_ts_encode_udh_other(UINT8*udh,wms_udh_id_e_type header_id){int i=
(0x103a+2251-0x1905);int pos=(0x6ea+6265-0x1f63);udh[pos++]=(UINT8)const_header
->u.other.header_id;udh[pos++]=const_header->u.other.header_length;for(i=
(0xe66+3219-0x1af9);i<const_header->u.other.header_length;i++){udh[pos++]=
const_header->u.other.data[i];}return pos;}UINT8 wms_ts_encode_user_data_header(
UINT8 num_headers,const wms_udh_s_type*headers,UINT8*data){int i,pos=
(0x153c+4331-0x2627);if(num_headers==(0x2e8+1487-0x8b7))return
(0x1f77+249-0x2070);++pos;for(i=(0x1315+3935-0x2274);i<WMS_MAX_UD_HEADERS&&i<
num_headers;i++){const_header=&headers[i];switch(const_header->header_id){case
WMS_UDH_CONCAT_8:pos+=wms_ts_encode_udh_concat_8(data+pos);break;case
WMS_UDH_CONCAT_16:pos+=wms_ts_encode_udh_concat16(data+pos);break;
#if (0x1506+948-0x18ba)
case WMS_UDH_SPECIAL_SM:pos+=wms_ts_encode_udh_special_sm(data+pos);break;case
WMS_UDH_PORT_8:pos+=wms_ts_encode_udh_port_8(data+pos);break;case
WMS_UDH_PORT_16:pos+=wms_ts_encode_udh_port16(data+pos);break;case
WMS_UDH_TEXT_FORMATING:pos+=wms_ts_encode_udh_text_formatting(data+pos);break;
case WMS_UDH_PRE_DEF_SOUND:pos+=wms_ts_encode_udh_pre_def_sound(data+pos);break;
case WMS_UDH_USER_DEF_SOUND:pos+=wms_ts_encode_udh_user_def_sound(data+pos);
break;case WMS_UDH_PRE_DEF_ANIM:pos+=wms_ts_encode_udh_pre_def_anim(data+pos);
break;case WMS_UDH_LARGE_ANIM:pos+=wms_ts_encode_udh_large_anim(data+pos);break;
case WMS_UDH_SMALL_ANIM:pos+=wms_ts_encode_udh_small_anim(data+pos);break;case
WMS_UDH_LARGE_PICTURE:pos+=wms_ts_encode_udh_large_picture(data+pos);break;case
WMS_UDH_SMALL_PICTURE:pos+=wms_ts_encode_udh_small_picture(data+pos);break;case
WMS_UDH_VAR_PICTURE:pos+=wms_ts_encode_udh_var_picture(data+pos);break;case
WMS_UDH_USER_PROMPT:pos+=wms_ts_encode_udh_user_prompt(data+pos);break;case
WMS_UDH_EXTENDED_OBJECT:pos+=wms_ts_encode_udh_eo(data+pos);break;case
WMS_UDH_RFC822:pos+=wms_ts_encode_udh_rfc822(data+pos);break;
#endif
case WMS_UDH_NAT_LANG_SS:pos+=wms_ts_encode_udh_nat_lang_ss(data+pos);break;case
WMS_UDH_NAT_LANG_LS:pos+=wms_ts_encode_udh_nat_lang_ls(data+pos);break;default:
pos+=wms_ts_encode_udh_other(data+pos,const_header->header_id);}}data[
(0x16+9188-0x23fa)]=(UINT8)(pos-(0xa79+6961-0x25a9));return((UINT8)(pos-
(0x1e9+6260-0x1a5c)));}UINT8 wms_ts_encode_gw_user_data(const wms_gw_dcs_s_type*
dcs,const wms_gw_user_data_s_type*user_data,UINT8*data){UINT16 i,pos=
(0xfd0+818-0x1302);UINT8 fill_bits=(0x1486+1058-0x18a8);UINT16
total_bits_occupied;UINT8 user_data_header_length;UINT16 user_data_length;data[
pos]=(UINT8)user_data->sm_len;pos++;if(dcs->alphabet==
WMS_GW_ALPHABET_7_BIT_DEFAULT){if(user_data->num_headers>(0xa0a+3698-0x187c)){if
(wms_ts_compute_user_data_header_length(user_data->num_headers,user_data->
headers)<=WMS_SMS_UDL_MAX_8_BIT){user_data_header_length=
wms_ts_encode_user_data_header(user_data->num_headers,user_data->headers,data+
pos);pos+=user_data_header_length+(0x1a9f+1547-0x20a9);total_bits_occupied=(
user_data_header_length+(0xaef+5079-0x1ec5))*(0x195f+1795-0x205a);fill_bits=(
total_bits_occupied%(0x470+4254-0x1507));if(fill_bits!=(0xab1+1611-0x10fc)){
fill_bits=(0x1729+1040-0x1b32)-fill_bits;}user_data_length=(total_bits_occupied+
fill_bits+(user_data->sm_len*(0x306+8424-0x23e7)))/(0xc08+2429-0x157e);data[
(0x12f0+3751-0x2197)]=(UINT8)user_data_length;data[(0xcd+2862-0xbfa)]=
user_data_header_length;}else{at_print(LOG_DEBUG,
"\x45\x6e\x63\x6f\x64\x65\x20\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x48\x65\x61\x64\x65\x72\x20\x45\x78\x63\x65\x65\x64\x73\x20\x43\x61\x70\x61\x63\x69\x74\x79\x20\x2d\x20\x53\x6b\x69\x70\x70\x69\x6e\x67\x20\x55\x44\x48"
);}}i=wms_ts_pack_gw_7_bit_chars(user_data->sm_data,user_data->sm_len,fill_bits,
(UINT16)(WMS_MAX_LEN-pos),&data[pos]);pos+=i;}else{if(user_data->num_headers>
(0x1e6+8305-0x2257)){if(wms_ts_compute_user_data_header_length(user_data->
num_headers,user_data->headers)<=WMS_SMS_UDL_MAX_8_BIT){user_data_header_length=
wms_ts_encode_user_data_header(user_data->num_headers,user_data->headers,data+
pos);data[(0x5f1+6558-0x1f8f)]=(UINT8)(user_data->sm_len+user_data_header_length
+(0x488+2356-0xdbb));pos+=user_data_header_length+(0x44+9057-0x23a4);}else{
at_print(LOG_DEBUG,
"\x45\x6e\x63\x6f\x64\x65\x20\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x48\x65\x61\x64\x65\x72\x20\x45\x78\x63\x65\x65\x64\x73\x20\x43\x61\x70\x61\x63\x69\x74\x79\x20\x2d\x20\x53\x6b\x69\x70\x70\x69\x6e\x67\x20\x55\x44\x48"
);}}memcpy(&data[pos],user_data->sm_data,user_data->sm_len);pos+=user_data->
sm_len;}return(UINT8)pos;}wms_status_e_type wms_ts_encode_deliver(const
wms_gw_deliver_s_type*deliver,T_zUfiSms_RawTsData*raw_ts_data_ptr){
wms_status_e_type st=WMS_OK_S;UINT8*data;UINT8 pos=(0x1fd0+1457-0x2581),i;if(
deliver==NULL||raw_ts_data_ptr==NULL){at_print(LOG_DEBUG,
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x65\x6e\x63\x6f\x64\x65\x5f\x64\x65\x6c\x69\x76\x65\x72\x21"
);return WMS_NULL_PTR_S;}data=raw_ts_data_ptr->data;(void)memset(data,
(0x21bd+916-0x2551),WMS_MAX_LEN);data[pos]=(0x1767+778-0x1a71);data[pos]|=
deliver->more?(0x424+6392-0x1d1c):(0xc3f+5281-0x20dc);data[pos]|=deliver->
status_report_enabled?(0x34d+7496-0x2075):(0x18c+1427-0x71f);data[pos]|=deliver
->user_data_header_present?(0xe07+2674-0x1839):(0x175+6294-0x1a0b);data[pos]|=
deliver->reply_path_present?(0x9e2+1028-0xd66):(0x5e1+6469-0x1f26);pos++;i=
wms_ts_encode_address(&deliver->address,&data[pos]);if(i==(0x62a+5302-0x1ae0)){
return WMS_INVALID_PARM_SIZE_S;}pos+=i;data[pos]=deliver->pid;pos++;pos+=
wms_ts_encode_dcs(&deliver->dcs,data+pos);i=wms_ts_encode_timestamp(&deliver->
timestamp,data+pos);if(i==(0xaff+1663-0x117e)){return WMS_INVALID_PARM_VALUE_S;}
pos+=i;if(wms_ts_compute_gw_user_data_length(&deliver->dcs,&deliver->user_data)>
WMS_SMS_UDL_MAX_8_BIT){at_print(LOG_DEBUG,
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79"
);st=WMS_INVALID_USER_DATA_SIZE_S;}else{i=wms_ts_encode_gw_user_data(&deliver->
dcs,&deliver->user_data,data+pos);pos+=i;}raw_ts_data_ptr->tpdu_type=
WMS_TPDU_DELIVER;raw_ts_data_ptr->len=pos;return st;}UINT8
wms_ts_encode_relative_time(const wms_timestamp_s_type*timestamp){uint32 i;UINT8
v=(0x9c5+4635-0x1be0),j;if(timestamp!=NULL){if(!wms_ts_bcd_to_int(timestamp->
year,&j)){at_print(LOG_DEBUG,
"\x59\x65\x61\x72\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j
);}i=j*(0xf52+4799-0x20a4);if(!wms_ts_bcd_to_int(timestamp->month,&j)){at_print(
LOG_DEBUG,
"\x4d\x6f\x6e\x74\x68\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);}i=i+j*(0x640+7011-0x2185);if(!wms_ts_bcd_to_int(timestamp->day,&j)){
at_print(LOG_DEBUG,
"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);}i
+=j;if(i>(0x57b+6561-0x1efe)){v=(UINT8)((i+(0x465+8417-0x2540))/
(0x1357+1291-0x185b)+(0x30f+183-0x306));}else if(i>=(0x858+4454-0x19bd)){v=(
UINT8)(i+(0xcaa+437-0xdb9));}else{if(!wms_ts_bcd_to_int(timestamp->day,&j)){
at_print(LOG_DEBUG,
"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);}i
=j*(0xa51+940-0xde5)*(0xbfc+1256-0x10a8);if(!wms_ts_bcd_to_int(timestamp->hour,&
j)){at_print(LOG_DEBUG,
"\x48\x6f\x75\x72\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j
);}i=i+j*(0x140f+1225-0x189c);if(!wms_ts_bcd_to_int(timestamp->minute,&j)){
at_print(LOG_DEBUG,
"\x4d\x69\x6e\x75\x74\x65\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);}i+=j;if(i>(0xc48+2214-0x14e2)*(0xb92+4319-0x1c35)){v=(UINT8)((i-((
(0x108+4152-0x1134)*(0x23bd+93-0x23de))+(0xc03+3825-0x1ad7)))/(0x8a+8919-0x2343)
+(0xab2+5060-0x1de7));}else{v=(UINT8)((i+(0x122a+1381-0x178b))/
(0x1b85+1032-0x1f88)-(0x815+4089-0x180d));}}}else{at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x65\x6e\x63\x6f\x64\x65\x5f\x72\x65\x6c\x61\x74\x69\x76\x65\x5f\x74\x69\x6d\x65"
);}return v;}UINT8 wms_ts_encode_gw_validity(const wms_gw_validity_s_type*
validity,UINT8*data){UINT8 i,pos=(0x8fd+4575-0x1adc);switch(validity->format){
case WMS_GW_VALIDITY_NONE:break;case WMS_GW_VALIDITY_RELATIVE:data[pos]=
wms_ts_encode_relative_time(&validity->u.time);pos++;break;case
WMS_GW_VALIDITY_ABSOLUTE:i=wms_ts_encode_timestamp(&validity->u.time,data+pos);
if(i==(0xd0d+3884-0x1c39)){at_print(LOG_DEBUG,
"\x45\x72\x72\x6f\x72\x20\x77\x68\x69\x6c\x65\x20\x44\x65\x63\x6f\x64\x69\x6e\x67\x20\x41\x62\x73\x6f\x6c\x75\x74\x65\x20\x56\x61\x6c\x69\x64\x69\x74\x79\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70"
);}pos+=i;break;case WMS_GW_VALIDITY_ENHANCED:break;default:break;}return pos;}
wms_status_e_type wms_ts_encode_submit(const wms_gw_submit_s_type*submit,
T_zUfiSms_RawTsData*raw_ts_data_ptr){wms_status_e_type st=WMS_OK_S;UINT8*data;
UINT8 pos=(0xa2b+1046-0xe41),i;if(submit==NULL||raw_ts_data_ptr==NULL){at_print(
LOG_DEBUG,
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x65\x6e\x63\x6f\x64\x65\x5f\x73\x75\x62\x6d\x69\x74\x21"
);return WMS_NULL_PTR_S;}data=raw_ts_data_ptr->data;(void)memset(data,
(0x592+4759-0x1829),WMS_MAX_LEN);data[pos]=(0xd6a+3358-0x1a87);data[pos]|=submit
->reject_duplicates?(0x6f0+6837-0x21a1):(0x32f+7780-0x2193);if(submit->validity.
format>(0xb94+6696-0x25b9)){return st=WMS_INVALID_VALIDITY_FORMAT_S;}data[pos]|=
submit->validity.format<<(0x8a1+2019-0x1081);data[pos]|=submit->
status_report_enabled?(0x82d+4680-0x1a55):(0x72c+998-0xb12);data[pos]|=submit->
user_data_header_present?(0x440+4713-0x1669):(0x23c+669-0x4d9);data[pos]|=submit
->reply_path_present?(0x152f+1137-0x1920):(0x1fd+946-0x5af);pos++;data[pos]=(
UINT8)submit->message_reference;pos++;i=wms_ts_encode_address(&submit->address,&
data[pos]);if(i==(0x6bf+7368-0x2387)){return WMS_INVALID_PARM_SIZE_S;}pos+=i;
data[pos]=submit->pid;pos++;pos+=wms_ts_encode_dcs(&submit->dcs,data+pos);pos+=
wms_ts_encode_gw_validity(&submit->validity,data+pos);if(
wms_ts_compute_gw_user_data_length(&submit->dcs,&submit->user_data)>
WMS_SMS_UDL_MAX_8_BIT){at_print(LOG_DEBUG,
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79"
);st=WMS_INVALID_USER_DATA_SIZE_S;}else{i=wms_ts_encode_gw_user_data(&submit->
dcs,&submit->user_data,data+pos);pos+=i;}raw_ts_data_ptr->tpdu_type=
WMS_TPDU_SUBMIT;raw_ts_data_ptr->len=pos;return st;}wms_status_e_type
wms_ts_encode_status_report(const wms_gw_status_report_s_type*status_report,
T_zUfiSms_RawTsData*raw_ts_data_ptr){wms_status_e_type st=WMS_OK_S;UINT8*data;
UINT8 pos=(0x253f+295-0x2666),i;if(status_report==NULL||raw_ts_data_ptr==NULL){
at_print(LOG_DEBUG,
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x65\x6e\x63\x6f\x64\x65\x5f\x73\x74\x61\x74\x75\x73\x5f\x72\x65\x70\x6f\x72\x74\x21"
);return WMS_NULL_PTR_S;}data=raw_ts_data_ptr->data;(void)memset(data,
(0x1aac+2967-0x2643),WMS_MAX_LEN);data[pos]=(0x11ed+2697-0x1c66);data[pos]|=
status_report->more?(0xb84+4869-0x1e89):(0x13c5+1517-0x19ae);data[pos]|=
status_report->status_report_qualifier?(0x72c+851-0xa5f):(0x462+7768-0x22ba);
data[pos]|=status_report->user_data_header_present?(0x2e0+2911-0xdff):
(0x79+2885-0xbbe);pos++;data[pos]=(UINT8)status_report->message_reference;pos++;
i=wms_ts_encode_address(&status_report->address,&data[pos]);if(i==
(0x697+2922-0x1201)){return WMS_INVALID_PARM_SIZE_S;}pos+=i;i=
wms_ts_encode_timestamp(&status_report->timestamp,data+pos);if(i==
(0x8a6+1431-0xe3d)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;i=
wms_ts_encode_timestamp(&status_report->discharge_time,data+pos);if(i==
(0x517+6785-0x1f98)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;data[pos]=
status_report->tp_status;pos++;data[pos]=(UINT8)status_report->mask;pos++;if(
status_report->mask&WMS_TPDU_MASK_PID){data[pos]=status_report->pid;pos++;}if(
status_report->mask&WMS_TPDU_MASK_DCS){pos+=wms_ts_encode_dcs(&status_report->
dcs,data+pos);}if(status_report->mask&WMS_TPDU_MASK_USER_DATA){if(
wms_ts_compute_gw_user_data_length(&status_report->dcs,&status_report->user_data
)>WMS_SMS_UDL_MAX_8_BIT){at_print(LOG_DEBUG,
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79"
);st=WMS_INVALID_USER_DATA_SIZE_S;}else{i=wms_ts_encode_gw_user_data(&
status_report->dcs,&status_report->user_data,data+pos);pos+=i;}}raw_ts_data_ptr
->tpdu_type=WMS_TPDU_STATUS_REPORT;raw_ts_data_ptr->len=pos;return st;}
wms_status_e_type wms_ts_encode(const T_zUfiSms_ClientTsData*ptClientTsData,
T_zUfiSms_RawTsData*ptRawTsData){wms_status_e_type st=WMS_OK_S;const
wms_gw_pp_ts_data_s_type*msg;if(ptClientTsData==NULL||ptRawTsData==NULL){return
WMS_NULL_PTR_S;}msg=&ptClientTsData->u.gw_pp;switch(ptClientTsData->format){
#if (0x17d5+1645-0x1e42)
case WMS_FORMAT_CDMA:case WMS_FORMAT_ANALOG_AWISMS:case WMS_FORMAT_ANALOG_CLI:
case WMS_FORMAT_ANALOG_VOICE_MAIL:case WMS_FORMAT_ANALOG_SMS:case WMS_FORMAT_MWI
:st=wms_ts_encode_bearer_data(&ptClientTsData->u.cdma,ptRawTsData);break;
#endif
case WMS_FORMAT_GW_PP:ptRawTsData->tpdu_type=msg->tpdu_type;switch(msg->
tpdu_type){case WMS_TPDU_DELIVER:st=wms_ts_encode_deliver(&msg->u.deliver,
ptRawTsData);break;case WMS_TPDU_SUBMIT:st=wms_ts_encode_submit(&msg->u.submit,
ptRawTsData);break;case WMS_TPDU_STATUS_REPORT:st=wms_ts_encode_status_report(&
msg->u.status_report,ptRawTsData);break;
#if (0x11ad+2324-0x1ac1)
case WMS_TPDU_SUBMIT_REPORT_ACK:st=wms_ts_encode_submit_report_ack(&msg->u.
submit_report_ack,ptRawTsData);break;case WMS_TPDU_SUBMIT_REPORT_ERROR:st=
wms_ts_encode_submit_report_error(&msg->u.submit_report_error,ptRawTsData);break
;case WMS_TPDU_COMMAND:st=wms_ts_encode_command(&msg->u.command,ptRawTsData);
break;case WMS_TPDU_DELIVER_REPORT_ACK:st=wms_ts_encode_deliver_report_ack(&msg
->u.deliver_report_ack,ptRawTsData);break;case WMS_TPDU_DELIVER_REPORT_ERROR:st=
wms_ts_encode_deliver_report_error(&msg->u.deliver_report_error,ptRawTsData);
break;
#endif
default:at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x54\x50\x44\x55\x20\x74\x79\x70\x65\x20\x25\x64"
,msg->tpdu_type);st=WMS_INVALID_TPDU_TYPE_S;break;}break;default:st=
WMS_INVALID_FORMAT_S;at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x66\x6f\x72\x6d\x61\x74\x3a\x20\x25\x64",
ptClientTsData->format);break;}ptRawTsData->format=ptClientTsData->format;return
st;}UINT8 wms_ts_unpack_gw_7_bit_chars(const UINT8*in,UINT8 in_len,UINT8
out_len_max,UINT16 shift,UINT8*out){int i=(0x152+7981-0x207f);UINT16 pos=
(0x12e5+253-0x13e2);if(in==NULL||out==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x75\x6e\x70\x61\x63\x6b\x5f\x67\x77\x5f\x37\x5f\x62\x69\x74\x5f\x63\x68\x61\x72\x73"
);return(0x67b+1531-0xc76);}if(shift!=(0x9a9+5177-0x1de2))pos=pos+
(0x414+8122-0x23cd);if(shift==(0xac0+3301-0x179e)){out[(0xcbb+3994-0x1c55)]=in[
(0x10cc+434-0x127e)]>>(0xd3c+3114-0x1965);shift=(0x264+4975-0x15d3);i=
(0xaa1+2274-0x1382);}for(i=i;i<out_len_max&&i<in_len;i++,pos++){out[i]=(in[pos]
<<shift)&(0x1bcc+751-0x1e3c);if(pos!=(0x2032+480-0x2212)){
#if (0xbcf+3365-0x18f3)
if(shift==(0x828+7576-0x25c0)){out[i]|=(0x1e7c+295-0x1fa3);}else{out[i]|=in[pos-
(0xe94+5957-0x25d8)]>>((0x12a+8947-0x2415)-shift);}
#else
out[i]|=in[pos-(0x12f2+3093-0x1f06)]>>((0x1509+2367-0x1e40)-shift);
#endif
}shift++;if(shift==(0x582+46-0x5a9)){shift=(0x67b+3832-0x1573);i++;if(i>=
out_len_max){at_print(LOG_DEBUG,
"\x4e\x6f\x74\x20\x65\x6e\x6f\x75\x67\x68\x20\x6f\x75\x74\x70\x75\x74\x20\x62\x75\x66\x66\x65\x72\x20\x66\x6f\x72\x20\x75\x6e\x70\x61\x63\x6b\x69\x6e\x67\x21"
);break;}out[i]=in[pos]>>(0xf9b+2994-0x1b4c);}}return(UINT8)(pos);}UINT8
wms_ts_decode_address(const UINT8*data,wms_address_s_type*addr){UINT8 i,pos=
(0xb32+2468-0x14d6);i=data[pos];if(i>WMS_GW_ADDRESS_MAX){at_print(LOG_DEBUG,
"\x41\x64\x64\x72\x20\x6c\x65\x6e\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x20\x25\x64"
,i);return(0x1cc3+633-0x1f3c);}addr->number_of_digits=i;pos++;addr->digit_mode=
WMS_DIGIT_MODE_4_BIT;addr->number_type=(wms_number_type_e_type)((data[pos]&
(0x56f+8455-0x2606))>>(0x1231+2550-0x1c23));addr->number_plan=(
wms_number_plan_e_type)(data[pos]&(0xa46+3828-0x192b));pos++;if(addr->
number_type==WMS_NUMBER_ALPHANUMERIC){UINT8 bytes_increment=(0x10d9+1932-0x1865)
;addr->digit_mode=WMS_DIGIT_MODE_8_BIT;bytes_increment=(addr->number_of_digits+
(0x3b5+8357-0x2459))/(0x9ff+2101-0x1232);addr->number_of_digits=(UINT8)(addr->
number_of_digits*(0x5c0+5989-0x1d21)/(0xd46+5457-0x2290));(void)
wms_ts_unpack_gw_7_bit_chars(&data[pos],addr->number_of_digits,
WMS_GW_ADDRESS_MAX,(0x414+2018-0xbf6),addr->digits);pos+=bytes_increment;}else{
for(i=(0x452+2629-0xe97);i<addr->number_of_digits;i++){addr->digits[i++]=data[
pos]&(0xe63+5808-0x2504);addr->digits[i]=(data[pos]&(0x578+7860-0x233c))>>
(0x1567+984-0x193b);pos++;}}return pos;}UINT8 wms_ts_decode_dcs(const UINT8*data
,wms_gw_dcs_s_type*dcs){UINT8 pos=(0x116+5921-0x1837);UINT8 i;if(data==NULL||dcs
==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x64\x63\x73"
);return(0x1b78+1909-0x22ed);}dcs->msg_class=WMS_MESSAGE_CLASS_NONE;dcs->
msg_waiting=WMS_GW_MSG_WAITING_NONE;dcs->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;
dcs->is_compressed=FALSE;i=(data[pos]&(0xa44+562-0xbb6))>>(0xc8b+5404-0x21a1);
switch(i){case(0x7f+1199-0x52e):dcs->is_compressed=data[pos]&(0x240+4392-0x1348)
;if(data[pos]&(0xc54+2282-0x152e)){dcs->msg_class=(wms_message_class_e_type)(
data[pos]&(0x72f+4641-0x194d));}else{dcs->msg_class=WMS_MESSAGE_CLASS_NONE;}dcs
->alphabet=(wms_gw_alphabet_e_type)((data[pos]&(0x1afa+1705-0x2197))>>
(0x731+1581-0xd5c));break;case(0x7e9+3653-0x162b):if((data[pos]&
(0x944+1917-0x1091))==(0x770+4917-0x1a75)){dcs->alphabet=(data[pos]&
(0x42c+2927-0xf97))?WMS_GW_ALPHABET_8_BIT:WMS_GW_ALPHABET_7_BIT_DEFAULT;dcs->
msg_class=(wms_message_class_e_type)(data[pos]&(0x305+7548-0x207e));dcs->
is_compressed=FALSE;dcs->msg_waiting=WMS_GW_MSG_WAITING_NONE_1111;}else{dcs->
is_compressed=FALSE;dcs->msg_class=WMS_MESSAGE_CLASS_NONE;if((data[pos]&
(0x533+453-0x6c8))==(0x10f+6370-0x19f1)){dcs->msg_waiting=
WMS_GW_MSG_WAITING_DISCARD;dcs->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}else if(
(data[pos]&(0x9dc+2126-0x11fa))==(0x1742+3584-0x2532)){dcs->msg_waiting=
WMS_GW_MSG_WAITING_STORE;dcs->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}else{dcs->
msg_waiting=WMS_GW_MSG_WAITING_STORE;dcs->alphabet=WMS_GW_ALPHABET_UCS2;}dcs->
msg_waiting_active=(data[pos]&(0xe6+4014-0x108c))?TRUE:FALSE;dcs->
msg_waiting_kind=(wms_gw_msg_waiting_kind_e_type)(data[pos]&(0x72b+1108-0xb7c));
}break;default:at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x44\x43\x53\x3a\x20\x25\x78",data[pos]);dcs->
alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;dcs->is_compressed=FALSE;dcs->msg_waiting
=WMS_GW_MSG_WAITING_NONE;dcs->msg_class=WMS_MESSAGE_CLASS_NONE;break;}if(dcs->
alphabet>WMS_GW_ALPHABET_UCS2){dcs->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}dcs
->raw_dcs_data=data[pos];pos++;return pos;}UINT8 wms_ts_decode_timestamp(const
UINT8*data,wms_timestamp_s_type*timestamp){UINT8 pos=(0x122+6716-0x1b5e),i,j;if(
data==NULL||timestamp==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x74\x69\x6d\x65\x73\x74\x61\x6d\x70"
);return(0xdf0+5363-0x22e3);}i=((data[pos]&(0x244+9376-0x26d5))<<
(0x172b+2709-0x21bc))+((data[pos]&(0xc86+2224-0x1446))>>(0x4c2+7023-0x202d));if(
!wms_ts_bcd_to_int(i,&j)){at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x59\x65\x61\x72\x20\x3a\x20\x25\x64"
,data[pos]);i=(0x5f1+419-0x794);}timestamp->year=i;pos++;i=((data[pos]&
(0x21fa+335-0x233a))<<(0x9e2+2018-0x11c0))+((data[pos]&(0x23cb+263-0x23e2))>>
(0xac9+3937-0x1a26));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x19b5+475-0x1b84)||j<
(0x1902+3391-0x2640)){at_print(LOG_DEBUG,
"\x4d\x6f\x6e\x74\x68\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64"
,j);i=(0xa88+3054-0x1675);}}else{at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x4d\x6f\x6e\x74\x68\x20\x3a\x20\x25\x64"
,data[pos]);i=(0x19e1+998-0x1dc6);}timestamp->month=i;pos++;i=((data[pos]&
(0x51a+7426-0x220d))<<(0xc11+159-0xcac))+((data[pos]&(0xa76+2988-0x1532))>>
(0x1f62+118-0x1fd4));if(wms_ts_bcd_to_int(i,&j)){if(j>(0xf72+4523-0x20fe)||j<
(0x15a0+1974-0x1d55)){at_print(LOG_DEBUG,
"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);i=
(0x1ae2+1109-0x1f36);}}else{at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x44\x61\x79\x20\x3a\x20\x25\x64"
,data[pos]);i=(0xfd+5567-0x16bb);}timestamp->day=i;pos++;i=((data[pos]&
(0x12a8+791-0x15b0))<<(0x956+7056-0x24e2))+((data[pos]&(0x2f9+4968-0x1571))>>
(0x1fc9+752-0x22b5));if(wms_ts_bcd_to_int(i,&j)){if(j>(0xc60+3534-0x1a17)){
at_print(LOG_DEBUG,
"\x48\x6f\x75\x72\x20\x69\x73\x20\x74\x6f\x6f\x20\x6c\x61\x72\x67\x65\x3a\x20\x25\x64"
,j);i=(0x157d+238-0x166b);}}else{at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x48\x6f\x75\x72\x20\x3a\x20\x25\x64"
,data[pos]);i=(0x54b+6585-0x1f04);}timestamp->hour=i;pos++;i=((data[pos]&
(0xdaf+906-0x112a))<<(0x92f+3666-0x177d))+((data[pos]&(0x14e1+4282-0x24ab))>>
(0x7cc+7119-0x2397));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x6eb+3782-0x1576)){
at_print(LOG_DEBUG,
"\x4d\x69\x6e\x75\x74\x65\x20\x69\x73\x20\x74\x6f\x6f\x20\x6c\x61\x72\x67\x65\x3a\x20\x25\x64"
,j);i=(0x84d+2826-0x1357);}}else{at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x4d\x69\x6e\x75\x74\x65\x20\x3a\x20\x25\x64"
,data[pos]);i=(0x1e61+21-0x1e76);}timestamp->minute=i;pos++;i=((data[pos]&
(0x10c+671-0x39c))<<(0xd01+6125-0x24ea))+((data[pos]&(0x12f+3769-0xef8))>>
(0x117f+4972-0x24e7));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x23a+559-0x42e)){
at_print(LOG_DEBUG,
"\x53\x65\x63\x6f\x6e\x64\x20\x69\x73\x20\x74\x6f\x6f\x20\x6c\x61\x72\x67\x65\x3a\x20\x25\x64"
,i);i=(0x1509+1350-0x1a4f);}}else{at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x44\x69\x67\x69\x74\x73\x20\x69\x6e\x20\x45\x6e\x63\x6f\x64\x65\x64\x20\x54\x69\x6d\x65\x73\x74\x61\x6d\x70\x20\x53\x65\x63\x6f\x6e\x64\x20\x3a\x20\x25\x64"
,data[pos]);i=(0x9bc+514-0xbbe);}timestamp->second=i;pos++;if(data[pos]&
(0x13f1+1760-0x1ac9)){timestamp->timezone=(data[pos]&(0x868+6390-0x2157))*
(0x192c+2008-0x20fa)+((data[pos]&(0x3f9+572-0x545))>>(0x185b+1356-0x1da3));
timestamp->timezone*=(-(0x37d+8317-0x23f9));}else{timestamp->timezone=(sint7)((
data[pos]&(0x103d+4696-0x2286))*(0x14d1+1074-0x18f9)+((data[pos]&
(0xdb2+6714-0x26fc))>>(0x3f8+1817-0xb0d)));}if(timestamp->timezone>
(0x10f9+3338-0x1dd3)||timestamp->timezone<-(0x1292+1653-0x18d7)){at_print(
LOG_DEBUG,
"\x54\x69\x6d\x65\x7a\x6f\x6e\x65\x20\x69\x73\x20\x6f\x75\x74\x20\x6f\x66\x20\x62\x6f\x75\x6e\x64\x3a\x20\x25\x64"
,timestamp->timezone);timestamp->timezone=(0x1ef4+1081-0x232d);}pos++;return pos
;}static UINT8 wms_ts_decode_udh_concat_8(const UINT8*udh,wms_udh_s_type*
header_ptr){UINT8 pos=(0xe64+575-0x10a3);if(udh==NULL||header_ptr==NULL){
at_print(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
(0x578+2375-0xebf);}if(udh[pos]<(0x1e13+1370-0x236a)){at_print(LOG_DEBUG,
"\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x43\x6f\x6e\x63\x61\x74\x20\x38\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x15d0+1257-0x1ab9);}if(udh[pos+(0x4f3+1802-0xbfb)]==
(0x16df+2408-0x2047)||udh[pos+(0x3aa+8339-0x243a)]>udh[pos+(0x349+519-0x54e)]){
at_print(LOG_DEBUG,
"\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x43\x6f\x6e\x74\x61\x63\x74\x20\x38\x20\x77\x69\x74\x68\x20\x6f\x75\x74\x20\x6f\x66\x20\x62\x6f\x75\x6e\x64\x20\x6d\x61\x78\x20\x6d\x65\x73\x73\x61\x67\x65\x73"
);return(0x6a9+2318-0xfb7);}pos++;header_ptr->header_id=WMS_UDH_CONCAT_8;
header_ptr->u.concat_8.msg_ref=udh[pos++];header_ptr->u.concat_8.total_sm=udh[
pos++];header_ptr->u.concat_8.seq_num=udh[pos++];return(udh[(0x328+9002-0x2652)]
+(0x268+9364-0x26fb));}static UINT8 wms_ts_decode_udh_concat16(const UINT8*udh,
wms_udh_s_type*header_ptr){UINT8 pos=(0x1252+1920-0x19d2);if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0xfea+2308-0x18ee);}if(
udh[pos]<(0x227+3631-0x1052)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x43\x6f\x6e\x63\x61\x74\x31\x36\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0xadf+192-0xb9f);}if(udh[pos+(0x220+5271-0x16b4)]==
(0xa1b+4272-0x1acb)||udh[pos+(0x1dd+6488-0x1b31)]==(0x1ed4+265-0x1fdd)||udh[pos+
(0x176+9426-0x2644)]>udh[pos+(0x14f6+4397-0x2620)])return(0x8a4+2978-0x1446);
header_ptr->header_id=WMS_UDH_CONCAT_16;pos++;header_ptr->u.concat_16.msg_ref=
udh[pos++];header_ptr->u.concat_16.msg_ref=(UINT16)(header_ptr->u.concat_16.
msg_ref<<(0x595+6620-0x1f69))|udh[pos++];header_ptr->u.concat_16.total_sm=udh[
pos++];header_ptr->u.concat_16.seq_num=udh[pos++];return(udh[(0x56a+274-0x67c)]+
(0x3a+8640-0x21f9));}static UINT8 wms_ts_udh_decode_first_seg_check(const UINT8
len,const UINT8*data,UINT8*is_first_segment_ptr){UINT8 pos=(0x8c+2139-0x8e7);
UINT8 num_headers=(0x67a+2843-0x1195);UINT8 udhl=(0x1434+3293-0x2111);UINT8 iedl
=(0x2d3+6686-0x1cf1);UINT8 iei=(0xb78+1511-0x115f);*is_first_segment_ptr=TRUE;if
(data==NULL||data[pos]==(0x209f+181-0x2154)||len==(0x2299+516-0x249d)){at_print(
LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x75\x64\x68\x5f\x64\x65\x63\x6f\x64\x65\x5f\x66\x69\x72\x73\x74\x5f\x73\x65\x67\x5f\x63\x68\x65\x63\x6b"
);return FALSE;}udhl=data[pos];pos++;while((pos<udhl)&&(num_headers<
WMS_MAX_UD_HEADERS)){iei=data[pos];iedl=data[pos+(0x1f03+1341-0x243f)];if(iei==
WMS_UDH_CONCAT_16){if(data[pos+(0x8ca+6775-0x233c)]!=(0x665+1817-0xd7d)){
at_print(LOG_DEBUG,
"\x57\x4d\x53\x5f\x55\x44\x48\x5f\x43\x4f\x4e\x43\x41\x54\x5f\x31\x36\x20\x6e\x6f\x74\x20\x66\x69\x72\x73\x74\x20\x73\x65\x67\x6d\x65\x6e\x74\x21"
);*is_first_segment_ptr=FALSE;return TRUE;}else{return TRUE;}}else{num_headers++
;pos+=((0x8d3+7583-0x2670)+iedl);}}return TRUE;}static UINT8
wms_ts_decode_udh_special_sm(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8
pos=(0x334+5759-0x19b3);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x6a+7679-0x1e69);}if(udh
[pos]<(0x3e4+1090-0x824)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x53\x70\x65\x63\x69\x61\x6c\x20\x53\x4d\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0xd48+1038-0x1156);}pos++;header_ptr->header_id=
WMS_UDH_SPECIAL_SM;header_ptr->u.special_sm.msg_waiting=(
wms_gw_msg_waiting_e_type)((udh[pos]>>(0xd37+2851-0x1853)==(0xa41+6143-0x2240))?
WMS_GW_MSG_WAITING_DISCARD:WMS_GW_MSG_WAITING_STORE);header_ptr->u.special_sm.
msg_waiting_kind=(wms_gw_msg_waiting_kind_e_type)(udh[pos++]&(0x59a+7791-0x238a)
);header_ptr->u.special_sm.message_count=udh[pos++];return(udh[
(0x1bdc+742-0x1ec2)]+(0x18c1+1596-0x1efc));}static UINT8
wms_ts_decode_udh_port_8(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=
(0x202c+994-0x240e);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x17d6+1071-0x1c05);}if(
udh[pos]<(0x3e3+8665-0x25ba)){at_print(LOG_DEBUG,
"\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x50\x6f\x72\x74\x20\x38\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x5fc+4746-0x1886);}pos++;header_ptr->header_id=WMS_UDH_PORT_8
;header_ptr->u.wap_8.dest_port=udh[pos++];header_ptr->u.wap_8.orig_port=udh[pos
++];return(udh[(0x68f+2762-0x1159)]+(0x401+677-0x6a5));}static UINT8
wms_ts_decode_udh_port16(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=
(0xde7+1273-0x12e0);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x11+756-0x305);}if(udh[
pos]<(0x36b+5566-0x1925)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x50\x6f\x72\x74\x31\x36\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0xb4+8299-0x211f);}header_ptr->header_id=WMS_UDH_PORT_16;pos++
;header_ptr->u.wap_16.dest_port=udh[pos++];header_ptr->u.wap_16.dest_port=(
UINT16)(header_ptr->u.wap_16.dest_port<<(0x1628+841-0x1969))|udh[pos++];
header_ptr->u.wap_16.orig_port=udh[pos++];header_ptr->u.wap_16.orig_port=(UINT16
)(header_ptr->u.wap_16.orig_port<<(0x77d+1137-0xbe6))|udh[pos++];return(udh[
(0x715+3127-0x134c)]+(0x1c82+698-0x1f3b));}static UINT8
wms_ts_decode_udh_text_formatting(const UINT8*udh,wms_udh_s_type*header_ptr){
UINT8 pos=(0x1214+4629-0x2429);if(udh==NULL||header_ptr==NULL){at_print(
LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
(0xb5+8975-0x23c4);}if(udh[pos]<(0x91d+3899-0x1855)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x54\x65\x78\x74\x20\x46\x6f\x72\x6d\x61\x74\x74\x69\x6e\x67\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0xe3b+1496-0x1413);}if(udh[pos]>=(0x962+3526-0x1724)){
header_ptr->u.text_formating.is_color_present=TRUE;}else{header_ptr->u.
text_formating.is_color_present=FALSE;}pos++;header_ptr->header_id=
WMS_UDH_TEXT_FORMATING;header_ptr->u.text_formating.start_position=udh[pos++];
header_ptr->u.text_formating.text_formatting_length=udh[pos++];header_ptr->u.
text_formating.alignment_type=(wms_udh_alignment_e_type)(udh[pos]&
(0xd4+2870-0xc07));header_ptr->u.text_formating.font_size=(
wms_udh_font_size_e_type)((udh[pos]&(0x129b+5166-0x26bd))>>(0x16a1+528-0x18af));
header_ptr->u.text_formating.style_bold=(udh[pos]&(0x470+1870-0xbae))>>
(0x11eb+863-0x1546);header_ptr->u.text_formating.style_italic=(udh[pos]&
(0x20f3+600-0x232b))>>(0x147c+1145-0x18f0);header_ptr->u.text_formating.
style_underlined=(udh[pos]&(0x182b+493-0x19d8))>>(0xa9+6167-0x18ba);header_ptr->
u.text_formating.style_strikethrough=(udh[pos]&(0x14b9+1497-0x1a12))>>
(0xd58+4996-0x20d5);pos++;if(header_ptr->u.text_formating.is_color_present){
header_ptr->u.text_formating.text_color_foreground=(wms_udh_text_color_e_type)(
udh[pos]&(0xa74+1525-0x105a));header_ptr->u.text_formating.text_color_background
=(wms_udh_text_color_e_type)((udh[pos]&(0x9e0+3675-0x174b))>>
(0x1955+1559-0x1f68));pos++;}return(udh[(0x4e0+667-0x77b)]+(0x860+3135-0x149e));
}static UINT8 wms_ts_decode_udh_pre_def_sound(const UINT8*udh,wms_udh_s_type*
header_ptr){UINT8 pos=(0x4a3+4766-0x1741);if(udh==NULL||header_ptr==NULL){
at_print(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
(0xb4+3188-0xd28);}if(udh[pos]<(0x11f4+4518-0x2398)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x50\x72\x65\x20\x44\x65\x66\x69\x6e\x65\x64\x20\x53\x6f\x75\x6e\x64\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x13b9+584-0x1601);}pos++;header_ptr->header_id=
WMS_UDH_PRE_DEF_SOUND;header_ptr->u.pre_def_sound.position=udh[pos++];header_ptr
->u.pre_def_sound.snd_number=udh[pos++];return(udh[(0x13c1+2790-0x1ea7)]+
(0x2c6+7038-0x1e43));}static UINT8 wms_ts_decode_udh_user_def_sound(const UINT8*
udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x7e1+449-0x9a2),j;if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x174+5151-0x1593);}if(
udh[pos]==(0x668+4450-0x17ca)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x55\x73\x65\x72\x20\x44\x65\x66\x69\x6e\x65\x64\x20\x53\x6f\x75\x6e\x64\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x6e\x6f\x20\x44\x61\x74\x61"
);return(0xbc9+1637-0x122e);}header_ptr->header_id=WMS_UDH_USER_DEF_SOUND;
header_ptr->u.user_def_sound.data_length=udh[pos++]-(0x954+2598-0x1379);
header_ptr->u.user_def_sound.position=udh[pos++];if(header_ptr->u.user_def_sound
.data_length>WMS_UDH_MAX_SND_SIZE){at_print(LOG_DEBUG,
"\x4d\x61\x78\x20\x53\x69\x7a\x65\x20\x45\x78\x63\x65\x65\x64\x20\x48\x65\x61\x64\x65\x72\x20\x69\x64\x20\x25\x64\x20"
,header_ptr->header_id);return(0xcca+6700-0x26f6);}memset(header_ptr->u.
user_def_sound.user_def_sound,(0xc80+4793-0x1e3a),WMS_UDH_MAX_SND_SIZE);for(j=
(0xb41+5236-0x1fb5);j<header_ptr->u.user_def_sound.data_length;j++)header_ptr->u
.user_def_sound.user_def_sound[j]=udh[pos++];return pos;}static UINT8
wms_ts_decode_udh_pre_def_anim(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8
pos=(0x545+5046-0x18fb);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x107d+4793-0x2336);}if(
udh[pos]!=(0xad5+5672-0x20fb)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x50\x72\x65\x20\x44\x65\x66\x69\x6e\x65\x64\x20\x41\x6e\x69\x6d\x61\x74\x69\x6f\x6e\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0xfd0+2087-0x17f7);}pos++;header_ptr->header_id=
WMS_UDH_PRE_DEF_ANIM;header_ptr->u.pre_def_anim.position=udh[pos++];header_ptr->
u.pre_def_anim.animation_number=udh[pos++];return pos;}static UINT8
wms_ts_decode_udh_large_anim(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8
pos=(0xc93+281-0xdac),j,k;if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x5e5+7698-0x23f7);}if(
udh[pos]!=(WMS_UDH_ANIM_NUM_BITMAPS*WMS_UDH_LARGE_BITMAP_SIZE+
(0x23b3+396-0x253e))){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x4c\x61\x72\x67\x65\x20\x44\x65\x66\x69\x6e\x65\x64\x20\x41\x6e\x69\x6d\x61\x74\x69\x6f\x6e\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x13c3+3661-0x2210);}header_ptr->header_id=WMS_UDH_LARGE_ANIM;
pos++;header_ptr->u.large_anim.position=udh[pos++];for(j=(0x15d1+2604-0x1ffd);j<
WMS_UDH_ANIM_NUM_BITMAPS;j++)for(k=(0x7f+5456-0x15cf);k<
WMS_UDH_LARGE_BITMAP_SIZE;k++)header_ptr->u.large_anim.data[j][k]=udh[pos++];
return pos;}static UINT8 wms_ts_decode_udh_small_anim(const UINT8*udh,
wms_udh_s_type*header_ptr){UINT8 pos=(0x99c+6476-0x22e8),j,k;if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0xb54+1791-0x1253);}if(
udh[pos]!=(WMS_UDH_ANIM_NUM_BITMAPS*WMS_UDH_SMALL_BITMAP_SIZE+
(0x1017+751-0x1305))){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x4c\x61\x72\x67\x65\x20\x44\x65\x66\x69\x6e\x65\x64\x20\x41\x6e\x69\x6d\x61\x74\x69\x6f\x6e\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x458+7292-0x20d4);}header_ptr->header_id=WMS_UDH_SMALL_ANIM;
pos++;header_ptr->u.small_anim.position=udh[pos++];for(j=(0xe2+4374-0x11f8);j<
WMS_UDH_ANIM_NUM_BITMAPS;j++)for(k=(0x6b4+5646-0x1cc2);k<
WMS_UDH_SMALL_BITMAP_SIZE;k++)header_ptr->u.small_anim.data[j][k]=udh[pos++];
return pos;}static UINT8 wms_ts_decode_udh_large_picture(const UINT8*udh,
wms_udh_s_type*header_ptr){UINT8 pos=(0xd42+1365-0x1297),j;if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1114+4035-0x20d7);}if(
udh[pos]!=WMS_UDH_LARGE_PIC_SIZE+(0x54a+6171-0x1d64)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x4c\x61\x72\x67\x65\x20\x50\x69\x63\x74\x75\x72\x65\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x1efa+89-0x1f53);}header_ptr->header_id=WMS_UDH_LARGE_PICTURE
;pos++;header_ptr->u.large_picture.position=udh[pos++];for(j=(0x472+4269-0x151f)
;j<WMS_UDH_LARGE_PIC_SIZE;j++)header_ptr->u.large_picture.data[j]=udh[pos++];
return pos;}static UINT8 wms_ts_decode_udh_small_picture(const UINT8*udh,
wms_udh_s_type*header_ptr){UINT8 pos=(0x121d+130-0x129f),j;if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x3f0+579-0x633);}if(udh[
pos]!=WMS_UDH_SMALL_PIC_SIZE+(0x3c+6648-0x1a33)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x53\x6d\x61\x6c\x6c\x20\x50\x69\x63\x74\x75\x72\x65\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x67\x6e\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x1008+5471-0x2567);}header_ptr->header_id=
WMS_UDH_SMALL_PICTURE;pos++;header_ptr->u.small_picture.position=udh[pos++];for(
j=(0x1859+504-0x1a51);j<WMS_UDH_SMALL_PIC_SIZE;j++)header_ptr->u.small_picture.
data[j]=udh[pos++];return pos;}static UINT8 wms_ts_decode_udh_var_picture(const
UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x68f+636-0x90b),j,pic_size;if(
udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1397+776-0x169f);}if(
udh[pos]>WMS_UDH_VAR_PIC_SIZE+(0x1863+3053-0x244d)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x56\x61\x72\x20\x50\x69\x63\x74\x75\x72\x65\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x42a+1065-0x853);}if((udh[pos]-(0x1932+2896-0x247f))!=(udh[
pos+(0xc82+3442-0x19f2)]*udh[pos+(0x2ad+7567-0x2039)])){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x56\x61\x72\x20\x50\x69\x63\x74\x75\x72\x65\x2c\x20\x70\x69\x63\x20\x73\x69\x7a\x65\x20\x76\x61\x6c\x75\x65\x20\x6d\x69\x73\x6d\x61\x74\x63\x68\x20\x77\x69\x74\x68\x20\x68\x65\x69\x67\x74\x20\x61\x6e\x64\x20\x77\x65\x69\x67\x68\x74"
);return(0xa75+4290-0x1b37);}pic_size=udh[pos++]-(0x1151+738-0x1430);header_ptr
->header_id=WMS_UDH_VAR_PICTURE;header_ptr->u.var_picture.position=udh[pos++];
header_ptr->u.var_picture.width=(UINT8)(udh[pos++]*(0x640+4237-0x16c5));
header_ptr->u.var_picture.height=udh[pos++];for(j=(0x1a01+3203-0x2684);j<
pic_size&&j<WMS_UDH_VAR_PIC_SIZE;j++)header_ptr->u.var_picture.data[j]=udh[pos++
];return pos;}static UINT8 wms_ts_decode_udh_user_prompt(const UINT8*udh,
wms_udh_s_type*header_ptr){UINT8 pos=(0x20cd+1446-0x2673);if(udh==NULL||
header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1713+3831-0x260a);}if(
udh[pos]<(0x1af6+2416-0x2465)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x55\x73\x65\x72\x20\x50\x72\x6f\x6d\x70\x74\x20\x70\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x1320+5050-0x26da);}pos++;header_ptr->header_id=
WMS_UDH_USER_PROMPT;header_ptr->u.user_prompt.number_of_objects=udh[pos++];
return(udh[(0xfe6+2651-0x1a41)]+(0x1c24+2102-0x2459));}static UINT8
wms_ts_decode_udh_eo(const UINT8*udh,UINT8 first_segment,wms_udh_s_type*
header_ptr){UINT8 pos=(0x3c+4617-0x1245),udh_length;if(udh==NULL||header_ptr==
NULL){at_print(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
(0x2b4+6772-0x1d28);}if(udh[pos]==(0x1f83+1131-0x23ee)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x45\x78\x74\x65\x6e\x64\x65\x64\x20\x4f\x62\x6a\x65\x63\x74\x20\x70\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x6e\x6f\x20\x44\x61\x74\x61"
);return(0x686+2809-0x117f);}udh_length=udh[pos++];header_ptr->header_id=
WMS_UDH_EXTENDED_OBJECT;header_ptr->u.eo.first_segment=first_segment;if(
first_segment==TRUE){if(udh_length<WMS_UDH_OCTETS_EO_HEADER){return
(0xa14+1151-0xe93);}header_ptr->u.eo.reference=udh[pos++];header_ptr->u.eo.
length=udh[pos++]<<(0x270+3263-0xf27);header_ptr->u.eo.length|=udh[pos++];
header_ptr->u.eo.control=udh[pos++];header_ptr->u.eo.type=(wms_udh_eo_id_e_type)
udh[pos++];header_ptr->u.eo.position=udh[pos++]<<(0x118a+4775-0x2429);header_ptr
->u.eo.position|=udh[pos++];}header_ptr->u.eo.content.length=(udh_length-pos)+
(0xf6a+2691-0x19ec);memcpy(header_ptr->u.eo.content.data,udh+pos,header_ptr->u.
eo.content.length);pos+=header_ptr->u.eo.content.length;return pos;}static UINT8
wms_ts_decode_udh_rfc822(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=
(0x475+3504-0x1225);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1499+2645-0x1eee);}if(
udh[pos]<(0x3a+955-0x3f4)){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x52\x66\x63\x38\x32\x32\x20\x50\x72\x65\x73\x65\x6e\x74\x20\x77\x69\x74\x68\x20\x69\x6e\x76\x61\x6c\x69\x64\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3d\x20\x25\x64"
,udh[pos]);return(0x13e0+425-0x1589);}pos++;header_ptr->header_id=WMS_UDH_RFC822
;header_ptr->u.rfc822.header_length=udh[pos++];return(udh[(0x775+4991-0x1af4)]+
(0x4d6+3905-0x1416));}static UINT8 wms_ts_decode_udh_nat_lang_ss(const UINT8*udh
,wms_udh_s_type*header_ptr){UINT8 pos=(0x792+4048-0x1762);if(udh==NULL||
header_ptr==NULL){return(0x291+6724-0x1cd5);}if(udh[pos]!=
WMS_UDH_OCTETS_NAT_LANG_SS){return(0xefb+3151-0x1b4a);}pos++;header_ptr->
header_id=WMS_UDH_NAT_LANG_SS;if((WMS_UDH_NAT_LANG_TURKISH>udh[pos])||(
WMS_UDH_NAT_LANG_PORTUGUESE<udh[pos])){return(0xa08+963-0xdcb);}header_ptr->u.
nat_lang_ss.nat_lang_id=(wms_udh_nat_lang_id_e_type)udh[pos++];return(udh[
(0x628+3698-0x149a)]+(0x988+4878-0x1c95));}static UINT8
wms_ts_decode_udh_nat_lang_ls(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8
pos=(0x8cc+4907-0x1bf7);if(udh==NULL||header_ptr==NULL){return(0x26+3653-0xe6b);
}if(udh[pos]!=WMS_UDH_OCTETS_NAT_LANG_LS){return(0x970+1319-0xe97);}pos++;
header_ptr->header_id=WMS_UDH_NAT_LANG_LS;if((WMS_UDH_NAT_LANG_TURKISH>udh[pos])
||(WMS_UDH_NAT_LANG_PORTUGUESE<udh[pos])){return(0x86d+6733-0x22ba);}header_ptr
->u.nat_lang_ls.nat_lang_id=(wms_udh_nat_lang_id_e_type)udh[pos++];return(udh[
(0x1d68+1564-0x2384)]+(0x6b9+2802-0x11aa));}static UINT8 wms_ts_decode_udh_other
(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x1afc+618-0x1d66),i=
(0x1d1+5284-0x1675);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x46+936-0x3ee);}if(udh[
pos+(0x3e9+8196-0x23ec)]>WMS_UDH_OTHER_SIZE){at_print(LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x48\x65\x61\x64\x65\x72\x20\x4f\x74\x68\x65\x72\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x65\x78\x63\x65\x65\x64\x69\x6e\x67\x20\x32\x32\x36"
);return(0xfbc+4874-0x22c6);}header_ptr->header_id=(wms_udh_id_e_type)udh[pos];
header_ptr->u.other.header_id=(wms_udh_id_e_type)udh[pos++];header_ptr->u.other.
header_length=udh[pos++];for(i=(0xbf7+2592-0x1617);i<header_ptr->u.other.
header_length;i++){header_ptr->u.other.data[i]=udh[pos++];}return pos;}UINT8
wms_ts_decode_user_data_header(const UINT8 len,const UINT8*data,UINT8*
num_headers_ptr,wms_udh_s_type*udh_ptr){UINT8 pos=(0x4df+467-0x6b2);UINT8
header_length=(0x585+3188-0x11f9),num_headers=(0x1e2c+1386-0x2396);UINT8 udhl;
UINT8 first_segment=TRUE;if(data==NULL||len==(0xcda+1913-0x1453)||data[pos]==
(0x194+8861-0x2431)||num_headers_ptr==NULL||udh_ptr==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x75\x73\x65\x72\x5f\x64\x61\x74\x61\x5f\x68\x65\x61\x64\x65\x72"
);return(0x1ba+2980-0xd5e);}udhl=data[pos];pos++;while((pos<udhl)&&(num_headers<
WMS_MAX_UD_HEADERS)){switch(data[pos++]){case WMS_UDH_CONCAT_8:header_length=
wms_ts_decode_udh_concat_8(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_CONCAT_16:header_length=wms_ts_decode_udh_concat16(data+pos,&udh_ptr[
num_headers]);break;case WMS_UDH_SPECIAL_SM:header_length=
wms_ts_decode_udh_special_sm(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_PORT_8:header_length=wms_ts_decode_udh_port_8(data+pos,&udh_ptr[
num_headers]);break;case WMS_UDH_PORT_16:header_length=wms_ts_decode_udh_port16(
data+pos,&udh_ptr[num_headers]);break;case WMS_UDH_TEXT_FORMATING:header_length=
wms_ts_decode_udh_text_formatting(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_PRE_DEF_SOUND:header_length=wms_ts_decode_udh_pre_def_sound(data+pos,&
udh_ptr[num_headers]);break;case WMS_UDH_USER_DEF_SOUND:header_length=
wms_ts_decode_udh_user_def_sound(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_PRE_DEF_ANIM:header_length=wms_ts_decode_udh_pre_def_anim(data+pos,&
udh_ptr[num_headers]);break;case WMS_UDH_LARGE_ANIM:header_length=
wms_ts_decode_udh_large_anim(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_SMALL_ANIM:header_length=wms_ts_decode_udh_small_anim(data+pos,&udh_ptr[
num_headers]);break;case WMS_UDH_LARGE_PICTURE:header_length=
wms_ts_decode_udh_large_picture(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_SMALL_PICTURE:header_length=wms_ts_decode_udh_small_picture(data+pos,&
udh_ptr[num_headers]);break;case WMS_UDH_VAR_PICTURE:header_length=
wms_ts_decode_udh_var_picture(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_USER_PROMPT:header_length=wms_ts_decode_udh_user_prompt(data+pos,&
udh_ptr[num_headers]);break;case WMS_UDH_EXTENDED_OBJECT:
wms_ts_udh_decode_first_seg_check(len,data,&first_segment);header_length=
wms_ts_decode_udh_eo(data+pos,first_segment,&udh_ptr[num_headers]);break;case
WMS_UDH_RFC822:header_length=wms_ts_decode_udh_rfc822(data+pos,&udh_ptr[
num_headers]);break;case WMS_UDH_NAT_LANG_SS:header_length=
wms_ts_decode_udh_nat_lang_ss(data+pos,&udh_ptr[num_headers]);break;case
WMS_UDH_NAT_LANG_LS:header_length=wms_ts_decode_udh_nat_lang_ls(data+pos,&
udh_ptr[num_headers]);break;default:pos--;header_length=wms_ts_decode_udh_other(
data+pos,&udh_ptr[num_headers]);break;}if((UINT16)pos+(UINT16)header_length>
WMS_MAX_LEN){at_print(LOG_DEBUG,
"\x6e\x75\x6d\x62\x65\x72\x20\x6f\x66\x20\x62\x79\x74\x65\x73\x20\x64\x65\x63\x6f\x64\x65\x64\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x55\x44\x48\x4c\x20\x76\x61\x6c\x75\x65\x20\x6f\x66\x20\x25\x64"
,udhl);return(0x5ac+3250-0x125e);}else if(header_length!=(0xeb1+4678-0x20f7)){
pos+=header_length;num_headers++;}else{at_print(LOG_DEBUG,
"\x42\x61\x64\x20\x55\x44\x48\x3a\x20\x70\x6f\x73\x3d\x25\x64\x2c\x20\x64\x61\x74\x61\x5b\x70\x6f\x73\x5d\x3d\x25\x64"
,pos,data[pos]);*num_headers_ptr=(0x1aa7+297-0x1bd0);return(0x1838+2151-0x209f);
}}if(num_headers>=WMS_MAX_UD_HEADERS){at_print(LOG_DEBUG,
"\x64\x65\x63\x6f\x64\x65\x5f\x75\x64\x68\x3a\x20\x4e\x75\x6d\x20\x48\x65\x61\x64\x65\x72\x73\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x57\x4d\x53\x5f\x4d\x41\x58\x5f\x55\x44\x5f\x48\x45\x41\x44\x45\x52\x53"
);pos=udhl+(0x78b+5484-0x1cf6);}if(pos!=(udhl+(0x62f+7687-0x2435))){at_print(
LOG_DEBUG,
"\x53\x4d\x53\x20\x55\x44\x48\x20\x63\x6f\x75\x6c\x64\x20\x6e\x6f\x74\x20\x62\x65\x20\x64\x65\x63\x6f\x64\x65\x64"
);num_headers=(0x2359+183-0x2410);udhl=(0x757+4624-0x1967);}if(num_headers>
(0x52f+4371-0x1642)){*num_headers_ptr=num_headers;}return udhl;}UINT8
wms_ts_decode_gw_user_data(const wms_gw_dcs_s_type*dcs,const UINT8 len,const
UINT8*data,const UINT8 user_data_header_present,wms_gw_user_data_s_type*
user_data){UINT8 i,pos=(0x234+3061-0xe29);UINT8 fill_bits=(0xa9c+6834-0x254e);
UINT8 user_data_length;UINT8 user_data_header_length=(0x943+6428-0x225f);if(dcs
==NULL||data==NULL||user_data==NULL){at_print(LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x67\x77\x5f\x75\x73\x65\x72\x5f\x64\x61\x74\x61"
);return(0x1762+745-0x1a4b);}(void)memset(user_data,(0x12+2773-0xae7),sizeof(
wms_gw_user_data_s_type));if(len==(0x88b+3329-0x158c)){return(0xe4f+739-0x1132);
}if(dcs->alphabet==WMS_GW_ALPHABET_7_BIT_DEFAULT){if(len>WMS_SMS_UDL_MAX_7_BIT){
at_print(LOG_DEBUG,
"\x75\x73\x65\x72\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3e\x20\x6d\x61\x78\x20\x76\x61\x6c\x75\x65\x20\x66\x6f\x72\x20\x67\x77\x20\x37\x2d\x62\x69\x74\x20\x61\x6c\x70\x68\x61\x62\x65\x74"
);return(0x1853+2367-0x2192);}user_data_length=len;if(user_data_header_present){
user_data_header_length=wms_ts_decode_user_data_header(data[pos],data+pos,&
user_data->num_headers,user_data->headers);}if(user_data_header_length>len){
at_print(LOG_DEBUG,
"\x75\x73\x65\x72\x20\x64\x61\x74\x61\x20\x68\x65\x61\x64\x65\x72\x20\x6c\x65\x6e\x67\x74\x68\x20\x3e\x20\x74\x6f\x74\x61\x6c\x20\x6c\x65\x6e\x67\x74\x68"
);return(0x422+1716-0xad6);}if(user_data_header_length>(0x94c+17-0x95d)){
fill_bits=((len*(0x1585+1499-0x1b59))-((user_data_header_length+
(0xf02+3382-0x1c37))*(0xe23+6187-0x2646)))%(0xd97+714-0x105a);user_data_length=(
UINT8)(((len*(0x1139+2135-0x1989))-((user_data_header_length+
(0x153c+4126-0x2559))*(0xfad+4668-0x21e1)))/(0x863+3526-0x1622));pos=
user_data_header_length+(0x1f81+478-0x215e);if(fill_bits!=(0x1a66+1660-0x20e2)){
fill_bits=(0x602+4614-0x1800)-fill_bits;}}i=wms_ts_unpack_gw_7_bit_chars(&data[
pos],user_data_length,WMS_MAX_LEN,fill_bits,user_data->sm_data);user_data->
sm_len=user_data_length;}else{if(len>WMS_SMS_UDL_MAX_8_BIT){at_print(LOG_DEBUG,
"\x75\x73\x65\x72\x20\x64\x61\x74\x61\x20\x6c\x65\x6e\x67\x74\x68\x20\x3e\x20\x6d\x61\x78\x20\x76\x61\x6c\x75\x65\x20\x66\x6f\x72\x20\x38\x2d\x62\x69\x74\x20\x63\x68\x61\x72\x61\x72\x61\x63\x74\x65\x72\x73"
);return(0x1081+1691-0x171c);}user_data_length=len;if(user_data_header_present){
user_data_header_length=wms_ts_decode_user_data_header(data[pos],data+pos,&
user_data->num_headers,user_data->headers);if(user_data_header_length>len){
at_print(LOG_DEBUG,
"\x75\x73\x65\x72\x20\x64\x61\x74\x61\x20\x68\x65\x61\x64\x65\x72\x20\x6c\x65\x6e\x67\x74\x68\x20\x3e\x20\x74\x6f\x74\x61\x6c\x20\x6c\x65\x6e\x67\x74\x68"
);return(0x468+4453-0x15cd);}pos+=user_data_header_length+(0xdf4+5096-0x21db);
user_data_length=(len-user_data_header_length)-(0x963+832-0xca2);}memcpy(
user_data->sm_data,data+pos,user_data_length);user_data->sm_len=user_data_length
;i=(UINT8)user_data->sm_len;}pos+=i;return pos;}wms_status_e_type
wms_ts_decode_deliver(const T_zUfiSms_RawTsData*ptRawTsData,
wms_gw_deliver_s_type*deliver){wms_status_e_type st=WMS_OK_S;uint32 pos=
(0xa67+4989-0x1de4),i;const UINT8*data=ptRawTsData->data;if(ptRawTsData==NULL||
deliver==NULL){printf(
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x64\x65\x6c\x69\x76\x65\x72"
);return WMS_NULL_PTR_S;}else if((data[pos]&(0x1a7f+1674-0x2106))!=
(0x14f+4871-0x1456)){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x74\x70\x64\x75\x20\x74\x79\x70\x65\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x64\x65\x6c\x69\x76\x65\x72"
);return WMS_INVALID_TPDU_TYPE_S;}else{deliver->more=(data[pos]&
(0xbd5+2905-0x172a))?FALSE:TRUE;deliver->status_report_enabled=(data[pos]&
(0x4b+6089-0x17f4))?TRUE:FALSE;deliver->user_data_header_present=(data[pos]&
(0x785+4688-0x1995))?TRUE:FALSE;deliver->reply_path_present=(data[pos]&
(0x649+6443-0x1ef4))?TRUE:FALSE;pos++;i=wms_ts_decode_address(&data[pos],&
deliver->address);if(i==(0x151d+2884-0x2061)){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x70\x61\x72\x61\x6d\x20\x73\x69\x7a\x65\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x64\x65\x6c\x69\x76\x65\x72"
);return WMS_INVALID_PARM_SIZE_S;}pos+=i;deliver->pid=(wms_pid_e_type)data[pos];
pos++;pos+=wms_ts_decode_dcs(data+pos,&deliver->dcs);if(deliver->dcs.
msg_waiting_kind!=WMS_GW_MSG_WAITING_VOICEMAIL){if(deliver->pid==
WMS_PID_RETURN_CALL){deliver->dcs.msg_waiting=WMS_GW_MSG_WAITING_STORE;deliver->
dcs.msg_waiting_active=TRUE;deliver->dcs.msg_waiting_kind=
WMS_GW_MSG_WAITING_VOICEMAIL;}}i=wms_ts_decode_timestamp(data+pos,&deliver->
timestamp);if(i==(0xe47+6033-0x25d8)){printf(
"\x69\x6e\x76\x61\x6c\x69\x64\x20\x70\x61\x72\x61\x6d\x20\x76\x61\x6c\x75\x65\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x64\x65\x6c\x69\x76\x65\x72"
);return WMS_INVALID_PARM_VALUE_S;}pos+=i;pos++;i=wms_ts_decode_gw_user_data(&
deliver->dcs,data[pos-(0x11a+803-0x43c)],data+pos,deliver->
user_data_header_present,&deliver->user_data);if(i>WMS_SMS_UDL_MAX_8_BIT){printf
(
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79\x3a\x20\x55\x44\x4c\x20\x3d\x20\x25\x6c\x75"
,i);st=WMS_INVALID_USER_DATA_SIZE_S;}pos+=i;return st;}}UINT8
wms_ts_decode_gw_validity(const UINT8*data,wms_gw_validity_s_type*validity){
UINT8 i,pos=(0x37f+7406-0x206d);if(data==NULL||validity==NULL){at_print(
LOG_DEBUG,
"\x6e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x67\x77\x5f\x76\x61\x6c\x69\x64\x69\x74\x79"
);return(0x12f9+2454-0x1c8f);}else{switch(validity->format){case
WMS_GW_VALIDITY_NONE:memset(validity,(0xfaf+5412-0x24d3),sizeof(
wms_gw_validity_s_type));break;case WMS_GW_VALIDITY_RELATIVE:
zUfiSms_DecodeRelativeTime(data[pos],&validity->u.time);pos++;break;case
WMS_GW_VALIDITY_ABSOLUTE:i=wms_ts_decode_timestamp(data+pos,&validity->u.time);
pos+=i;break;case WMS_GW_VALIDITY_ENHANCED:break;default:break;}return pos;}}
wms_status_e_type wms_ts_decode_submit(const T_zUfiSms_RawTsData*ptRawTsData,
wms_gw_submit_s_type*submit){wms_status_e_type st=WMS_OK_S;uint32 pos=
(0xff4+4954-0x234e),i;const UINT8*data;if(ptRawTsData==NULL||submit==NULL){
printf(
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x73\x75\x62\x6d\x69\x74\x21"
);return WMS_NULL_PTR_S;}data=ptRawTsData->data;submit->reject_duplicates=(data[
pos]&(0xb2d+3841-0x1a2a))?TRUE:FALSE;submit->validity.format=(
wms_gw_validity_format_e_type)((data[pos]&(0xa07+3419-0x174a))>>
(0x82+3778-0xf41));submit->status_report_enabled=(data[pos]&(0x133f+1288-0x1827)
)?TRUE:FALSE;submit->user_data_header_present=(data[pos]&(0x9c3+7561-0x270c))?
TRUE:FALSE;submit->reply_path_present=(data[pos]&(0x88a+7647-0x25e9))?TRUE:FALSE
;pos++;submit->message_reference=data[pos];pos++;i=wms_ts_decode_address(&data[
pos],&submit->address);if(i==(0x47b+6482-0x1dcd)){return WMS_INVALID_PARM_SIZE_S
;}pos+=i;submit->pid=(wms_pid_e_type)data[pos];pos++;pos+=wms_ts_decode_dcs(data
+pos,&submit->dcs);i=wms_ts_decode_gw_validity(data+pos,&submit->validity);if((
submit->validity.format!=WMS_GW_VALIDITY_NONE)&&(i==(0x1fba+1345-0x24fb))){
return WMS_INVALID_PARM_VALUE_S;}pos+=i;pos++;i=wms_ts_decode_gw_user_data(&
submit->dcs,data[pos-(0x70d+6067-0x1ebf)],data+pos,submit->
user_data_header_present,&submit->user_data);if(i>WMS_SMS_UDL_MAX_8_BIT){printf(
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79\x3a\x20\x55\x44\x4c\x20\x3d\x20\x25\x6c\x75"
,i);st=WMS_INVALID_USER_DATA_SIZE_S;}pos+=i;return st;}wms_status_e_type
wms_ts_decode_status_report(const T_zUfiSms_RawTsData*ptRawTsData,
wms_gw_status_report_s_type*status_report){wms_status_e_type st=WMS_OK_S;uint32
pos=(0x13ec+4268-0x2498),i;const UINT8*data;if(ptRawTsData==NULL||status_report
==NULL){printf(
"\x4e\x75\x6c\x6c\x20\x70\x6f\x69\x6e\x74\x65\x72\x20\x69\x6e\x20\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x5f\x73\x74\x61\x74\x75\x73\x5f\x72\x65\x70\x6f\x72\x74\x21"
);return WMS_NULL_PTR_S;}data=ptRawTsData->data;status_report->more=data[pos]&
(0x1383+3543-0x2156)?FALSE:TRUE;status_report->status_report_qualifier=data[pos]
&(0x54b+1181-0x9c8)?TRUE:FALSE;status_report->user_data_header_present=(data[pos
]&(0x959+2828-0x1425))?TRUE:FALSE;pos++;status_report->message_reference=data[
pos];pos++;i=wms_ts_decode_address(&data[pos],&status_report->address);if(i==
(0x163f+2733-0x20ec)){return WMS_INVALID_PARM_SIZE_S;}pos+=i;i=
wms_ts_decode_timestamp(data+pos,&status_report->timestamp);if(i==
(0x24c6+349-0x2623)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;i=
wms_ts_decode_timestamp(data+pos,&status_report->discharge_time);if(i==
(0x15b9+1868-0x1d05)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;status_report->
tp_status=(wms_tp_status_e_type)data[pos];pos++;status_report->mask=data[pos];
status_report->pid=(wms_pid_e_type)(0xb1+296-0x1d9);status_report->user_data.
sm_len=(0xa53+5303-0x1f0a);status_report->mask&=(0xbc9+5754-0x2144);if((
status_report->mask!=(0x1d5+4633-0x12ef))&&(status_report->mask!=
(0xa1b+2070-0x1231))){pos++;if(status_report->mask&WMS_TPDU_MASK_PID){
status_report->pid=(wms_pid_e_type)data[pos];pos++;}if(status_report->mask&
WMS_TPDU_MASK_DCS){pos+=wms_ts_decode_dcs(data+pos,&status_report->dcs);}if(
status_report->mask&WMS_TPDU_MASK_USER_DATA){pos++;i=wms_ts_decode_gw_user_data(
&status_report->dcs,data[pos-(0x195f+3008-0x251e)],data+pos,status_report->
user_data_header_present,&status_report->user_data);if(i>WMS_SMS_UDL_MAX_8_BIT){
printf(
"\x55\x73\x65\x72\x20\x44\x61\x74\x61\x20\x4c\x65\x6e\x67\x74\x68\x20\x68\x61\x73\x20\x65\x78\x63\x65\x65\x64\x65\x64\x20\x63\x61\x70\x61\x63\x69\x74\x79\x3a\x20\x55\x44\x4c\x20\x3d\x20\x25\x6c\x75"
,i);st=WMS_INVALID_USER_DATA_SIZE_S;}pos+=i;}}else{status_report->mask=
(0x13ff+4099-0x2402);}return st;}wms_status_e_type wms_ts_decode(const
T_zUfiSms_RawTsData*ptRawTsData,T_zUfiSms_ClientTsData*ptClientTsData){
wms_status_e_type st=WMS_OK_S;wms_gw_pp_ts_data_s_type*msg;if(ptRawTsData==NULL
||ptClientTsData==NULL){return WMS_NULL_PTR_S;}msg=&ptClientTsData->u.gw_pp;
switch(ptRawTsData->format){case WMS_FORMAT_CDMA:case WMS_FORMAT_ANALOG_AWISMS:
case WMS_FORMAT_ANALOG_CLI:case WMS_FORMAT_ANALOG_VOICE_MAIL:case
WMS_FORMAT_ANALOG_SMS:case WMS_FORMAT_MWI:at_print(AT_DEBUG,
"\x21\x21\x21\x21\x21\x21\x21\x21\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x20\x45\x72\x72\x6f\x72\x3a\x20\x47\x65\x74\x20\x4f\x6d\x69\x74\x20\x66\x6f\x72\x6d\x61\x74\x21\x21\x21\x20\x46\x6f\x72\x6d\x61\x74\x5b\x25\x64\x5d" "\n"
,ptRawTsData->format);break;case WMS_FORMAT_GW_PP:msg->tpdu_type=ptRawTsData->
tpdu_type;switch(msg->tpdu_type){case WMS_TPDU_DELIVER:st=wms_ts_decode_deliver(
ptRawTsData,&msg->u.deliver);break;case WMS_TPDU_SUBMIT:st=wms_ts_decode_submit(
ptRawTsData,&msg->u.submit);break;case WMS_TPDU_STATUS_REPORT:st=
wms_ts_decode_status_report(ptRawTsData,&msg->u.status_report);break;case
WMS_TPDU_DELIVER_REPORT_ACK:case WMS_TPDU_DELIVER_REPORT_ERROR:case
WMS_TPDU_SUBMIT_REPORT_ACK:case WMS_TPDU_SUBMIT_REPORT_ERROR:case
WMS_TPDU_COMMAND:at_print(AT_DEBUG,
"\x21\x21\x21\x21\x21\x21\x21\x21\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x20\x45\x72\x72\x6f\x72\x3a\x20\x47\x65\x74\x20\x4f\x6d\x69\x74\x20\x62\x72\x61\x6e\x63\x68\x21\x21\x21\x20\x74\x70\x64\x75\x5f\x74\x79\x70\x65\x5b\x25\x64\x5d" "\n"
,msg->tpdu_type);break;default:at_print(LOG_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x54\x50\x44\x55\x20\x74\x79\x70\x65\x20\x25\x64"
,msg->tpdu_type);st=WMS_INVALID_TPDU_TYPE_S;break;}break;case WMS_FORMAT_GW_CB:
at_print(AT_DEBUG,
"\x21\x21\x21\x21\x21\x21\x21\x21\x77\x6d\x73\x5f\x74\x73\x5f\x64\x65\x63\x6f\x64\x65\x20\x45\x72\x72\x6f\x72\x3a\x20\x47\x65\x74\x20\x4f\x6d\x69\x74\x20\x66\x6f\x72\x6d\x61\x74\x21\x21\x21\x20\x46\x6f\x72\x6d\x61\x74\x5b\x25\x64\x5d" "\n"
,ptRawTsData->format);break;default:st=WMS_INVALID_FORMAT_S;at_print(AT_DEBUG,
"\x49\x6e\x76\x61\x6c\x69\x64\x20\x66\x6f\x72\x6d\x61\x74\x3a\x20\x25\x64",
ptRawTsData->format);break;}ptClientTsData->format=ptRawTsData->format;return st
;}