[Feature][T106]ZXW P56U09 code

Only Configure: Yes
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: No
Doc Update: No

Change-Id: I3cbd8b420271eb20c2b40ebe5c78f83059cd42f3
diff --git a/ap/app/zte_comm/sms/inc/sms_code.h b/ap/app/zte_comm/sms/inc/sms_code.h
new file mode 100755
index 0000000..f9fd5da
--- /dev/null
+++ b/ap/app/zte_comm/sms/inc/sms_code.h
@@ -0,0 +1,110 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2013 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : AT_SERVER

+* ÎÄ ¼þ Ãû : sms_code.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : G.F

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2013-09-29

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _SMS_CODE_H_

+#define _SMS_CODE_H_

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"  

+{

+#endif

+#include "sms_db.h"

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+extern int String2Bytes(const char* pSrc, unsigned char* pDst, int nSrcLength);

+extern byte * zUfiSms_SmsiUtilitoaFill(word v, byte *rb_ptr);

+extern void zUfiSms_SprintfTime(char *str_time, int len,int t);

+extern int zUfiSms_FormatDeliverDbdata

+(

+    T_zUfiSms_ClientTsData *ts_data_ptr,

+    T_zUfiSms_DbStoreData *db_data

+);

+

+extern int  zUfiSms_FormatSubmitDbdata

+(

+    T_zUfiSms_ClientTsData *ts_data_ptr,

+    T_zUfiSms_DbStoreData *db_data

+);

+

+wms_status_e_type wms_ts_decode

+(

+    const T_zUfiSms_RawTsData            * ptRawTsData,

+    T_zUfiSms_ClientTsData* ptClientTsData

+);

+extern int zUfiSms_atohex(char c);

+extern int zUfiSms_DispatchWtoi(unsigned char *in_ptr,int iLength,unsigned char *out_ptr);

+extern byte* zUfiSms_SmsiAddrToStr

+(

+    wms_address_s_type addr,  /* Address data structure           */

+    byte * res_ptr,           /* pointer to result buffer         */

+    UINT8 * type_of_addr     /* pointer to type of address field */

+);

+extern int zUfiSms_SplitString(char *input, char ***output,char cMatchChar);

+extern int zUfiSms_CharToInt(char *pCharArray,  int iLen,   unsigned char  *pIntArray);

+extern void zUfiSms_DecodeRelativeTime(UINT8 iValidTime,  T_zUfiSms_TimeStamp  *ptTimeStamp);

+

+extern int EncodePdu_Submit(const SMS_PARAM* pSrc, char* pDst);

+extern  unsigned long zUfiSms_ConvertUcs2ToGsmDefault

+( const unsigned char * def,  unsigned char * gsm_default, unsigned long len);

+

+extern  unsigned long zUfiSms_ConvertUcs2ToPortuguese

+(

+    const unsigned char * def,

+    unsigned char * gsm_default,

+    unsigned long len

+);

+

+extern unsigned long zUfiSms_ConvertUcs2ToSpanish

+(

+    const unsigned char * def,

+    unsigned char * gsm_default,

+    unsigned long len

+);

+

+extern unsigned long zUfiSms_ConvertAsciiToGsmDefault(const unsigned char * inputs,  unsigned char * outputs,   unsigned long len);

+extern boolean zUfiSms_DecodeContent(char *msg_content, UINT16 sms_len, boolean isEsc, char *out_content);

+extern wms_status_e_type wms_ts_encode

+(

+    const T_zUfiSms_ClientTsData         * ptClientTsData,

+    T_zUfiSms_RawTsData                  * ptRawTsData

+);

+

+extern int Bytes2String(const unsigned char* pSrc, char* pDst, int nSrcLength);

+extern SINT32 zUfiSms_EncodePdu_DeliverReport(CHAR* pDst, UINT8 TP_FCS);

+extern int DecodePushPdu(const char* pSrcPdu, SMS_PARAM* pDst);

+

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+

+#ifdef __cplusplus

+} 

+#endif

+

+#endif  /* _SMS_CODE_H_ */

+

diff --git a/ap/app/zte_comm/sms/inc/sms_db.h b/ap/app/zte_comm/sms/inc/sms_db.h
new file mode 100755
index 0000000..7b501fc
--- /dev/null
+++ b/ap/app/zte_comm/sms/inc/sms_db.h
@@ -0,0 +1,132 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2013 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : AT_SERVER

+* ÎÄ ¼þ Ãû : sms_db.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : G.F

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2013-09-29

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+#ifndef _SMS_DB_H_

+#define _SMS_DB_H_

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"  

+{

+#endif

+

+#include "sms_fnc.h"

+#include "sqlite3.h"

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+typedef struct _SMS_MSG_INFO

+{

+	char id[20];

+	char  total_seq[5];

+}SMS_MSG_INFO;

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+extern int zUfiSms_GetStorePosById(char *item,char *item_data,int item_len, int id);

+extern int zUfiSms_IsDbEmpty(const char *tab, int *pCount);

+extern int zUfiSms_SetDbParameters(T_zUfiSms_ParaInfo *para);

+extern int zUfiSms_GetDbParameters(void);

+extern int zUfiSms_GetTotalCount(const char *pDbTable,int *pTotalCount);

+extern int zUfiSms_SetCmdStatus(T_zUfiSms_StatusInfo *ptSetStatus);

+extern int zUfiSms_GetDbCount_Callback(void *fvarg,int line,char **zresult,const char **lname);

+extern int zUfiSms_DeleteNvSms(void);

+extern int zUfiSms_SetMaxReference(int ref);

+extern int zUfiSms_DeleteDraftSms(long iSmsId);

+extern int zUfiSms_UpdateSmsTagInDb(unsigned long id,unsigned int tags);

+extern int zUfiSms_GetConcatMaxReferInDb(void);

+extern int zUfiSms_GetSmsMaxReferInDb(void);

+extern int zUfiSms_CreateAllTable (void);

+extern int zUfiSms_DeleteSmsInDb(void);

+extern int zUfiSms_GetSmsIndex(int id,T_zUfiSms_ModifyTag *ptModifyTag,int is_cc);

+extern int zUfiSms_IsConcatSms(int id);

+extern int zUfiSms_SearchConcatSmsInDb(T_zUfiSms_DbStoreData *ptDbSaveData,char *pMemStore);

+extern int zUfiSms_InsertReportStatusToDb(unsigned char *pNumber,T_zUfiSms_Date *ptSmsDate,int iReportStatus);

+extern int zUfiSms_InsertConcatSmsToDb

+(

+    T_zUfiSms_DbStoreData *db_data,

+    const char *mem_store,

+    char *format_concat,

+    char * content,

+    T_zUfiSms_DbStoreStr *pac,

+    int concat_num

+);

+extern int zUfiSms_UpdateConcatSmsToDb

+(

+    T_zUfiSms_DbStoreData *db_data,

+    const char *mem_store,

+    char *format_concat,

+    char *content,

+    T_zUfiSms_DbStoreStr *pac,

+    int concat_num,

+    long id

+);

+extern int zUfiSms_GetConcatInfo(char *mem_store,long id,T_zUfiSms_DbStoreStr *pac,char *content,int len);

+extern int zUfiSms_UpdateNormalSmsToDb

+(

+    T_zUfiSms_DbStoreData *ptDbSaveData,

+    const char *pStorePos,

+    char *pContent,

+    long iSmsId

+);

+extern int zUfiSms_InsertNormalSmsToDb

+(

+    T_zUfiSms_DbStoreData *ptDbSaveData,

+    const char *pStorePos,

+    char *pContent

+);

+void zUfiSms_FillGlobalTpudUcs2

+(

+	T_zUfiSms_SubmitTpdu *ptSubmit,

+    T_zUfiSms_ConcatInfo *ptConcatSms,

+    T_zUfiSms_DbStoreData *ptDbSaveData

+);

+

+void zUfiSms_FillGlobalTpudGsm7

+(

+    T_zUfiSms_SubmitTpdu *ptSubmit,

+    T_zUfiSms_ConcatInfo *ptConcatSms,

+    T_zUfiSms_DbStoreData *ptDbSaveData

+);

+extern int zUfiSms_SetConcatMaxRefer(int ref);

+

+extern int zUfiSms_GetSmsContent(char *pSmsBuf,int len);

+extern int zUfiSms_GetTagCountInDb(T_zUfiSms_MemoryType mem_store, unsigned int tags,int *pTotalCount);

+extern  time_t zte_getsecond(T_zUfiSms_Date date);

+

+extern int zUfiSms_GetCurrentRecvTotalSeq(T_zUfiSms_DbStoreData *ptDbSaveData, SMS_MSG_INFO *pmsg);

+extern VOID zUfiSms_CheckDbOutdateSms(const char *pDbTable, T_zUfiSms_DelReq *pSmsDel);

+extern int zUfiSms_DropAllTable (void);

+extern int zUfiSms_DropAllTableExceptSms (void);

+extern int zUfiSms_DeleteAllSimSmsInDb(void);

+

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+

+#ifdef __cplusplus

+} 

+#endif

+

+#endif  /* _SMS_DB_H_ */

+

diff --git a/ap/app/zte_comm/sms/inc/sms_fnc.h b/ap/app/zte_comm/sms/inc/sms_fnc.h
new file mode 100755
index 0000000..eeb3623
--- /dev/null
+++ b/ap/app/zte_comm/sms/inc/sms_fnc.h
@@ -0,0 +1,1516 @@
+/**************************************************************************

+*

+*                  Copyright (c) 2013 ZTE Corporation.

+*

+***************************************************************************

+* Ä£ ¿é Ãû : AT_SERVER

+* ÎÄ ¼þ Ãû : sms_fnc.h

+* Ïà¹ØÎļþ : 

+* ʵÏÖ¹¦ÄÜ : 

+* ×÷    Õß : G.F

+* °æ    ±¾ : V1.0

+* Íê³ÉÈÕÆÚ : 2013-09-29

+* ÆäËü˵Ã÷ : 

+**************************************************************************/

+

+/**************************************************************************

+* Ð޸ļǼ

+**************************************************************************/

+/**************************************************************************

+* Ð޸ıàºÅ : й¦ÄÜ

+* ÐÞ ¸Ä ÈË : chenjie10092374

+* ÐÞ¸ÄÈÕÆÚ : 2014.6.24

+* ÐÞ¸ÄÄÚÈÝ : Ìí¼ÓÖ§³Öufi monitor¹¦ÄÜ´¦Àí´úÂë

+**************************************************************************/

+

+

+#ifndef _SMS_FNC_H_

+#define _SMS_FNC_H_

+

+/**************************************************************************

+* #includeÇø

+**************************************************************************/

+#ifdef __cplusplus

+extern "C"  

+{

+#endif

+#include "softap_api.h"

+#include "cfg_nv_def.h"

+

+

+/**************************************************************************

+* ³£Á¿¶¨ÒåÇø

+**************************************************************************/

+//NVÅäÖÃ

+

+

+//Êý¾Ý¿â´æ´¢Î»ÖÃ

+#ifdef _MBB_OS_UCLINUX

+#define ZTE_WMS_DB_PATH "/mnt/jffs2/etc_rw/config/sms_db/sms.db"

+#define ZTE_WMS_DB_DIR   "/mnt/jffs2/etc_rw/config/sms_db"

+#define ZTE_WMS_DB_FLAG   "/mnt/jffs2/etc_rw/config/sms_db/sms_restore.flag"

+#else

+#ifdef WEBS_SECURITY

+#define ZTE_WMS_DB_PATH "/tmp/sms.db"

+#define ZTE_WMS_TMP0_PATH "/etc_rw/sms.tmp0"

+#define ZTE_WMS_TMP1_PATH "/etc_rw/sms.tmp1"

+#define ZTE_WMS_SEC_PATH "/etc_rw/sms.dat"

+#else

+#define ZTE_WMS_DB_PATH "/etc_rw/sms.db"

+#endif

+#define ZTE_WMS_DB_DIR   "/etc_rw/"

+#define ZTE_WMS_DB_FLAG   "/etc_rw/sms_restore.flag"

+#endif

+#define ZTE_WMS_DB_SMS_TABLE "sms"

+#define ZTE_WMS_DB_NV_TABLE "nv"

+#define ZTE_WMS_DB_SIM_TABLE  "sim"

+#define ZTE_WMS_DB_CMD_STATUS_TABLE  "cmd_status"

+#define ZTE_WMS_DB_SMS_REPORT_TABLE  "sms_report"

+#define ZTE_WMS_DB_PARAMETER_TABLE  "parameter"

+#define ZTE_WMS_DB_CELL_BRO_TABLE  "cell_bro"

+#define ZTE_WMS_DB_SEND_CONTENT_TABLE  "send_content"

+

+#define ZTE_WMS_MAX_CONCAT_REF 255

+#define ZTE_WMS_MAX_SMS_REF 255

+

+#define     TBASE_VALUE_MAXLEN                      256  /*max length of cfg value*/

+

+#define ZTE_WMS_NV_MEMORY_FULL   100

+

+#define DCS_ASC 1

+#define DCS_USC 2

+#define DCS_UNKNOW 0

+#define DCS_UNICODE 2

+#define DCS_SPANISH  3

+#define DCS_PORTUGUESE 5

+#define DCS_TURKISH    6

+

+#define DCS_GSM7_SPANISH  3

+#define DCS_GSM7_DEFAULT  4

+#define DCS_GSM7_PORTUGUESE  5

+#define NOT_DEFINE_LANGUAGE  0

+

+

+#define ZTE_WMS_SMS_CONCAT_ELEMNT_LANGUAGE_LEN            (147)  //160-udl(1 byte)-fii(1 byte) - concat_info(5) - LANG_LS(3 byte) - LANG_SS(3 byte)

+

+

+#define ZTE_WMS_TP_SCTS_LEN_MAX                         (50)        /*modified by crw*/

+#define ZTE_WMS_SMS_UD_HEADER_LEN_MAX                (30)

+#define ZTE_WMS_SMS_CONCAT_ELEMNT_MAX                (3)

+#define ZTE_WMS_SMS_CONCAT_ELEMNT_ASC_LEN            (153)

+#define ZTE_WMS_SMS_CONCAT_ELEMNT_UCS_LEN            (67)

+/*TP_VALIDITY_PERIOD*/

+#define ZTE_WMS_SMS_DEFAULT_TP_VALIDITY_PERIOD_GW    (255)

+#define ZTE_WMS_SMS_DEFAULT_TP_VALIDITY_PERIOD_CDMA (244)

+#define ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX     (2 * ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX)

+

+#define ZTE_WMS_SMS_MSG_CHAR_MAX                    (140)

+#define ZTE_WMS_SCA_LEN_MAX                             (32)

+#define WMS_ADDRESS_DIGIT_MAX_V01                       (20)

+

+enum { WMS_GW_ADDRESS_MAX         = 20  };

+enum { WMS_MESSAGE_LIST_MAX     = 255 };

+

+typedef  unsigned long int  uint32;      /* Unsigned 32 bit value */

+typedef  unsigned char     byte; 

+typedef  unsigned short    word;   

+

+#ifndef boolean

+typedef  unsigned char      boolean;     /* Boolean value type. */

+#endif

+

+enum { WMS_UDH_OCTETS_PORT8                =2};

+enum { WMS_UDH_OCTETS_PORT16               =4};

+enum { WMS_UDH_OCTETS_CONCAT8              =3};

+enum { WMS_UDH_OCTETS_SPECIAL_SM           =2};

+enum { WMS_UDH_OCTETS_CONCAT16             =4};

+enum { WMS_UDH_OCTETS_PRE_DEF              =2};

+enum { WMS_UDH_OCTETS_TEXT_FORMATTING      =3};

+enum { WMS_UDH_OCTETS_RFC822               =1};

+/*add by yangpeng, 2011.4.5, begin*/

+enum { WMS_UDH_OCTETS_NAT_LANG_SS      =1};

+enum { WMS_UDH_OCTETS_NAT_LANG_LS      =1};

+/*add by yangpeng, 2011.4.5, end*/

+enum { WMS_UDH_OCTETS_USER_PROMPT          =1};

+enum { WMS_UDH_OCTETS_EO_HEADER            =7};

+enum { WMS_UDH_ANIM_NUM_BITMAPS  = 4 };

+enum { WMS_UDH_LARGE_BITMAP_SIZE = 32 };

+enum { WMS_UDH_SMALL_BITMAP_SIZE = 8 };

+enum { WMS_UDH_LARGE_PIC_SIZE    = 128 };

+enum { WMS_UDH_SMALL_PIC_SIZE    = 32  };

+enum { WMS_UDH_VAR_PIC_SIZE      = 134 };  /* 140 - 1(UDHL) - 5(UDH) */

+

+enum { WMS_SMS_UDL_MAX_7_BIT  = 160 }; /* as in the spec */

+enum { WMS_SMS_UDL_MAX_8_BIT  = 140 }; /* as in the spec */

+

+typedef enum {

+  WMS_MESSAGE_FORMAT_ENUM_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/

+  WMS_MESSAGE_FORMAT_CDMA_V01 = 0x00, 

+  WMS_MESSAGE_FORMAT_GW_PP_V01 = 0x06, 

+  WMS_MESSAGE_FORMAT_GW_BC_V01 = 0x07, 

+  WMS_MESSAGE_FORMAT_MWI_V01 = 0x08, 

+  WMS_MESSAGE_FORMAT_ENUM_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/

+}wms_message_format_enum_v01;

+

+typedef enum

+{

+    MSG_SMS_DEFAULT=0,

+	MSG_SMS_NEW,

+	MSG_SMS_READING,

+	MSG_SMS_MAX,	

+}wms_message_status_info;

+

+

+#if !HAVE_UNISTD_H

+#ifndef F_OK

+#define F_OK	0

+#endif /* !defined F_OK */

+#ifndef R_OK

+#define R_OK	4

+#endif /* !defined R_OK */

+#endif /* !HAVE_UNISTD_H */

+/**************************************************************************

+* Êý¾Ý½á¹¹¶¨ÒåÇø

+**************************************************************************/

+

+typedef enum

+{

+    SMS_STATE_INITING = 0, /*ÕýÔÚ³õʼ»¯*/

+    SMS_STATE_INITED,  /*³õʼ»¯Íê³É*/

+    SMS_STATE_LOADING, /*ÕýÔÚ´ÓSIM¿¨²àload¶ÌÐÅ*/	

+    SMS_STATE_LOADED,  /*loadÍê³É£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+    SMS_STATE_SENDING, /*ÕýÔÚ·¢ËͶÌÐÅ*/

+    SMS_STATE_SENDED,  /*·¢ËÍÍê³É£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+    SMS_STATE_DELING,  /*ÕýÔÚɾ³ý¶ÌÐÅ*/

+    SMS_STATE_DELED,   /*ɾ³ýÍê³É£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+    SMS_STATE_RECVING, /*ÕýÔÚ½ÓÊÕ¶ÌÐÅ*/

+    SMS_STATE_RECVED,  /*½ÓÊÕÍê³É£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+    SMS_STATE_SAVING,  /*ÕýÔÚ±£´æ¶ÌÐÅ*/

+    SMS_STATE_SAVED,  /*±£´æ¶ÌÐÅ£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+    SMS_STATE_DELSAVING,/*ÕýÔÚɾ³ýÒÑ´æ´¢µÄ²Ý¸åÏä¶ÌÐÅ*/

+    SMS_STATE_DELSAVED,	/*ÒÑɾ³ý²Ý¸åÏäµÄ¶ÌÐÅ*/

+	SMS_STATE_SIM_LOADED,  /*SIM²àloadÍê³É£¬ÎÞÂ۳ɹ¦Óë·ñ*/

+	SMS_STATE_SETTING,	/*ÕýÔÚÉèÖöÌÐÅλÖÃ*/

+	SMS_STATE_HAVESET,	/*ÒÑÉèÖöÌÐÅλÖÃ*/

+	SMS_STATE_CONCAT_SENDING	/*¼¶Áª¶ÌÐÅ·¢ËÍÖÐ*/

+}T_zUfiSms_MainState;

+//SMS TYPE

+typedef enum _SMS_PUSH_TYPE

+{

+    SMS_NO_PUSH = 0,   

+    SMS_PUSH,       

+    SMS_NOTIFICATION,      

+    SMS_BOOTSTRAP,         

+}SMS_PUSH_TYPE;

+

+/* TP-Status - ref. 3GPP TS 23.040 section 9.2.3.15

+*/

+typedef enum

+{

+  /* Short message transaction completed:

+  */

+  WMS_TP_STATUS_RECEIVED_OK                   = 0x00,

+  WMS_TP_STATUS_UNABLE_TO_CONFIRM_DELIVERY    = 0x01,

+  WMS_TP_STATUS_REPLACED                      = 0x02,

+  /* reserved: 0x03 - 0x0f */

+  /* specific to each SC: 0x10 - 0x1f */

+

+  /* Temporary error, SC still trying to transfer SM:

+  */

+  WMS_TP_STATUS_TRYING_CONGESTION             = 0x20,

+  WMS_TP_STATUS_TRYING_SME_BUSY               = 0x21,

+  WMS_TP_STATUS_TRYING_NO_RESPONSE_FROM_SME   = 0x22,

+  WMS_TP_STATUS_TRYING_SERVICE_REJECTED       = 0x23,

+  WMS_TP_STATUS_TRYING_QOS_NOT_AVAILABLE      = 0x24,

+  WMS_TP_STATUS_TRYING_SME_ERROR              = 0x25,

+  /* reserved: 0x26 - 0x2f */

+  /* specific to each SC: 0x30 - 0x3f */

+

+  /* Permanent error, SC is not making any more attempts:

+  */

+  WMS_TP_STATUS_PERM_REMOTE_PROCEDURE_ERROR   = 0x40,

+  WMS_TP_STATUS_PERM_INCOMPATIBLE_DEST        = 0x41,

+  WMS_TP_STATUS_PERM_REJECTED_BY_SME          = 0x42,

+  WMS_TP_STATUS_PERM_NOT_OBTAINABLE           = 0x43,

+  WMS_TP_STATUS_PERM_QOS_NOT_AVAILABLE        = 0x44,

+  WMS_TP_STATUS_PERM_NO_INTERWORKING          = 0x45,

+  WMS_TP_STATUS_PERM_VP_EXPIRED               = 0x46,

+  WMS_TP_STATUS_PERM_DELETED_BY_ORIG_SME      = 0x47,

+  WMS_TP_STATUS_PERM_DELETED_BY_SC_ADMIN      = 0x48,

+  WMS_TP_STATUS_PERM_SM_NO_EXISTING           = 0x49,

+  /* reserved: 0x4a - 0x4f */

+  /* specific to each SC: 0x50 - 0x5f */

+

+  /* Temporary error, SC is not making any more attempts:

+  */

+  WMS_TP_STATUS_TEMP_CONGESTION               = 0x60,

+  WMS_TP_STATUS_TEMP_SME_BUSY                 = 0x61,

+  WMS_TP_STATUS_TEMP_NO_RESPONSE_FROM_SME     = 0x62,

+  WMS_TP_STATUS_TEMP_SERVICE_REJECTED         = 0x63,

+  WMS_TP_STATUS_TEMP_QOS_NOT_AVAILABLE        = 0x64,

+  WMS_TP_STATUS_TEMP_SME_ERROR                = 0x65,

+  /* reserved: 0x66 - 0x6f */

+  /* specific to each SC: 0x70 - 0x7f */

+

+  /* reserved: 0x80 - 0xff */

+

+  WMS_TP_STATUS_LAST = 0xFF,

+  WMS_TP_STATUS_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_tp_status_e_type;

+

+

+/*¶ÌÐÅ´æ·ÅµÄλÖÃ*/

+typedef enum _SMS_LOCATION

+{

+    SMS_LOCATION_SIM = 0,            //¿¨²à

+    SMS_LOCATION_ME,            //É豸²à

+    SMS_LOCATION_PC,            //PC²à

+    SMS_LOCATION_SR

+}   SMS_LOCATION;

+

+typedef enum {

+  WMS_STORAGE_TYPE_ENUM_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/

+  WMS_STORAGE_TYPE_UIM_V01 = 0x00, 

+  WMS_STORAGE_TYPE_NV_V01 = 0x01, 

+  WMS_STORAGE_TYPE_NONE_V01 = -1, 

+  WMS_STORAGE_TYPE_ENUM_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/

+}wms_storage_type_enum_v01,zUfiSms_StoreType;

+

+/*memory storage */

+typedef enum

+{

+    ZTE_WMS_DB_OK = 0,

+    ZTE_SMS_DB_ERROR_INVAILD_PTR = 100,

+    ZTE_SMS_DB_ERROR_NOT_OPEN_DB,

+    ZTE_SMS_DB_ERROR_FULL,

+    ZTE_SMS_DB_ERROR = -1

+} T_zUfiSms_DbResult;

+

+typedef enum

+{

+    ZTE_WMS_MEMORY_SIM=0,

+    ZTE_WMS_MEMORY_NV,

+    ZTE_WMS_MEMORY_MAX

+}T_zUfiSms_MemoryType;

+

+

+

+/* ¶ÌϢģʽ:

+** determines which system mode is used for a message

+*/

+typedef enum

+{

+  WMS_MESSAGE_MODE_CDMA = 0,

+  WMS_MESSAGE_MODE_GW,

+  WMS_MESSAGE_MODE_MAX,

+  WMS_MESSAGE_MODE_MAX32 = 0x100000

+} wms_message_mode_e_type;

+

+// ¿¨ÖеÄÏûϢ״̬

+typedef enum

+{

+  WMS_TAG_NONE        = 0x00,  //³õʼֵ

+  WMS_TAG_MT_READ     = 0x01,

+  WMS_TAG_MT_NOT_READ = 0x03,

+  WMS_TAG_MO_SENT     = 0x05, /* No status report requested */

+  WMS_TAG_MO_NOT_SENT = 0x07,

+

+  /* GSM/WCDMA only */

+  WMS_TAG_MO_SENT_ST_NOT_RECEIVED = 0x0D,

+  WMS_TAG_MO_SENT_ST_NOT_STORED   = 0x15,

+  WMS_TAG_MO_SENT_ST_STORED       = 0x35,

+

+  WMS_TAG_MO_TEMPLATE = 0x100, /* SMS parameters */

+  WMS_TAG_STATUS_RPT  = 0x200  /* SMSR parameters*/

+} T_zUfiSms_SmsTag;

+

+//´æ´¢ÀàÐÍ

+typedef enum

+{

+  WMS_MEMORY_STORE_NONE = 0,//ÉÐδָ¶¨´æ´¢ÀàÐÍ

+

+  /* GSM/WCDMA memory stores

+  */

+  WMS_MEMORY_STORE_RAM_GW,

+  WMS_MEMORY_STORE_SIM,

+  WMS_MEMORY_STORE_NV_GW,

+

+  /* CDMA memory stores

+  */

+  WMS_MEMORY_STORE_RAM_CDMA,  /* NOT SUPPORTED */

+  WMS_MEMORY_STORE_RUIM,

+  WMS_MEMORY_STORE_NV_CDMA,

+

+  WMS_MEMORY_STORE_MAX,

+  WMS_MEMORY_STORE_MAX32  = 0x10000000

+} wms_memory_store_e_type;

+

+/* Message index:

+** The message index in a message list

+*/

+typedef uint32  wms_message_index_type;

+

+/* Header

+*/

+typedef struct wms_client_msg_hdr_s

+{

+	wms_message_mode_e_type   message_mode;

+	T_zUfiSms_SmsTag    tag;

+    wms_memory_store_e_type   mem_store;

+	wms_message_index_type    index; //¶ÌÐÅË÷Òý£¬set to WMS_DUMMY_MESSAGE_INDEX when mem_store==WMS_MEMORY_STORE_NONE

+} wms_client_msg_hdr_s_type;

+

+

+typedef enum

+{

+  WMS_NUMBER_MODE_NONE_DATA_NETWORK      = 0,

+  WMS_NUMBER_MODE_DATA_NETWORK           = 1,

+  WMS_NUMBER_MODE_DATA_NETWORK_MAX32     = 0x10000000

+

+} wms_number_mode_e_type;

+

+typedef enum

+{

+  WMS_DIGIT_MODE_4_BIT     = 0,  /* DTMF digits */

+  WMS_DIGIT_MODE_8_BIT     = 1,

+  WMS_DIGIT_MODE_MAX32     = 0x10000000

+

+} wms_digit_mode_e_type;

+

+typedef enum

+{

+  WMS_NUMBER_UNKNOWN        = 0,

+

+  WMS_NUMBER_INTERNATIONAL  = 1,

+  WMS_NUMBER_NATIONAL       = 2,

+  WMS_NUMBER_NETWORK        = 3,

+  WMS_NUMBER_SUBSCRIBER     = 4,

+  WMS_NUMBER_ALPHANUMERIC   = 5, /* GSM SMS: addr value is GSM 7-bit chars */

+  WMS_NUMBER_ABBREVIATED    = 6,

+  WMS_NUMBER_RESERVED_7     = 7,

+

+  /* The above are used when number mode is not data network address.

+     The following are used only when number mode is data network address

+     mode.

+  */

+  WMS_NUMBER_DATA_IP        = 1

+

+  , WMS_NUMBER_INTERNET_EMAIL = 2

+    /* In the address data "digits", each UINT8 contains an ASCII character.

+    ** Examples are "x@y.com,a@b.com" - ref TIA/EIA-637A 3.4.3.3.

+    */

+

+  , WMS_NUMBER_MAX32        = 0x10000000

+

+} wms_number_type_e_type;

+

+typedef enum

+{

+  WMS_NUMBER_PLAN_UNKNOWN     = 0,

+  WMS_NUMBER_PLAN_TELEPHONY   = 1,  /* CCITT E.164 and E.163,

+                                       including ISDN plan */

+  WMS_NUMBER_PLAN_RESERVED_2  = 2,

+  WMS_NUMBER_PLAN_DATA        = 3,  /* CCITT X.121 */

+  WMS_NUMBER_PLAN_TELEX       = 4,  /* CCITT F.69 */

+  WMS_NUMBER_PLAN_RESERVED_5  = 5,

+  WMS_NUMBER_PLAN_RESERVED_6  = 6,

+  WMS_NUMBER_PLAN_RESERVED_7  = 7,

+  WMS_NUMBER_PLAN_RESERVED_8  = 8,

+  WMS_NUMBER_PLAN_PRIVATE     = 9,

+  WMS_NUMBER_PLAN_RESERVED_10 = 10,

+  WMS_NUMBER_PLAN_RESERVED_11 = 11,

+  WMS_NUMBER_PLAN_RESERVED_12 = 12,

+  WMS_NUMBER_PLAN_RESERVED_13 = 13,

+  WMS_NUMBER_PLAN_RESERVED_14 = 14,

+  WMS_NUMBER_PLAN_RESERVED_15 = 15,

+  WMS_NUMBER_PLAN_MAX32       = 0x10000000

+

+} wms_number_plan_e_type;

+

+enum { WMS_ADDRESS_MAX            = 48  };

+

+typedef struct wms_address_s

+{

+  wms_digit_mode_e_type          digit_mode;

+    /* Indicates 4-bit or 8-bit

+    */

+

+  wms_number_mode_e_type         number_mode;

+    /* Used in CDMA only: only meaningful when digit_mode is 8-bit

+    */

+

+  wms_number_type_e_type         number_type;

+    /* In case of CDMA address, this is used only when digit_mode is 8-bit.

+    ** To specify an international address for CDMA, use the following:

+    **   digit_mode  = 8-bit

+    **   number_mode = NONE_DATA_NETWORK

+    **   number_type = INTERNATIONAL

+    **   number_plan = TELEPHONY

+    **   number_of_digits = number of digits

+    **   digits = ASCII digits, e.g. '1', '2', '3', '4' and '5'.

+    */

+

+  wms_number_plan_e_type         number_plan;

+    /* In case of CDMA address, this is used only when digit_mode is 8-bit.

+    */

+

+  UINT8                          number_of_digits;

+

+  UINT8                          digits[WMS_ADDRESS_MAX];

+    /* Each UINT8 in this array represents a 4-bit or 8-bit digit of

+    ** address data.

+    */

+

+} wms_address_s_type;

+

+/* TS data formats

+*/

+typedef enum

+{

+  WMS_FORMAT_CDMA         = 0,  /* IS-95 */

+  WMS_FORMAT_ANALOG_CLI,        /* IS-91 */

+  WMS_FORMAT_ANALOG_VOICE_MAIL, /* IS-91 */

+  WMS_FORMAT_ANALOG_SMS,        /* IS-91 */

+  WMS_FORMAT_ANALOG_AWISMS,     /* IS-95 Alert With Information SMS */

+  WMS_FORMAT_MWI,               /* Message Waiting Indication as voice mail */

+  WMS_FORMAT_GW_PP,             /* GW Point-to-Point SMS */

+  WMS_FORMAT_GW_CB,             /* GW CB SMS */

+  WMS_FORMAT_MAX,

+  WMS_FORMAT_MAX32        = 0x10000000

+

+} wms_format_e_type;

+

+/*  TP-Message-Type-Indicator£¬±íʾpduÖеÄÄÚÈÝ£¬ÊǶÌÐÅ£¬ÊÇ״̬±¨¸æ */

+typedef enum

+{

+  WMS_TPDU_DELIVER = 0,

+  WMS_TPDU_DELIVER_REPORT_ACK,

+  WMS_TPDU_DELIVER_REPORT_ERROR,

+  WMS_TPDU_SUBMIT,

+  WMS_TPDU_SUBMIT_REPORT_ACK,

+  WMS_TPDU_SUBMIT_REPORT_ERROR,

+  WMS_TPDU_STATUS_REPORT,

+  WMS_TPDU_COMMAND,

+  WMS_TPDU_MAX,

+  WMS_TPDU_NONE,

+  WMS_TPDU_MAX32 = 0x10000000

+} wms_gw_tpdu_type_e_type,T_zUfiSms_TpduType;

+

+enum { WMS_MAX_LEN                = 255 };

+

+/* Over-the-air raw TS data structure

+*/

+typedef struct wms_raw_ts_data_s

+{

+  wms_format_e_type           format;

+  wms_gw_tpdu_type_e_type     tpdu_type;

+    /* only meaningful if format is GSM/WCDMA messages */

+  int                      len;

+  UINT8                       data[WMS_MAX_LEN];

+} T_zUfiSms_RawTsData;

+/* GW message

+*/

+typedef struct wms_gw_message_s

+{

+	UINT8                       is_broadcast;

+	wms_address_s_type            sc_address;

+	T_zUfiSms_RawTsData        raw_ts_data;

+} wms_gw_message_s_type;

+/* Information about a message of all types: MT, MO, regular message,

+** report, template, CB message, etc.

+*/

+typedef struct wms_client_message_s

+{

+	wms_client_msg_hdr_s_type     msg_hdr; //ÆäÖÐÓÉmessage_modeºÍtagÈ·¶¨ÁËʹÓÃÄĸöunion³ÉÔ±

+

+	union wms_client_message_u

+	{

+	    wms_gw_message_s_type        gw_message;

+	} u;

+} wms_client_message_s_type,T_zUfiSms_ClientMsg;

+

+typedef struct

+{

+    char IndStr[256];  //¶ÌÐŵĴ洢Ë÷ÒýºÅ, ¶ÔÓ¦Êý¾Ý¿âÖеÄInd "0;1"

+    char Seg_Seq[256];    //¶ÌÐŷֶεÄË÷ÒýºÅ£¬¶ÔÓ¦Cc_Seq "1;2"

+    char FormatInd[256];

+    char FormatSeq[256];

+}T_zUfiSms_DbStoreStr;

+

+/* ¶ÌÐÅÔÚÊý¾Ý¿âÖеĴ洢½á¹¹ */

+typedef struct

+{

+    unsigned long ID;

+    unsigned long  mem_store;

+    unsigned short index;        /*index stored*/

+    unsigned short mode;        /*network mode*/

+    unsigned short tag;  //·¢¼þ»¹ÊDzݸå

+

+    unsigned char number[ZTE_WMS_ADDRESS_LEN_MAX + 1];

+    unsigned char tp_scts[ZTE_WMS_TP_SCTS_LEN_MAX + 1];

+    T_zUfiSms_Date julian_date;

+    unsigned char date[50];

+

+    unsigned short tp_udhi;

+    unsigned char ud_header[ZTE_WMS_SMS_UD_HEADER_LEN_MAX + 1];

+    unsigned short concat_sms;

+    unsigned short  concat_info[ZTE_WMS_SMS_CONCAT_ELEMNT_MAX]; //µ±Ç°¶ÎºÅºÍ×ܶκÅ

+

+    unsigned long RESERVED1;

+    unsigned long RESERVED2;

+    unsigned long RESERVED3;

+

+    unsigned char alphabet;

+    

+    unsigned short tp_dcs;    /*1-->ASCII, 2-->UNICODE, 3-->GSM7 DEFAULT, 4-->GSM7 SPANISH, 5-->GSM7 PORTUGUESE*/

+    unsigned short tp_pid;    /*0-->default*/

+    int msg_ref;    /*message reference , only for submit TPDU */

+    unsigned short submit_status;

+    unsigned short sms_report;

+

+    unsigned char call_back[ZTE_WMS_ADDRESS_LEN_MAX + 1];

+    unsigned short priority_indicator;

+    unsigned short privacy_indicator;

+    unsigned short reply_option;

+    unsigned short alert_delivery;

+    unsigned short msg_displaymode;

+    unsigned short sms_class;//added by tianfuling 20130301 for sms class

+

+    unsigned char sms_content[ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX * ZTE_WMS_CONCAT_SMS_COUNT_MAX + 1];

+    unsigned char raw_data_string[ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX + 1];

+    /*hex string , not hex format*/

+    unsigned short raw_data_strlen;

+    unsigned char draft_group_id[32];

+} zte_wms_db_sms_data_s_type,T_zUfiSms_DbStoreData;

+

+typedef uint32  wms_message_number_type;

+

+typedef enum

+{

+  /* values from 0x00 to 0x1f are for SM-AL protocols:

+  */

+  WMS_PID_DEFAULT           = 0x00,  /* default value to use */

+

+  /* values from 0x20 to 0x3f are for telematic interworking:

+  */

+  WMS_PID_IMPLICIT          = 0x20,

+  WMS_PID_TELEX             = 0x21,

+  WMS_PID_G3_FAX            = 0x22,

+  WMS_PID_G4_FAX            = 0x23,

+  WMS_PID_VOICE_PHONE       = 0x24,

+  WMS_PID_ERMES             = 0x25,

+  WMS_PID_NAT_PAGING        = 0x26,

+  WMS_PID_VIDEOTEX          = 0x27,

+  WMS_PID_TELETEX_UNSPEC    = 0x28,

+  WMS_PID_TELETEX_PSPDN     = 0x29,

+  WMS_PID_TELETEX_CSPDN     = 0x2a,

+  WMS_PID_TELETEX_PSTN      = 0x2b,

+  WMS_PID_TELETEX_ISDN      = 0x2c,

+  WMS_PID_UCI               = 0x2d,

+  WMS_PID_RESERVED_0x2e     = 0x2e,

+  WMS_PID_RESERVED_0x2f     = 0x2f,

+  WMS_PID_MSG_HANDLING      = 0x30,

+  WMS_PID_X400              = 0x31,

+  WMS_PID_INTERNET_EMAIL    = 0x32,

+  WMS_PID_RESERVED_0x33     = 0x33,

+  WMS_PID_RESERVED_0x34     = 0x34,

+  WMS_PID_RESERVED_0x35     = 0x35,

+  WMS_PID_RESERVED_0x36     = 0x36,

+  WMS_PID_RESERVED_0x37     = 0x37,

+  WMS_PID_SC_SPECIFIC_1     = 0x38,

+  WMS_PID_SC_SPECIFIC_2     = 0x39,

+  WMS_PID_SC_SPECIFIC_3     = 0x3a,

+  WMS_PID_SC_SPECIFIC_4     = 0x3b,

+  WMS_PID_SC_SPECIFIC_5     = 0x3c,

+  WMS_PID_SC_SPECIFIC_6     = 0x3d,

+  WMS_PID_SC_SPECIFIC_7     = 0x3e,

+  WMS_PID_GSM_UMTS          = 0x3f,

+

+  /* values from 0x40 to 0x7f: */

+  WMS_PID_SM_TYPE_0         = 0x40,

+  WMS_PID_REPLACE_SM_1      = 0x41,

+  WMS_PID_REPLACE_SM_2      = 0x42,

+  WMS_PID_REPLACE_SM_3      = 0x43,

+  WMS_PID_REPLACE_SM_4      = 0x44,

+  WMS_PID_REPLACE_SM_5      = 0x45,

+  WMS_PID_REPLACE_SM_6      = 0x46,

+  WMS_PID_REPLACE_SM_7      = 0x47,

+  /* ... values reserved not listed ... */

+  WMS_PID_EMS               = 0x5e,

+  WMS_PID_RETURN_CALL       = 0x5f,

+  /* ... values reserved not listed ... */

+  WMS_PID_ANSI136_R_DATA    = 0x7c,

+  WMS_PID_ME_DATA_DOWNLOAD  = 0x7d,

+  WMS_PID_ME_DEPERSONALIZE  = 0x7e,

+  WMS_PID_SIM_DATA_DOWNLOAD = 0x7f,

+  WMS_PID_E_MAX32 = 0x10000000   /* pas to 32 bit int */

+

+  /* values from 0x80 to 0xbf are reserved */

+

+  /* values from 0xc0 to 0xff are for SC specific use */

+

+} wms_pid_e_type;

+

+/* Message class:

+** The message class in the Data Coding Scheme of a TPDU or CB message

+*/

+typedef enum

+{

+  /* the following are GW message classes

+  */

+  WMS_MESSAGE_CLASS_0 = 0,

+  WMS_MESSAGE_CLASS_1,

+  WMS_MESSAGE_CLASS_2,

+  WMS_MESSAGE_CLASS_3,

+  WMS_MESSAGE_CLASS_NONE,

+

+  /* The following class is for CDMA only

+  */

+  WMS_MESSAGE_CLASS_CDMA,

+

+  WMS_MESSAGE_CLASS_MAX,

+  WMS_MESSAGE_CLASS_MAX32 = 0x10000000

+} wms_message_class_e_type;

+

+/* GW Alphabet sets

+*/

+typedef enum

+{

+  WMS_GW_ALPHABET_7_BIT_DEFAULT,

+  WMS_GW_ALPHABET_8_BIT,

+  WMS_GW_ALPHABET_UCS2,

+  WMS_GW_ALPHABET_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_gw_alphabet_e_type;

+

+typedef enum

+{

+  WMS_GW_MSG_WAITING_NONE,

+  WMS_GW_MSG_WAITING_DISCARD,

+  WMS_GW_MSG_WAITING_STORE,

+  WMS_GW_MSG_WAITING_NONE_1111,

+  WMS_GW_MSG_WAITING_MAX32 = 0x10000000 /* pas to 32 bit int */

+} wms_gw_msg_waiting_e_type;

+

+/* GW message waiting types

+*/

+typedef enum

+{

+  WMS_GW_MSG_WAITING_VOICEMAIL,

+  WMS_GW_MSG_WAITING_FAX,

+  WMS_GW_MSG_WAITING_EMAIL,

+  WMS_GW_MSG_WAITING_OTHER,

+  WMS_GW_MSG_WAITING_KIND_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_gw_msg_waiting_kind_e_type;

+

+/* GW Data Coding Scheme

+*/

+typedef struct wms_gw_dcs_s

+{

+  wms_message_class_e_type          msg_class;

+  UINT8                           is_compressed;

+  wms_gw_alphabet_e_type            alphabet;

+  wms_gw_msg_waiting_e_type         msg_waiting;

+  UINT8                           msg_waiting_active;

+  wms_gw_msg_waiting_kind_e_type    msg_waiting_kind;

+  /* Raw DCS Byte */

+  UINT8                             raw_dcs_data;

+} wms_gw_dcs_s_type;

+

+/* GW Validity Formats

+*/

+typedef enum

+{

+  WMS_GW_VALIDITY_NONE = 0,

+  WMS_GW_VALIDITY_RELATIVE = 2,

+  WMS_GW_VALIDITY_ABSOLUTE = 3,

+  WMS_GW_VALIDITY_ENHANCED = 1,

+  WMS_GW_VALIDITY_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_gw_validity_format_e_type;

+

+typedef  signed char       sint7;        /* Signed 8  bit value */

+

+typedef struct

+{

+  /* If 'year' is between 96 and 99, the actual year is 1900 + 'year';

+     if 'year' is between 00 and 95, the actual year is 2000 + 'year'.

+     NOTE: Each field has two BCD digits and UINT8 arrangement is <MSB, ... ,LSB>

+  */

+  UINT8      year;        /* 0x00-0x99 */

+  UINT8      month;       /* 0x01-0x12 */

+  UINT8      day;         /* 0x01-0x31 */

+  UINT8      hour;        /* 0x00-0x23 */

+  UINT8      minute;      /* 0x00-0x59 */

+  UINT8      second;      /* 0x00-0x59 */

+  sint7      timezone;    /* +/-, [-48,+48] number of 15 minutes - GW only */

+} wms_timestamp_s_type, T_zUfiSms_TimeStamp;

+

+/* GW Validity info

+*/

+typedef struct wms_gw_validity_s

+{

+  wms_gw_validity_format_e_type  format;

+  union wms_gw_validity_u

+  {

+    wms_timestamp_s_type    time;

+  } u;

+  /*~ FIELD wms_gw_validity_s.u DISC _OBJ_.format */

+} wms_gw_validity_s_type;

+

+enum { WMS_MAX_UD_HEADERS       = 7};

+

+// ×Ö·û±àÂëÀàÐÍ

+typedef enum _CODE_TYPE

+{

+    CODE_GSM7           = 0,                        // 7λASCII

+    CODE_GSM8           = 4,                        // 8λASCII

+    CODE_UCS2           = 8                         // UNICODE2

+}CODE_TYPE;

+

+/* SMS User Data Header IDs

+*/

+typedef enum

+{

+  WMS_UDH_CONCAT_8         = 0x00,

+  WMS_UDH_SPECIAL_SM,

+  /* 02 - 03    Reserved */

+  WMS_UDH_PORT_8           = 0x04,

+  WMS_UDH_PORT_16,

+  WMS_UDH_SMSC_CONTROL,

+  WMS_UDH_SOURCE,

+  WMS_UDH_CONCAT_16,

+  WMS_UDH_WCMP,

+  WMS_UDH_TEXT_FORMATING,

+  WMS_UDH_PRE_DEF_SOUND,

+  WMS_UDH_USER_DEF_SOUND,

+  WMS_UDH_PRE_DEF_ANIM,

+  WMS_UDH_LARGE_ANIM,

+  WMS_UDH_SMALL_ANIM,

+  WMS_UDH_LARGE_PICTURE,

+  WMS_UDH_SMALL_PICTURE,

+  WMS_UDH_VAR_PICTURE,

+

+  WMS_UDH_USER_PROMPT      = 0x13,

+  WMS_UDH_EXTENDED_OBJECT  = 0x14,

+

+  /* 15 - 1F    Reserved for future EMS */

+

+  WMS_UDH_RFC822           = 0x20,

+

+  WMS_UDH_NAT_LANG_SS      = 0x24,

+  WMS_UDH_NAT_LANG_LS      = 0x25,

+

+  /*  21 - 23, 26 - 6F    Reserved for future use */

+  /*  70 - 7f    Reserved for (U)SIM Toolkit Security Headers */

+  /*  80 - 9F    SME to SME specific use */

+  /*  A0 - BF    Reserved for future use */

+  /*  C0 - DF    SC specific use */

+  /*  E0 - FF    Reserved for future use */

+

+  WMS_UDH_OTHER            = 0xFFFF, /* For unsupported or proprietary headers */

+  WMS_UDH_ID_MAX32 = 0x10000000   /* pas to 32 bit int */

+

+} wms_udh_id_e_type;

+

+

+typedef struct wms_udh_concat_8_s

+{

+  UINT8       msg_ref;

+  /*indicates the reference number for a particular concatenated short message. */

+  /*it is constant for every short message which makes up a particular concatenated short message*/

+  UINT8       total_sm;

+  /*indicates the total number of short messages within the concatenated short message.

+   The value shall start at 1 and remain constant for every short message which makes up the concatenated short message.

+   if it is 0 then the receiving entity shall ignore the whole Information Element*/

+   UINT8      seq_num;

+   /*it indicates the sequence number of a particular short message within the concatenated short */

+   /* message. The value shall start at 1 and increment by one for every short message sent within the concatenated short message. If the value is zero or the value is greater than the value in octet 2 then the receiving entity shall ignore the whole Information Element.*/

+

+} wms_udh_concat_8_s_type,T_zUfiSms_UdhConcat8;

+

+typedef struct wms_udh_concat_16_s

+{

+  UINT16      msg_ref;

+  UINT8       total_sm;

+  UINT8       seq_num;

+

+} wms_udh_concat_16_s_type,T_zUfiSms_UdhConcat16;

+

+

+/* ------------------------------------- */

+/* National Language Related Definitions */

+/* ------------------------------------- */

+

+typedef enum

+{

+  WMS_UDH_NAT_LANG_TURKISH          = 0x1,

+  WMS_UDH_NAT_LANG_SPANISH          = 0x2,

+  WMS_UDH_NAT_LANG_PORTUGUESE       = 0x3,

+  /* 0x0    Reserved */

+  /* 0x4 - 0xFF Reserved */

+  WMS_UDH_NAT_LANG_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_udh_nat_lang_id_e_type;

+

+typedef struct wms_udh_nat_lang_ss_s

+{

+  wms_udh_nat_lang_id_e_type nat_lang_id;

+} wms_udh_nat_lang_ss_s_type;

+

+typedef enum

+{

+  WMS_UDH_LEFT_ALIGNMENT = 0,

+  WMS_UDH_CENTER_ALIGNMENT,

+  WMS_UDH_RIGHT_ALIGNMENT,

+  WMS_UDH_DEFAULT_ALIGNMENT,

+  WMS_UDH_MAX_ALIGNMENT,

+  WMS_UDH_ALIGNMENT_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_udh_alignment_e_type;

+

+typedef enum

+{

+  WMS_UDH_FONT_NORMAL = 0,

+  WMS_UDH_FONT_LARGE,

+  WMS_UDH_FONT_SMALL,

+  WMS_UDH_FONT_RESERVED,

+  WMS_UDH_FONT_MAX,

+  WMS_UDH_FONT_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_udh_font_size_e_type;

+

+typedef enum

+{

+  WMS_UDH_TEXT_COLOR_BLACK          = 0x0,

+  WMS_UDH_TEXT_COLOR_DARK_GREY      = 0x1,

+  WMS_UDH_TEXT_COLOR_DARK_RED       = 0x2,

+  WMS_UDH_TEXT_COLOR_DARK_YELLOW    = 0x3,

+  WMS_UDH_TEXT_COLOR_DARK_GREEN     = 0x4,

+  WMS_UDH_TEXT_COLOR_DARK_CYAN      = 0x5,

+  WMS_UDH_TEXT_COLOR_DARK_BLUE      = 0x6,

+  WMS_UDH_TEXT_COLOR_DARK_MAGENTA   = 0x7,

+  WMS_UDH_TEXT_COLOR_GREY           = 0x8,

+  WMS_UDH_TEXT_COLOR_WHITE          = 0x9,

+  WMS_UDH_TEXT_COLOR_BRIGHT_RED     = 0xA,

+  WMS_UDH_TEXT_COLOR_BRIGHT_YELLOW  = 0xB,

+  WMS_UDH_TEXT_COLOR_BRIGHT_GREEN   = 0xC,

+  WMS_UDH_TEXT_COLOR_BRIGHT_CYAN    = 0xD,

+  WMS_UDH_TEXT_COLOR_BRIGHT_BLUE    = 0xE,

+  WMS_UDH_TEXT_COLOR_BRIGHT_MAGENTA = 0xF,

+  WMS_UDH_TEXT_COLOR_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_udh_text_color_e_type;

+

+typedef struct wms_udh_text_formating_s

+{

+  UINT8                     start_position;

+  UINT8                     text_formatting_length;

+  wms_udh_alignment_e_type  alignment_type ;       /*bit 0 and  bit 1*/

+  wms_udh_font_size_e_type  font_size ;            /*bit 3 and  bit 2*/

+  UINT8                   style_bold;            /*bit 4 */

+  UINT8                   style_italic;          /*bit 5  */

+  UINT8                   style_underlined;      /*bit 6 */

+  UINT8                   style_strikethrough;   /*bit 7 */

+

+  UINT8                   is_color_present;

+    /* if FALSE, ignore the following color information */

+  wms_udh_text_color_e_type text_color_foreground;

+  wms_udh_text_color_e_type text_color_background;

+

+} wms_udh_text_formating_s_type;

+

+enum { WMS_UDH_OTHER_SIZE        = 226 };

+typedef struct wms_udh_other_s

+{

+   wms_udh_id_e_type  header_id;

+   UINT8               header_length;

+   UINT8              data[WMS_UDH_OTHER_SIZE];

+} wms_udh_other_s_type;

+

+#define WMS_UDH_EO_DATA_SEGMENT_MAX    131 /* 140 - 3 - 6 */

+typedef struct wms_udh_eo_content_s

+{

+  UINT8         length;

+

+  UINT8         data[WMS_UDH_EO_DATA_SEGMENT_MAX];

+    /* WMS_UDH_EO_VCARD: See http://www.imc.org/pdi/vcard-21.doc for payload */

+    /* WMS_UDH_EO_VCALENDAR: See http://www.imc.org/pdi/vcal-10.doc */

+    /* Or: Unsupported/proprietary extended objects */

+

+} wms_udh_eo_content_s_type;

+

+/* Extended Object IDs/types

+*/

+typedef enum

+{

+  WMS_UDH_EO_VCARD                   = 0x09,

+  WMS_UDH_EO_VCALENDAR               = 0x0A,

+  WMS_UDH_EO_MAX32 = 0x10000000   /* pas to 32 bit int */

+} wms_udh_eo_id_e_type;

+/* Extended Object UDH

+*/

+typedef struct wms_udh_eo_s

+{

+  /* Extended objects are to be used together with 16-bit concatenation

+  ** UDH. The max number of segments supported for E.O. is 8 at least.

+  */

+  wms_udh_eo_content_s_type    content;

+

+  UINT8                                 first_segment;

+    /* The following fields are only present in the first segment of a

+    ** concatenated SMS message.

+    */

+  UINT8                                   reference;

+    /* Identify those extended object segments which should be linked together

+    */

+  UINT16                                  length;

+    /* Length of the whole extended object data

+    */

+  UINT8                                   control;

+  wms_udh_eo_id_e_type                    type;

+  UINT16                                  position;

+    /* Absolute position of the E.O. in the whole text after concatenation,

+    ** starting from 1.

+    */

+} wms_udh_eo_s_type;

+

+/* Variable length picture

+*/

+typedef struct wms_udh_var_picture_s

+{

+  UINT8       position;

+  UINT8       width;    /* Number of pixels - Should be a mutliple of 8 */

+  UINT8       height;

+  UINT8       data[WMS_UDH_VAR_PIC_SIZE];

+} wms_udh_var_picture_s_type;

+

+enum { WMS_UDH_MAX_SND_SIZE          = 128 };

+

+typedef struct wms_udh_user_def_sound_s

+{

+  UINT8       data_length;

+  UINT8       position;

+  UINT8       user_def_sound[WMS_UDH_MAX_SND_SIZE];

+} wms_udh_user_def_sound_s_type;

+

+typedef struct wms_udh_nat_lang_ls_s

+{

+  wms_udh_nat_lang_id_e_type nat_lang_id;

+} wms_udh_nat_lang_ls_s_type;

+

+typedef struct wms_udh_special_sm_s

+{

+  wms_gw_msg_waiting_e_type                  msg_waiting;

+  wms_gw_msg_waiting_kind_e_type             msg_waiting_kind;

+  UINT8                                      message_count;

+  /*it indicates the number of messages of the type specified in Octet 1 waiting.*/

+} wms_udh_special_sm_s_type;

+

+typedef struct wms_udh_wap_8_s

+{

+  UINT8  dest_port;

+  UINT8  orig_port;

+} wms_udh_wap_8_s_type;

+

+typedef struct wms_udh_wap_16_s

+{

+  UINT16  dest_port;

+  UINT16  orig_port;

+} wms_udh_wap_16_s_type;

+

+typedef struct wms_udh_pre_def_sound_s

+{

+  UINT8       position;

+  UINT8       snd_number;

+} wms_udh_pre_def_sound_s_type;

+

+typedef struct wms_udh_pre_def_anim_s

+{

+  UINT8       position;

+  UINT8       animation_number;

+} wms_udh_pre_def_anim_s_type;

+

+/* Large animation

+*/

+typedef struct wms_udh_large_anim_s

+{

+  UINT8        position;

+  UINT8        data[WMS_UDH_ANIM_NUM_BITMAPS][WMS_UDH_LARGE_BITMAP_SIZE];

+} wms_udh_large_anim_s_type;

+

+/* Small animation

+*/

+typedef struct wms_udh_small_anim_s

+{

+  UINT8         position;

+  UINT8         data[WMS_UDH_ANIM_NUM_BITMAPS][WMS_UDH_SMALL_BITMAP_SIZE];

+} wms_udh_small_anim_s_type;

+

+typedef struct wms_udh_large_picture_data_s

+{

+  UINT8                      position;

+  UINT8                      data[WMS_UDH_LARGE_PIC_SIZE];

+} wms_udh_large_picture_data_s_type;

+

+/* Small picture

+*/

+typedef struct wms_udh_small_picture_data_s

+{

+  UINT8                     position;

+  UINT8                     data[WMS_UDH_SMALL_PIC_SIZE];

+} wms_udh_small_picture_data_s_type;

+

+typedef struct wms_udh_user_prompt_s

+{

+  UINT8       number_of_objects;

+    /* Number of objects of the same kind that follow this header which will

+    ** be stitched together by the applications. For example, 5 small pictures

+    ** are to be stitched together horizontally, or 6 iMelody tones are to be

+    ** connected together with intermediate iMelody header and footer ignored.

+    ** Allowed objects to be stitched:

+    **   - Images (small, large, variable)

+    **   - User defined sounds

+    */

+} wms_udh_user_prompt_s_type;

+

+typedef struct wms_udh_rfc822_s

+{

+  UINT8        header_length;

+} wms_udh_rfc822_s_type;

+

+typedef struct wms_udh_s

+{

+  wms_udh_id_e_type               header_id;

+

+  union wms_udh_u

+  {

+    wms_udh_concat_8_s_type             concat_8;       // 00

+ 	wms_udh_concat_16_s_type            concat_16;      // 08

+	wms_udh_nat_lang_ss_s_type          nat_lang_ss;    // 24

+    wms_udh_text_formating_s_type       text_formating; // 0a

+

+    wms_udh_other_s_type                other;

+	wms_udh_eo_s_type					eo; 

+	wms_udh_var_picture_s_type			var_picture; 

+    wms_udh_user_def_sound_s_type       user_def_sound; // 0c

+    wms_udh_nat_lang_ls_s_type          nat_lang_ls;    // 25

+	wms_udh_special_sm_s_type			special_sm; 	// 01	

+    wms_udh_wap_8_s_type                wap_8;          //04

+    wms_udh_wap_16_s_type               wap_16;         //05

+    wms_udh_pre_def_sound_s_type        pre_def_sound;  // 0b

+    wms_udh_pre_def_anim_s_type         pre_def_anim;   // 0d

+    wms_udh_large_anim_s_type           large_anim;     // 0e

+    wms_udh_small_anim_s_type           small_anim;     // 0f

+    wms_udh_large_picture_data_s_type   large_picture;  // 10

+    wms_udh_small_picture_data_s_type   small_picture;  // 11

+	wms_udh_user_prompt_s_type          user_prompt;    // 13

+    wms_udh_rfc822_s_type               rfc822;         // 20

+  	#if 0

+ /*~ CASE WMS_UDH_SMALL_PICTURE wms_udh_u.small_picture */

+    wms_udh_var_picture_s_type          var_picture;    // 12

+ /*~ CASE WMS_UDH_VAR_PICTURE wms_udh_u.var_picture */

+

+

+

+    wms_udh_eo_s_type                   eo;             // 14

+    wms_udh_other_s_type                other;

+ /*~ DEFAULT wms_udh_u.other */

+#endif

+  }u;   /*~ FIELD wms_udh_s.u DISC _OBJ_.header_id */

+} wms_udh_s_type,T_zUfiSms_Udh;

+/* GW user data type

+*/

+typedef struct wms_gw_user_data_s

+{

+  UINT8                          num_headers;

+  wms_udh_s_type                 headers[WMS_MAX_UD_HEADERS];

+

+  UINT16                         sm_len;

+  UINT8                          sm_data[WMS_MAX_LEN];

+    /* If DCS indicates the default 7-bit alphabet, each UINT8 holds one character

+    ** with bit 7 equal to 0 and sm_len indicates the number of characters;

+    ** If DCS indicates otherwise, each character may occupy multiple bytes

+    ** and sm_len indicates the total number of bytes.

+    */

+} wms_gw_user_data_s_type;

+

+/* Submit TPDU

+*/

+typedef struct wms_gw_submit_s

+{

+  UINT8                           reject_duplicates;        /* TP-RD 0:¿ÉÒÔÖØ¸´½ÓÊÕ  1: ²»ÄÜÖØ¸´½ÓÊÕ*/

+  UINT8                           reply_path_present;       /* TP-RP 0:²»Ð¯´øÓ¦´ð·¾¶*/

+  UINT8                           user_data_header_present; /* TP-UDHI 1: ÓÐheader */

+  UINT8                           status_report_enabled;    /* TP-SRR 1:ÔÊÐí״̬±¨¸æ */

+  wms_message_number_type           message_reference;        /* TP-MR ¶ÌÐÅ·¢ËͼÆÊýÆ÷ */

+  wms_address_s_type                address;                  /* TP-DA scµÄ·ÓÉ */

+  wms_pid_e_type                    pid;                      /* TP-PID ЭÒéid */

+  wms_gw_dcs_s_type                 dcs;                      /* TP-DCS ¶ÌÐűàÂëģʽ */

+  wms_gw_validity_s_type            validity;                 /* TP-VPF & TP-VP ¶ÌÐÅÓÐЧÉúÃüÆÚ */

+  wms_gw_user_data_s_type           user_data;                /* TP-UD */

+} wms_gw_submit_s_type,T_zUfiSms_SubmitTpdu;

+

+/* Deliver TPDU

+*/

+typedef struct wms_gw_deliver_s

+{

+  UINT8                          more;                     /* TP-MMS */

+  UINT8                          reply_path_present;       /* TP-RP */

+  UINT8                          user_data_header_present; /* TP-UDHI */

+  UINT8                          status_report_enabled;    /* TP-SRI */

+  wms_address_s_type               address;                  /* TP-OA */

+  wms_pid_e_type                   pid;                      /* TP-PID */

+  wms_gw_dcs_s_type                dcs;                      /* TP-DCS */

+  wms_timestamp_s_type             timestamp;                /* TP-SCTS */

+  wms_gw_user_data_s_type          user_data;                /* TP-UD */

+} wms_gw_deliver_s_type,T_zUfiSms_DeliverPdu;

+

+

+typedef struct wms_gw_status_report_s

+{

+  UINT8                       user_data_header_present; /* TP-UDHI */

+  UINT8                       more;                     /* TP-MMS */

+  UINT8                       status_report_qualifier;  /* TP-SRQ */

+  wms_message_number_type       message_reference;        /* TP-MR */

+  wms_address_s_type            address;                  /* TP-RA */

+  wms_timestamp_s_type          timestamp;                /* TP-SCTS */

+  wms_timestamp_s_type          discharge_time;           /* TP-DT */

+  wms_tp_status_e_type          tp_status;                /* TP-ST */

+

+  /* the mask indicates which of the optional fields are present

+  */

+  uint32                        mask;                     /* TP-PI */

+  wms_pid_e_type                pid;                      /* TP-PID */

+  wms_gw_dcs_s_type             dcs;                      /* TP-DCS */

+  wms_gw_user_data_s_type       user_data;                /* TP-UD */

+} wms_gw_status_report_s_type;

+

+/* GW Point-to-Point TS data decoded from the raw TS data

+*/

+typedef struct wms_gw_pp_ts_data_s

+{

+  wms_gw_tpdu_type_e_type                tpdu_type;

+    /* Note: this is not equivalent to TP-MTI */

+  union wms_gw_pp_ts_data_u

+  {

+      wms_gw_deliver_s_type                deliver;

+  #if 0

+    /*~ CASE WMS_TPDU_DELIVER wms_gw_pp_ts_data_u.deliver */

+    wms_gw_deliver_report_ack_s_type     deliver_report_ack;

+    /*~ CASE WMS_TPDU_DELIVER_REPORT_ACK wms_gw_pp_ts_data_u.deliver_report_ack */

+    wms_gw_deliver_report_error_s_type   deliver_report_error;

+    /*~ CASE WMS_TPDU_DELIVER_REPORT_ERROR wms_gw_pp_ts_data_u.deliver_report_error */

+#endif

+	wms_gw_submit_s_type                 submit;

+	wms_gw_status_report_s_type 		 status_report;

+

+#if 0

+	/*~ CASE WMS_TPDU_SUBMIT wms_gw_pp_ts_data_u.submit */

+    wms_gw_submit_report_ack_s_type      submit_report_ack;

+    /*~ CASE WMS_TPDU_SUBMIT_REPORT_ACK wms_gw_pp_ts_data_u.submit_report_ack */

+    wms_gw_submit_report_error_s_type    submit_report_error;

+    /*~ CASE WMS_TPDU_SUBMIT_REPORT_ERROR wms_gw_pp_ts_data_u.submit_report_error */

+

+    /*~ CASE WMS_TPDU_STATUS_REPORT wms_gw_pp_ts_data_u.status_report*/

+    wms_gw_command_s_type                command;

+    /*~ CASE WMS_TPDU_COMMAND wms_gw_pp_ts_data_u.command */

+

+    /*~ DEFAULT wms_gw_pp_ts_data_u.void */

+#endif

+  } u; /*~ FIELD wms_gw_pp_ts_data_s.u DISC _OBJ_.tpdu_type */

+

+} wms_gw_pp_ts_data_s_type;

+

+/* Client TS data decoded from the raw TS data

+*/

+typedef struct wms_client_ts_data_s

+{

+	wms_format_e_type             format;

+

+	union wms_client_ts_data_u

+	{

+		//wms_client_bd_s_type        cdma;

+		wms_gw_pp_ts_data_s_type    gw_pp;

+		//wms_gw_cb_ts_data_s_type    gw_cb;

+	} u; /*~ FIELD wms_client_ts_data_s.u DISC _OBJ_.format */

+

+} wms_client_ts_data_s_type, T_zUfiSms_ClientTsData;

+

+

+/* Status:

+*/

+typedef enum

+{

+  WMS_OK_S                  = 0,

+  WMS_OUT_OF_RESOURCES_S,   /* e.g. out of memory buffer */

+  WMS_TERMINAL_BLOCKED_S,

+  WMS_TERMINAL_BUSY_S,

+  WMS_INVALID_TRANSACTION_ID_S,

+  WMS_INVALID_FORMAT_S,

+  WMS_GENERAL_ERROR_S,

+  WMS_UNSUPPORTED_S,

+  WMS_NULL_PTR_S,

+

+  /* CDMA only

+  */

+  WMS_INVALID_PARM_SIZE_S   = 100,

+  WMS_INVALID_USER_DATA_SIZE_S,

+  WMS_INVALID_PARM_VALUE_S,

+  WMS_MISSING_PARM_S,

+  WMS_NETWORK_NOT_READY_S,

+  WMS_PHONE_NOT_READY_S,

+  WMS_NOT_ALLOWED_IN_AMPS_S,

+  WMS_NETWORK_FAILURE_S,

+  WMS_ACCESS_TOO_LARGE_S,

+  WMS_DTC_TOO_LARGE_S,

+  WMS_ACCESS_BLOCK_S,

+  WMS_ESN_MISMATCH_S, /* for JCDMA2 feature only */

+

+  /* GSM/WCDMA only

+  */

+  WMS_INVALID_TPDU_TYPE_S  = 200,

+  WMS_INVALID_VALIDITY_FORMAT_S,

+  WMS_INVALID_CB_DATA_S,

+  WMS_MT_MSG_FAILED_S, /* internal use */

+

+  /* SIP errors

+  */

+  WMS_SIP_PERM_ERROR_S     = 300,

+  WMS_SIP_TEMP_ERROR_S,

+

+  /* WMSC, CS and RPC errors

+  */

+  WMS_WMSC_ERROR_S         = 400,

+  WMS_CS_ERROR_S,

+  WMS_RPC_ERROR_S,

+

+  WMS_STATUS_MAX,

+  WMS_STATUS_MAX32 = 0x10000000    /* pad to 32 bit int */

+} wms_status_e_type;

+

+

+/* TPDU parameter bit masks

+*/

+enum

+{

+  WMS_TPDU_MASK_PID         = 0x0001,

+  WMS_TPDU_MASK_DCS         = 0x0002,

+  WMS_TPDU_MASK_USER_DATA   = 0x0004

+};

+

+typedef enum 

+{

+	RECEIVED_UNREAD,

+	RECEIVED_READ,

+	STORED_UNSEND,

+	STORED_SEND

+}T_SmsStatus;

+

+typedef enum {

+  WMS_MESSAGE_TAG_TYPE_ENUM_MIN_ENUM_VAL_V01 = -2147483647, /**< To force a 32 bit signed enum.  Do not change or use*/

+  WMS_TAG_TYPE_MT_READ_V01 = 0x00, 

+  WMS_TAG_TYPE_MT_NOT_READ_V01 = 0x01, 

+  WMS_TAG_TYPE_MO_SENT_V01 = 0x02, 

+  WMS_TAG_TYPE_MO_NOT_SENT_V01 = 0x03, 

+  WMS_MESSAGE_TAG_TYPE_ENUM_MAX_ENUM_VAL_V01 = 2147483647 /**< To force a 32 bit signed enum.  Do not change or use*/

+}wms_message_tag_type_enum_v01;

+

+#if 0 //ʹÓÃT_zSms_SmsInd

+/* µ¥Ìõ¶ÌÏûÏ¢ÄÚÈݵ͍Òå */

+typedef struct 

+{

+    int     index;

+    int     stat;

+    //qinwei modify from 32 to 36,add one byte for endmark

+    char    alpha[36];

+    int     length;

+    //ÐÞ¸ÄSIM\USIM¶ÌÏûÏ¢ÈÝÁ¿Îª100£¬ÓÐ100ÌõSIM\USIM²à¼ÇÂ¼Ê±Íø¿¨Ö»ÄܶÁ³ö80ÌõµÄÎÊÌâ

+    //qinwei 2005-8-23 9:42 changed from 504 to 324

+    char    pdu[354];

+} T_zUfiSms_SmsItem;

+#endif

+//coremÔ´×Ôsms_com.h

+

+

+#define AT_DEBUG 0

+#define AT_ERR 1

+

+

+#define at_print(LEVEL,...) do { printf(__VA_ARGS__); \						

+                            } while(0)

+                            //if(LEVEL) assert(__VA_ARGS__); \

+

+#define ZSMS_RESULT_OK               0x01    /* ÃüÁîÖ´Ðгɹ¦ */

+#define ZSMS_RESULT_ERROR            0x02 

+

+/*

+#define ZSMS_SCA_SIZE               36

+#define ZSMS_TPA_SIZE               36

+#define ZSMS_TPSCTS_SIZE            30

+#define ZSMS_MAX_TPUD_SIZE          760

+#define ZSMS_TPDT_SIZE              30

+*/

+#define ZSMS_NUM_MAX_CPE            60

+#define ZSMS_CTRL_Z_CHAR            26

+

+#define SMS_ASCII_CONCAT_MAX_LEN     640 

+

+

+typedef struct

+{   

+    UINT8 nv_count;

+    UINT8 nv_index_count;

+    UINT8 nv_index;

+    int nv_id[ZTE_WMS_DELETE_COUNT_MAX];

+    

+    UINT8 sim_count;

+    UINT8 sim_index_count;

+    UINT8 sim_index;

+    int sim_id[ZTE_WMS_DELETE_COUNT_MAX];

+    UINT8 sim_indices[ZTE_WMS_DELETE_COUNT_MAX];

+}T_zUfiSms_DelSms,T_zUfiSms_ModifySms;

+

+typedef struct

+{   

+   UINT8 cur_index;

+   UINT8 total;

+   UINT8  index[ZTE_WMS_DELETE_COUNT_MAX];

+}T_zUfiSms_DelIndexInfo, T_zUfiSms_ModifyIndexInfo;

+

+/*modify msg tag req */

+typedef struct

+{

+    unsigned long id_index;

+

+    unsigned short total_indices;

+    unsigned short  num_of_indices;     /* Total indices          */

+    int indices[ZTE_WMS_MESSAGE_LIST_MAX];

+} T_zUfiSms_ModifyTag;

+

+

+// ¶ÌÏûÏ¢²ÎÊý½á¹¹£¬±àÂë/½âÂë¹²ÓÃ

+// ÆäÖУ¬×Ö·û´®ÒÔ0½áβ

+typedef struct {

+    char SCA[44];			// ¶ÌÏûÏ¢·þÎñÖÐÐĺÅÂë(SMSCµØÖ·)

+    char TPA[44];			// Ä¿±êºÅÂë»ò»Ø¸´ºÅÂë(TP-DA»òTP-RA)

+    char TP_PID;			// Óû§ÐÅϢЭÒé±êʶ(TP-PID)

+    char TP_DCS;			// Óû§ÐÅÏ¢±àÂ뷽ʽ(TP-DCS)

+    unsigned char TP_VP;             // Óû§ÐÅÏ¢ÔÚ¶ÌÐÅÖÐÐĵı£´æÊ±¼ä£¨ÒÔ5·ÖÖÓΪµ¥Î»£©

+    char TP_SRR;            // Óû§ÐÅÏ¢·¢ËÍ״̬±¨¸æ£¨0 ²»ÒªÇó 1 ÒªÇó£©

+    char TP_SCTS[30];		// ·þÎñʱ¼ä´Á×Ö·û´®(TP_SCTS), ½ÓÊÕʱÓõ½

+    char TP_UD[SMS_ASCII_CONCAT_MAX_LEN+4];		// ԭʼÓû§ÐÅÏ¢(±àÂëǰ»ò½âÂëºóµÄTP-UD) MAX_TP_UD_LEN+1

+    int  index;			    // ¶ÌÏûÏ¢ÐòºÅ£¬ÔÚ¶ÁÈ¡ºÍɾ³ýʱÓõ½

+    char TP_DT[30];		        // ¶ÌÏûÏ¢±»³É¹¦·¢Ë͵½±»½ÐºÅÂëµÄʱ¼ä(TP-DT)

+    char TP_ST;			        //ǰһ¸öÌá½»µÄ¶ÌÏûÏ¢µÄ״̬(TP-ST)

+    char TP_MR;

+    unsigned char stat;     //¶ÌÏûÏ¢µÄ״̬ 0,1,2,3 º¬Òå¼ûö¾ÙSMS_Status

+    unsigned char   TP_UDLength; //TP_UDµÄ³¤¶È

+	//begin add for concat sms

+	char            TP_UDHI;                      //ÐÅϢͷָʾ£¬Èç¹ûÊÇ1˵Ã÷ÊÇ´øÓÐÏûϢͷµÄ

+    char            TP_IEI;                       //ÐÅÏ¢ÔªËØÖ¸Ê¾£¬Îª0±íʾÊÇÁ´½Ó¶ÌÏûÏ¢

+    //char            TP_ReferNum;                  //²Î¿¼ºÅÂ룬ÿÌõÁ´½Ó¶ÌÏûϢʹÓÃÏàͬµÄ²Î¿¼ºÅÂë

+    //char            TP_AllPieceNum;               //Á´½Ó¶ÌÏûÏ¢±»·ÖµÄ×ܶÎÊý

+    //char            TP_CurrentPieceNum;           //Á´½Ó¶ÌÏûÏ¢µÄµ±Ç°¶ÎÊý

+   // char            TP_IsALLConcatSms;            //ÊÇ·ñΪ²ð·ÖǰµÄÁ´½Ó¶ÌÏûÏ¢

+    unsigned short TP_ReferNum;                  //²Î¿¼ºÅÂ룬ÿÌõÁ´½Ó¶ÌÏûϢʹÓÃÏàͬµÄ²Î¿¼ºÅÂë

+    unsigned short TP_AllPieceNum;               //Á´½Ó¶ÌÏûÏ¢±»·ÖµÄ×ܶÎÊý

+    unsigned short TP_CurrentPieceNum;      //Á´½Ó¶ÌÏûÏ¢µÄµ±Ç°¶ÎÊý

+    unsigned short TP_IsConcatSms;            //ÊÇ·ñΪ¼¶Áª¶ÌÏûÏ¢

+    //end add for concat sms

+} SMS_PARAM;

+

+

+// for group send

+typedef struct

+{

+    unsigned short total_receiver;

+    unsigned short current_receiver;

+    unsigned char receivers[ZTE_WMS_SEND_NUM_MAX][ZTE_WMS_ADDRESS_LEN_MAX+1];

+} T_zUfiSms_GroupInfo;

+

+typedef struct

+{

+    unsigned short total_msg;    //×Ü·Ö¶ÎÊý

+    unsigned short current_sending; //µ±Ç°·¢Ë͵ĶÎÊý

+    unsigned long sms_len;

+    unsigned char msg_contents[ZTE_WMS_CONCAT_SMS_COUNT_MAX][ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX + 1];

+    T_zUfiSms_Date date;

+} T_zUfiSms_ConcatInfo;

+

+

+/**************************************************************************

+* º¯ÊýÉùÃ÷Çø

+**************************************************************************/ 

+extern int zUfiSms_SetDeleteInfo(T_zUfiSms_DelReq *ptDelMsg);

+extern T_zUfiSms_CmdStatus zUfiSms_DeleteSimSms(VOID);

+extern void zUfiSms_CfgInit(void);

+extern void zUfiSms_InitDb(void);

+extern void zUfiSms_CfgSmsNvInit(void);

+extern void zUfiSms_SetSmsLocation(SMS_LOCATION eLocation);

+extern void zUfiSms_ChangeMainState(T_zUfiSms_MainState iNewState);

+extern T_zUfiSms_CmdStatus zUfiSms_SaveSmsToDb

+(

+    T_zUfiSms_SaveReq *ptSaveSms,

+    T_zUfiSms_ConcatInfo *ptConcatSms,

+    T_zUfiSms_GroupInfo *ptGroupSms,

+    int iSmsLength

+);

+byte * zUfiSms_UtilTimeStamp

+(

+    T_zUfiSms_TimeStamp zte_wms_time,  /* Pointer to Time Stamp        */

+    byte * res_ptr,                /* Pointer to the result buffer */

+    T_zUfiSms_Date *date

+);

+

+extern void zUfiSms_SetGlobalDcsLang(unsigned char cDcs);

+extern int zUfiSms_FillGroupSms(T_zUfiSms_SendReq *ptSendMsg, T_zUfiSms_GroupInfo *ptGroupSms);

+extern int zUfiSms_WriteSmsToDb(T_zUfiSms_DbStoreData *ptDbSaveData, zUfiSms_StoreType iMemStore,  long iSmsId);

+extern VOID zUfiSms_InitCmdStatus(T_zUfiSms_StatusInfo *pStatusInfo,T_zUfiSms_CmdType iCmdId);

+extern void zUfiSms_CmglRespProc(T_zSms_SmsInd *pSmsItem);

+extern void zUfiSms_DelModemSms(int in_index);

+extern void zUfiSms_ModifyModemSms(T_zUfiSms_ModifyFlag *ptModifyBuff);

+extern T_zUfiSms_CmdStatus zUfiSms_SendSms(VOID);

+extern int zUfiSms_SendConcatSms(int cid);

+extern int zUfiSms_SetScaPara(char *sca);

+extern int zUfiSms_FillConcatSms (T_zUfiSms_SendReq *pSendSrcMsg, T_zUfiSms_ConcatInfo *pDestConcatMsg);

+extern int zUfiSms_CheckMemoryFull(T_zUfiSms_MemoryType mem_store);

+extern int zUfiSms_IsUnreadSms(T_zUfiSms_MemoryType mem_store);

+extern VOID zUfiSms_SendSmsStatusInfo(wms_message_status_info sms_op);

+extern VOID BakNotificationSms(char * pushSms,int pushSmsLen);

+

+

+extern SINT32 zSms_SendCmgsReq(VOID);

+extern VOID zSms_RecvCmgsErr(VOID);

+extern VOID zSms_RecvCmgsOk(VOID);

+extern SINT32 zSms_SendCmgdReq(UINT8 index);

+extern VOID zSms_RecvCmgdOk(VOID);

+extern VOID zSms_RecvCmgdErr(VOID);

+extern VOID zSms_RecvCmgdFinish(VOID);

+extern int zSms_SendCmgrReq(UINT8 index);

+extern int zSms_SendSmsInitReq(VOID);

+extern int zSms_SendZmenaReq(SINT32 avail);

+extern VOID atWeb_OutdateSmsCheck(UINT8 *pDatabuf);

+extern int zSms_SendCnmaReq(int ack_mode);

+extern int zSms_SetCscaReq(PSTR sca);

+extern int zSms_SendCnmiReq(PSTR pAtCmdPara);

+

+

+extern T_zUfiSms_CmdStatus zUfiSms_SendRawSms(T_zUfiSms_SendReq *ptSendMsg);

+extern T_zUfiSms_CmdStatus zUfiSms_WriteRawSms(T_zUfiSms_SaveReq *pSaveBuff);

+extern T_zUfiSms_CmdStatus zUfiSms_DeleteSms(T_zUfiSms_DelReq *ptDelBuff);

+extern void zUfiMmi_SendSmsStatus(void);

+extern T_zUfiSms_CmdStatus zUfiSms_ModifySmsTag(T_zUfiSms_ModifyFlag *ptModifyBuff);

+extern T_zUfiSms_CmdStatus zUfiSms_SetSmsPara(T_zUfiSms_ParaInfo *ptParaBuff);

+extern void zUfiSms_CmgsRespProc(VOID);

+extern void zUfiSms_CmtRespProc(T_zSms_SmsInd *ptRespData);

+extern void zUfiSms_CdsRespProc(T_zSms_SmsInd *ptRespData);

+extern void zUfiSms_ZmgrRespProc(T_zSms_SmsInd *ptRespData);

+extern VOID zSvr_Zpbic_Sms_Init(VOID);

+extern int zte_fota_notifyPushMsg(int cmd);

+

+/**************************************************************************

+* È«¾Ö±äÁ¿ÉùÃ÷Çø

+**************************************************************************/

+

+

+#ifdef __cplusplus

+} 

+#endif

+

+#endif  /* _SMS_FNC_H_ */

+

diff --git a/ap/app/zte_comm/sms/src/sms_code.c b/ap/app/zte_comm/sms/src/sms_code.c
new file mode 100755
index 0000000..9475a71
--- /dev/null
+++ b/ap/app/zte_comm/sms/src/sms_code.c
@@ -0,0 +1,2030 @@
+
+#include <time.h>

+#include <ctype.h>

+#include "os_type_def.h"

+#include "sms_code.h"

+#ifdef WIN32

+#include <wchar.h>

+#endif

+#define     NON_GSM                         (0x13ac+798-0x16aa)

+#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[(0x2ef+7960-0x21f7)]={
+((char)(0x1b71+454-0x1d07)),((char)(0x18fd+622-0x1b3a)),
+((char)(0x30b+4063-0x12b8)),((char)(0x163b+1532-0x1c04)),
+((char)(0xca4+4042-0x1c3a)),((char)(0x52+6832-0x1acd)),((char)(0xc2a+959-0xfb3))
+,((char)(0x159a+1072-0x1993)),((char)(0x486+5732-0x1ab2)),
+((char)(0x57+1072-0x44e)),((char)(0x2073+187-0x20ed)),
+((char)(0x603+5623-0x1bb8)),((char)(0xeac+5100-0x2255)),
+((char)(0x937+524-0xaff)),((char)(0xec6+3693-0x1cee)),
+((char)(0x17bf+2686-0x21f7))};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)(0x208+330-0x332)),
+((char)(0x97b+5759-0x1fda)),((char)(0x92+1508-0x656)),
+((char)(0x12c8+829-0x15e5)),((char)(0xb85+3682-0x19c7)),
+((char)(0x63d+2260-0xef1)),((char)(0x11f4+2973-0x1d71)),
+((char)(0xa08+5423-0x1f17)),((char)(0x3b2+8801-0x25f3)),
+((char)(0x184b+302-0x1959)),((char)(0x377+7840-0x21f7)),
+((char)(0x692+6229-0x1ec7)),((char)(0x1dd2+517-0x1fb7)),((char)(0xa29+69-0xa4e))
+,((char)(0x3e8+6618-0x1da2)),((char)(0x6b3+194-0x755)),
+((char)(0xfe4+5193-0x240d)),((char)(0x29+8353-0x20aa)),
+((char)(0x1310+2738-0x1da2)),((char)(0x101d+5026-0x239f)),
+((char)(0x965+6078-0x2103)),((char)(0x1c1d+696-0x1eb5)),
+((char)(0x90d+2640-0x133d)),((char)(0xa77+3076-0x165b)),
+((char)(0x950+5846-0x2006)),((char)(0x84f+235-0x91a)),
+((char)(0x11fb+1534-0x17d9)),((char)(0x710+5978-0x1e4a)),
+((char)(0x1723+1410-0x1c85)),((char)(0x3fa+282-0x4f4)),
+((char)(0x981+6183-0x2188)),((char)(0x79d+7961-0x2696)),
+((char)(0x270+8716-0x245c)),((char)(0x33c+9202-0x270d)),(0x16e1+327-0x1806),
+((char)(0x4d8+2823-0xfbc)),(0x1e08+2174-0x2684),((char)(0x4e9+4549-0x1689)),
+((char)(0x8a2+3101-0x1499)),(0x1186+1292-0x166b),((char)(0x6a+1540-0x646)),
+((char)(0x1328+2235-0x1bba)),((char)(0x129b+3907-0x21b4)),
+((char)(0x45c+5531-0x19cc)),((char)(0x1387+1422-0x18e9)),
+((char)(0x42b+5918-0x1b1c)),((char)(0x1810+3245-0x248f)),
+((char)(0x15d0+2499-0x1f64)),((char)(0xf75+4445-0x20a2)),
+((char)(0xb6c+2548-0x152f)),((char)(0xd71+3992-0x1cd7)),
+((char)(0x734+6961-0x2232)),((char)(0x64f+5557-0x1bd0)),
+((char)(0xd25+5379-0x21f3)),((char)(0xd7d+6106-0x2521)),
+((char)(0x14c2+3573-0x2280)),((char)(0x54b+7352-0x21cb)),
+((char)(0xbac+2372-0x14b7)),((char)(0x1db1+1645-0x23e4)),
+((char)(0x5c1+5177-0x19bf)),((char)(0x19f+5275-0x15fe)),
+((char)(0x282+4258-0x12e7)),((char)(0x1003+2659-0x1a28)),
+((char)(0x1835+2658-0x2258)),(0x91f+2492-0x12db),((char)(0x1153+2224-0x19c2)),
+((char)(0x599+4094-0x1555)),((char)(0x2187+994-0x2526)),
+((char)(0x8c0+6277-0x2101)),((char)(0xa8+1164-0x4ef)),
+((char)(0x664+4411-0x1759)),((char)(0xa77+4832-0x1d10)),
+((char)(0x175a+2081-0x1f33)),((char)(0x1535+3916-0x2438)),
+((char)(0x1244+1982-0x19b8)),((char)(0x3a3+6995-0x1eab)),
+((char)(0xa96+1101-0xe97)),((char)(0x15c2+3472-0x2305)),
+((char)(0x5df+4518-0x1737)),((char)(0x19d6+686-0x1c35)),
+((char)(0x1257+1304-0x171f)),((char)(0x1383+3265-0x1ff3)),
+((char)(0x3bb+7892-0x223d)),((char)(0x1b40+1502-0x20cb)),
+((char)(0x25d+3953-0x117a)),((char)(0xa32+1712-0x108d)),
+((char)(0x879+4091-0x181e)),((char)(0x16bc+197-0x172a)),
+((char)(0x1f13+904-0x2243)),((char)(0xf38+16-0xeef)),((char)(0x6a3+5750-0x1cbf))
+,(0x22e2+6276-0x202a),(0x240b+431-0xa8b),(0x2468+5270-0x1dc0),
+(0x1d38+3544-0xffc),(0x25f+7115-0x1e19),((char)(0x5f9+523-0x7e4)),
+((char)(0xf31+3616-0x1cf0)),((char)(0x414+2593-0xdd3)),
+((char)(0x3c0+7585-0x20fe)),((char)(0x11d4+3207-0x1df7)),
+((char)(0x10dd+5133-0x2485)),((char)(0xbc0+4570-0x1d34)),
+((char)(0x47a+3378-0x1145)),((char)(0xd52+2912-0x184a)),
+((char)(0xf36+1033-0x12d6)),((char)(0x10bf+2990-0x1c03)),
+((char)(0xa11+5856-0x2086)),((char)(0x4c2+5826-0x1b18)),
+((char)(0x574+3159-0x115e)),((char)(0x8ab+1606-0xe83)),
+((char)(0x541+6290-0x1d64)),((char)(0xb3+2091-0x86e)),((char)(0xaf5+857-0xddd)),
+((char)(0x1ef9+988-0x2263)),((char)(0x1860+1143-0x1c64)),
+((char)(0x1082+438-0x11c4)),((char)(0x20d5+381-0x21dd)),
+((char)(0x43b+3990-0x135b)),((char)(0xc3+8491-0x2177)),
+((char)(0x88c+4129-0x1835)),((char)(0x15ac+736-0x1813)),
+((char)(0xaf7+2804-0x1571)),6952,6976,6953,(0x1c40+7120-0x1cd3),
+((char)(0x5a9+3995-0x1524)),((char)(0xbc+7571-0x1e2f)),
+((char)(0x120+8041-0x2069)),((char)(0xf74+4922-0x228e)),
+((char)(0x5c3+4121-0x15bc)),((char)(0xb03+3338-0x17ed)),
+((char)(0x1352+1535-0x1931)),((char)(0x1dea+2273-0x26ab)),
+((char)(0x115+3461-0xe7a)),((char)(0x137f+3449-0x20d8)),
+((char)(0x987+7221-0x259c)),((char)(0x653+2043-0xe2e)),
+((char)(0x564+1898-0xcae)),((char)(0x42f+3425-0x1170)),
+((char)(0x5ed+2942-0x114b)),((char)(0x2249+1092-0x266d)),
+((char)(0x1401+4469-0x2556)),((char)(0x1932+2490-0x22cc)),
+((char)(0x7d8+173-0x865)),((char)(0x10ff+4530-0x2291)),
+((char)(0xdf2+3041-0x19b3)),((char)(0xbe2+3568-0x19b2)),
+((char)(0x68c+1793-0xd6d)),((char)(0x1f4f+221-0x200c)),
+((char)(0x1d55+2153-0x259e)),((char)(0x1e6f+474-0x2029)),
+((char)(0xf0b+1724-0x15a7)),((char)(0xc2c+6874-0x26e6)),
+((char)(0xd35+3106-0x1937)),((char)(0x394+2101-0xba9)),
+((char)(0x1363+979-0x1716)),((char)(0xba+2114-0x8dc)),
+((char)(0x1f08+1676-0x2574)),((char)(0x77b+3506-0x150d)),(0x98a+1111-0xda1),
+((char)(0x2c8+6405-0x1bad)),(0xc25+743-0xf0b),(0xc35+3628-0x1a3d),
+(0x1534+751-0x1820),((char)(0x605+4140-0x1611)),(0x1c91+2098-0x2464),
+((char)(0x12c7+4436-0x23fb)),((char)(0x15c6+4454-0x270c)),
+((char)(0x1068+3026-0x1c1a)),((char)(0x1fa5+403-0x2118)),
+((char)(0x230+266-0x31a)),((char)(0x1454+1542-0x1a3a)),
+((char)(0x683+5651-0x1c76)),((char)(0x1e4c+1795-0x252f)),
+((char)(0x942+4512-0x1ac2)),((char)(0x5b0+2840-0x10a8)),
+((char)(0x9f5+177-0xa86)),((char)(0xd5b+6055-0x24e2)),
+((char)(0xdea+1035-0x11d5)),((char)(0x2c5+7745-0x20e6)),
+((char)(0xf87+2102-0x179d)),((char)(0xd26+3598-0x1b14)),(0x3b9+6022-0x1b34),
+((char)(0x125a+4413-0x2377)),((char)(0x1a30+1369-0x1f69)),
+((char)(0xc85+4579-0x1e48)),((char)(0xa43+4816-0x1cf3)),
+((char)(0x220a+1201-0x269b)),((char)(0x15d6+3910-0x24fc)),(0x6bf+8108-0x260b),
+((char)(0xbd1+5428-0x20e5)),((char)(0xb28+5008-0x1e98)),
+((char)(0x1805+639-0x1a64)),((char)(0xc86+2576-0x1676)),(0x142a+3080-0x1fd7),
+(0x58+1111-0x4a1),(0x669+5387-0x1b58),(0xf6f+3493-0x1d0b),
+((char)(0x2f+4440-0x1167)),(0x708+1188-0xb8d),((char)(0x1a7+7627-0x1f52)),
+((char)(0x1861+1430-0x1dd7)),((char)(0x12a6+4813-0x2553)),
+((char)(0x1b74+2472-0x24fc)),((char)(0xa67+910-0xdd5)),
+((char)(0x3b0+4481-0x1511)),((char)(0x1f36+109-0x1f83)),(0x41c+5203-0x1812),
+((char)(0x613+6825-0x209c)),((char)(0xd7d+4034-0x1d1f)),
+((char)(0x12cd+3453-0x202a)),((char)(0x1f1d+1230-0x23cb)),(0x12a0+4196-0x22a8),
+((char)(0x510+7563-0x227b)),((char)(0x1d88+2365-0x26a5)),
+((char)(0x1ec4+993-0x2285)),((char)(0x1fd6+1465-0x256f)),
+((char)(0xf5b+4245-0x1fd0)),(0x116c+5014-0x24a4),((char)(0xaf5+6460-0x2411)),
+((char)(0x15cd+1126-0x1a13)),(0x85a+1499-0xe17),(0xe97+2791-0x18ff),
+((char)(0x2b0+5988-0x19f4)),((char)(0x1500+2528-0x1ec0)),
+((char)(0x107a+5108-0x244e)),(0x1ed+3469-0xeff),(0x59a+7952-0x249b),
+(0x861+3132-0x1480),((char)(0x263+3559-0x102a)),(0x1494+1807-0x1b9f),
+(0x904+3400-0x1647),((char)(0x1bc5+1230-0x2073)),((char)(0x737+3407-0x1466)),
+(0x13c+3999-0x10d4),((char)(0x459+2676-0xead)),((char)(0x10ad+2196-0x1921)),
+((char)(0x1971+1296-0x1e61)),((char)(0x1408+1372-0x1944)),(0x101+2883-0xbc7),
+(0x450+6099-0x1c1b),((char)(0x110d+662-0x1383)),((char)(0x1ea+8105-0x2173)),
+((char)(0x13d4+1680-0x1a44)),(0x24b+4668-0x140b),((char)(0xbb9+433-0xd4a)),
+(0xa90+5625-0x207d),(0x296+1392-0x800),((char)(0x15a1+2743-0x2038)),
+((char)(0xf2a+1281-0x140b)),(0x519+8318-0x2519),((char)(0x1b8+5247-0x1617)),
+((char)(0x1177+570-0x1391)),((char)(0x11db+2473-0x1b64)),};const unsigned short 
+zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[][(0x14b0+2340-0x1dd2)]={{
+(0x233d+43-0x235f),(0xb10+2469-0x13ce)},{(0xbcd+1080-0xffb),(0x6c+7417-0x1d59)},
+{(0x15e9+2733-0x2089),(0x13a2+281-0x14ae)},{(0x105d+197-0x110e),
+(0xe52+1968-0x15a4)},{(0x171d+85-0x174a),(0x78b+7014-0x2276)},{
+(0x8d7+2905-0x1407),(0x5d3+3019-0x1121)},{(0x6ac+8094-0x261b),
+(0x2034+1047-0x23ef)},{(0x5a5+2990-0x1117),(0xb84+6829-0x25d6)},{
+(0x1076+4826-0x2313),(0x65a+127-0x65b)},{(0x1a8d+1360-0x1f9f),
+(0x16bd+3098-0x227a)},{(0x13fd+746-0x16a7),(0x399+6183-0x1b44)},{
+(0x13d8+4108-0x23a3),(0x127a+1041-0x15ca)},{(0x12d4+778-0x1595),
+(0xe42+5768-0x23fd)},{(0xc91+6144-0x2442),(0x527+1500-0xa30)},{
+(0xa72+5105-0x1e0e),(0x12fc+4210-0x2294)},{(0x196a+180-0x19bd),
+(0x2194+27-0x20ce)},{(0x853+7293-0x246b),(0x22c7+5012-0x15af)},{
+(0xee0+5004-0x2203),(0x1387+3175-0x1f01)},{(0x1095+3340-0x1d32),
+(0x1c0+7304-0x1d55)},{(0x1170+4045-0x20c8),(0x8b1+2981-0x135c)},};const unsigned
+ short Ucs2_To_Gsm7_SPANISH_Table_UCS[][(0x797+2377-0x10de)]={{(0xcf2+85-0xd37),
+(0x1ae7+130-0x17d5)},{(0x542+2827-0x103b),(0x15fa+2665-0x1cbd)},{
+(0x1367+2313-0x1c5d),(0x61d+5618-0x187c)},{(0xee2+2579-0x18e1),
+(0x7ec+3877-0x1376)},{(0x118a+1347-0x16b8),(0x1a73+592-0x191a)},{
+(0x2c+7093-0x1bcb),(0xacf+2900-0x1283)},{(0x38d+743-0x65d),(0x1dff+2796-0x2543)}
+,{(0x4cc+4728-0x172c),(0x74f+1610-0x9f6)},{(0x200+5709-0x1834),
+(0x57c+8308-0x2258)},{(0x4e9+7367-0x2196),(0x20f0+1891-0x24b5)},};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,(0x13ff+868-0x1759),NON_GSM,NON_GSM,
+(0x4ff+4417-0x1633),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,(0x26d+5720-0x18a5),(0x832+3306-0x14fb),(0xbd8+3873-0x1ad7),
+(0x19ff+2669-0x2449),(0x678+3286-0x134c),(0x3ac+1975-0xb3e),(0xfcb+5509-0x252a),
+(0xde2+3041-0x199c),(0x1901+2616-0x2311),(0x516+7085-0x209a),
+(0x18d8+3009-0x246f),(0xf06+2876-0x1a17),(0x1aab+2770-0x2551),(0x257+1391-0x799)
+,(0x36d+2321-0xc50),(0x237+7447-0x1f1f),(0xbf4+3481-0x195d),(0x103+7608-0x1e8a),
+(0x65b+6568-0x1fd1),(0xcd+1943-0x831),(0x983+6726-0x2395),(0x64a+2358-0xf4b),
+(0x11a9+3319-0x1e6a),(0x3c+6396-0x1901),(0x557+4920-0x1857),(0x123f+1009-0x15f7)
+,(0x1467+43-0x1458),(0x4c+2649-0xa6a),(0x1025+861-0x1346),(0x1054+3460-0x1d9b),
+(0x9c0+4349-0x1a7f),(0x186b+1213-0x1ce9),(0xb05+5681-0x2136),(0x1a4+2233-0xa1c),
+(0x39f+6903-0x1e54),(0x172b+2197-0x1f7d),(0x4eb+3446-0x121d),(0x13e7+937-0x174b)
+,(0xc01+2119-0x1402),(0x1b98+1487-0x2120),(0x1ba3+109-0x1bc8),
+(0x811+6055-0x1f6f),(0x7f0+6100-0x1f7a),(0x1f5+1727-0x869),(0x19b0+2905-0x24bd),
+(0x1b76+2207-0x23c8),(0x1892+2791-0x232b),(0x531+8131-0x24a5),(0x114+105-0x12d),
+(0xd3a+2584-0x1701),(0x1bb1+2570-0x2569),(0x7dc+1746-0xe5b),(0xb55+2273-0x13e2),
+(0xdb2+1701-0x1402),(0x7f0+7516-0x24f6),(0x149+335-0x241),(0x10f9+123-0x111c),
+(0x2205+1121-0x260d),(0xe74+1260-0x1306),NON_GSM,NON_GSM,NON_GSM,NON_GSM,
+(0x104+6555-0x1a8e),NON_GSM,(0x5f9+7886-0x2466),(0x233+3328-0xed1),
+(0x1f72+36-0x1f33),(0x42d+1838-0xaf7),(0x100f+1585-0x15db),(0x1952+3494-0x2692),
+(0x1ada+42-0x1a9d),(0x2d8+1990-0xa36),(0x1171+330-0x1252),(0x116b+2406-0x1a67),
+(0xb06+2356-0x13cf),(0x17e9+2059-0x1f88),(0xe66+6098-0x25cb),(0x9f7+850-0xcdb),
+(0xe3c+1403-0x1348),(0xcf2+2944-0x1802),(0x1e25+409-0x1f4d),(0x2ba+3076-0xe4c),
+(0x1d83+883-0x2083),(0xaf9+6864-0x2555),(0x1a68+2046-0x21f1),(0x86c+17-0x807),
+(0x1006+1107-0x13e2),(0x1967+2071-0x2106),(0x1f2+2337-0xa9a),(0x156d+284-0x160f)
+,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,(0x1448+2786-0x1f0f),
+(0xa1c+2238-0x129a),NON_GSM,(0x5ed+2397-0xf49),(0x120a+107-0x1251),
+(0x162b+3099-0x2243),NON_GSM,(0x80f+6771-0x2223),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,
+(0x166+1293-0x613),NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xecd+4523-0x201d),
+(0x218d+345-0x22d8),(0x12d2+3450-0x2030),(0x88a+5970-0x1fd3),NON_GSM,
+(0xb5a+145-0xbcc),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,
+(0x177f+65-0x1763),NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x190c+3553-0x2691),NON_GSM,
+(0x19bc+2956-0x253d),NON_GSM,NON_GSM,NON_GSM,(0x8af+4818-0x1b23),NON_GSM,NON_GSM
+,(0x31+2136-0x86b),(0x1776+1650-0x1d69),NON_GSM,NON_GSM,NON_GSM,
+(0x15b4+1554-0x1b4b),(0x9b5+5277-0x1e43),(0x9c2+2107-0x11e0),NON_GSM,
+(0x2166+569-0x239b),(0xa3d+744-0xd20),NON_GSM,NON_GSM,(0x1b3+7737-0x1fe5),
+NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x288+8299-0x2276),(0x28+7724-0x1e4c),NON_GSM,
+NON_GSM,NON_GSM,(0x8d7+2501-0x1220),NON_GSM,(0x1f8c+1314-0x24a2),
+(0x7e6+2375-0x1127),NON_GSM,NON_GSM,(0x244b+130-0x244f),NON_GSM,NON_GSM,NON_GSM}
+;const unsigned short zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[][
+(0x13db+1223-0x18a0)]={{(0x608+2318-0xf11),(0x1723+2120-0x1e81)},{
+(0x1707+1781-0x1df3),(0x1105+760-0x1316)},{(0x1e9+4376-0x12f7),
+(0x2145+1373-0x2696)},{(0x542+8243-0x256a),(0x818+4095-0x1743)},{
+(0xc35+2594-0x164b),(0x24b+5590-0x172d)},{(0x210f+202-0x21cc),(0x108+5-0x100)},{
+(0xc6+4324-0x119c),(0x639+227-0x65b)},{(0x719+1939-0xe9d),(0x130a+4184-0x2281)},
+{(0x749+6193-0x1f68),(0x110f+2880-0x18a9)},{(0x1033+4322-0x2102),
+(0xa87+1019-0xaef)},{(0x9ea+148-0xa6a),(0x20e6+1488-0x2658)},{
+(0x50f+3197-0x1177),(0xe27+5912-0x2196)},{(0x18f1+1703-0x1f82),
+(0x242b+719-0x235a)},{(0x1744+2663-0x2194),(0xde7+5110-0x1e35)},{
+(0x41d+6453-0x1d3a),(0x1721+914-0x1710)},{(0xa51+7218-0x266a),
+(0x9c9+5431-0x1b68)},{(0x62a+5264-0x1a9b),(0x1cc8+2460-0x259a)},{
+(0x1d9c+2021-0x2559),(0xca3+2981-0x17cd)},{(0x3a8+5478-0x18e5),
+(0x182c+597-0x1a04)},{(0x2452+58-0x245d),(0x2306+567-0x24e1)},{
+(0xed+3962-0x102b),(0x7f0+5413-0x1cba)},{(0x13ad+3061-0x1f65),
+(0x76d+5825-0x1db0)},{(0xbcb+1978-0x1347),(0x2091+620-0x22a0)},{
+(0x6c7+1872-0xdd7),(0x93+5670-0x163d)},{(0x1c9a+552-0x1e81),(0x390+1152-0x750)},
+{(0xd29+6579-0x2693),(0x22c5+333-0x2345)},{(0xec6+4967-0x21de),
+(0x340+1940-0xa01)},{(0x1f71+283-0x2037),(0x2502+161-0x24c9)},{
+(0x8fb+7245-0x24ed),(0x115+2415-0x9c1)},{(0x15f1+2687-0x2014),(0x30a+3067-0xe30)
+},{(0xda9+1244-0x1224),(0x862+710-0xa66)},{(0x1241+1407-0x175b),8364},{
+(0x2200+893-0x2514),(0x14ed+3843-0x2303)},{(0x1ef+6225-0x19d1),
+(0x350+1416-0x7e5)},{(0x6bf+1412-0xbce),(0xf1b+2972-0x19bd)},{
+(0x2ca+6380-0x1b3b),(0x11c5+4224-0x2162)},{(0x1539+515-0x16c0),
+(0x12e4+571-0x142a)},{(0x6e0+5055-0x1a20),(0x763+5763-0x1d04)},};const unsigned 
+short Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[][(0x36b+7206-0x1f8f)]={{
+(0x2ff+3678-0x114d),(0x684+4709-0x1555)},{(0x755+4942-0x1a8e),
+(0x25a7+5507-0x1849)},{(0x17af+397-0x1924),8364},{(0x30c+5149-0x16c4),8364},};
+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,(0xf68+4332-0x204a),
+NON_GSM,NON_GSM,(0x1a3+3932-0x10f2),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,(0x4ec+2544-0xebc),(0x490+4632-0x1687),
+(0x16aa+2336-0x1fa8),(0x2477+428-0x2600),(0x1a8a+2602-0x24b2),
+(0xbdb+5393-0x20c7),(0xce6+5507-0x2243),(0x96a+3848-0x184b),(0x78+8066-0x1fd2),
+(0x2bf+1416-0x81e),(0xcb4+4029-0x1c47),(0xbf1+346-0xd20),(0x7d0+3777-0x1665),
+(0x523+1802-0xc00),(0x42d+7493-0x2144),(0x1dda+598-0x2001),(0xe53+4402-0x1f55),
+(0x11ef+1108-0x1612),(0xd34+6056-0x24aa),(0x165b+3776-0x24e8),
+(0x480+5175-0x1883),(0x7b9+5800-0x1e2c),(0x9b+9424-0x2535),(0x1123+4471-0x2263),
+(0x5c+3401-0xd6d),(0xed5+5285-0x2341),(0x692+5373-0x1b55),(0x22a4+1133-0x26d6),
+(0x12fc+3995-0x225b),(0xf65+1009-0x1319),(0x46+6937-0x1b21),(0x13f9+3572-0x21ae)
+,(0xfed+5880-0x26e5),(0xc70+854-0xf85),(0x17b4+3145-0x23bb),(0xd6b+3018-0x18f2),
+(0x83b+3360-0x1517),(0x6b6+1007-0xa60),(0x1278+2692-0x1cb6),(0xf6b+4863-0x2223),
+(0x8d3+4193-0x18ec),(0x77a+7184-0x2341),(0x72a+4823-0x19b7),(0x858+5494-0x1d83),
+(0x11e9+4030-0x215b),(0x16f+8642-0x22e4),(0x8a4+7091-0x2409),
+(0x149f+3438-0x21be),(0x21b8+171-0x2213),(0x1161+481-0x12f1),(0xd19+416-0xe67),
+(0x1d90+1097-0x2186),(0xc1d+464-0xd99),(0x825+4064-0x17b0),(0x326+3343-0xfdf),
+(0x1c3+3286-0xe42),(0xb96+3270-0x1804),(0xc98+4071-0x1c26),(0x48f+7849-0x22de),
+NON_GSM,(0x150a+1423-0x1a82),NON_GSM,(0x58f+4381-0x1696),(0xe66+1154-0x12d7),
+(0x1f4f+734-0x21b0),(0x77+154-0xb0),(0x1beb+2193-0x241a),(0x108b+5134-0x2436),
+(0xb15+1263-0xfa0),(0xb17+5270-0x1f48),(0x205d+152-0x208f),(0x2b9+5749-0x18c7),
+(0x1392+2404-0x1c8e),(0x1b1b+1486-0x2080),(0x88b+5594-0x1dfb),
+(0x1bb1+2048-0x2346),(0xe25+4097-0x1dba),(0x408+5641-0x19a4),
+(0x181a+1692-0x1e48),(0x354+7775-0x2144),(0x2c8+8662-0x242e),(0x131+2318-0x9ce),
+(0xdc5+3357-0x1a70),(0x8b8+7030-0x23bb),(0x1c72+944-0x1fae),(0xf60+2752-0x19ab),
+(0x695+5415-0x1b46),(0x3b5+7263-0x1f9d),(0x34c+3634-0x1106),(0xef1+328-0xfc0),
+(0x2023+968-0x2371),NON_GSM,(0x666+7705-0x2465),NON_GSM,(0xbf3+5178-0x1fcd),
+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,(0x2cf+1689-0x94d),NON_GSM_P,NON_GSM,(0xd74+2839-0x188a)
+,NON_GSM_P,(0x909+6047-0x20a5),NON_GSM,(0xcb2+1732-0x1317),NON_GSM,NON_GSM,
+(0x12cc+3077-0x1ebf),NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0xdaf+4079-0x1d7a)
+,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,(0x50f+6482-0x1e4d),(0x5da+6287-0x1e5b)
+,(0x118b+5438-0x26ad),(0xa4d+1703-0x1099),NON_GSM_P,NON_GSM_P,NON_GSM_P,
+(0xa9d+2032-0x127a),NON_GSM,(0x829+2642-0x125c),(0xeba+4935-0x21e3),NON_GSM,
+NON_GSM,(0xdd1+5686-0x23c7),NON_GSM,NON_GSM,NON_GSM,NON_GSM_P,NON_GSM,
+(0x1756+317-0x187a),(0x1cc6+979-0x208e),(0x255+6304-0x1a99),NON_GSM_P,NON_GSM,
+NON_GSM_P,NON_GSM,(0x9a6+3952-0x18b9),NON_GSM,(0xc3+7854-0x1f13),NON_GSM,NON_GSM
+,NON_GSM_P,(0x1579+905-0x1883),(0x15d4+2456-0x1f5d),(0xb86+6112-0x2349),
+(0x1509+1324-0x19ba),NON_GSM_P,NON_GSM_P,NON_GSM_P,(0x10c+6244-0x1967),NON_GSM_P
+,(0x15d1+2048-0x1dcc),(0xbc4+2818-0x16c2),NON_GSM,NON_GSM_P,(0x190c+764-0x1c01),
+NON_GSM,NON_GSM,NON_GSM,NON_GSM_P,NON_GSM_P,(0x1e3c+454-0x1ffa),
+(0x13f6+1625-0x1a43),(0x541+581-0x70a),NON_GSM_P,NON_GSM,NON_GSM_P,NON_GSM_P,
+(0xc8a+6729-0x26cd),NON_GSM,(0x759+3405-0x1428),NON_GSM,NON_GSM,NON_GSM};const 
+unsigned short zte_sms_GSMDefault_To_UCS2_Table_Ex[][(0x578+560-0x7a6)]={{
+(0x1ca+195-0x283),(0xf51+1277-0x1442)},{(0x496+2870-0xfb8),(0x1bb+2927-0xccc)},{
+(0xe66+33-0xe5f),(0x54c+817-0x802)},{(0x17f+2319-0xa65),(0xd06+3112-0x18b1)},{
+(0xd84+6294-0x25eb),(0x765+452-0x8cd)},{(0xf2f+1396-0x1467),(0x140b+4669-0x25ed)
+},{(0xbb1+4663-0x1dab),(0x1268+1511-0x17d1)},{(0x6fa+687-0x96b),
+(0x5b7+1962-0xd04)},{(0x43b+929-0x79c),(0x1dcd+94-0x1daf)},{(0x185c+3320-0x24ef)
+,8364},};const unsigned short UCS2_To_GSMDefault_Table_UCS2[][
+(0x859+7800-0x26cf)]={{(0x645+4249-0x16ce),(0x63c+2285-0xb95)},{
+(0x1616+187-0x16bf),(0x1cef+1332-0x1e7d)},{(0x10a5+3951-0x2001),
+(0x1e7b+363-0x1c53)},{(0x390+1429-0x911),(0xcb9+6605-0x22eb)},{
+(0x48b+4608-0x1676),(0xcb4+3405-0x1658)},{(0x9a9+4599-0x1b8a),
+(0x1de8+2011-0x2223)},{(0x15e3+2530-0x1fae),(0xd60+4686-0x1c06)},{
+(0xd46+2754-0x17f0),(0x261a+1055-0x2696)},{(0x4a2+4288-0x1549),
+(0x61a+2932-0xdf6)},{(0x1636+1236-0x1af0),(0x1348+5579-0x2575)},};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,(0x1e2f+2048-0x2625),NON_GSM,NON_GSM,
+(0x36a+5906-0x1a6f),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,(0x638+113-0x689),(0x1b4+3255-0xe4a),(0x5a0+1524-0xb72),
+(0x881+236-0x94a),(0x1924+1201-0x1dd3),(0x656+1966-0xddf),(0x3e4+6583-0x1d75),
+(0x479+3564-0x123e),(0x12ad+4866-0x2587),(0xb45+1676-0x11a8),(0x704+5720-0x1d32)
+,(0x671+2429-0xfc3),(0x84c+4302-0x18ee),(0x572+2163-0xdb8),(0x19ff+2845-0x24ee),
+(0x95f+1673-0xfb9),(0xda+2996-0xc5e),(0x79d+5192-0x1bb4),(0x4c2+2492-0xe4c),
+(0x53a+6288-0x1d97),(0x13f1+567-0x15f4),(0x177b+2928-0x22b6),(0x754+2375-0x1065)
+,(0xd38+5275-0x219c),(0xa98+831-0xd9f),(0xfdb+3286-0x1c78),(0x286+78-0x29a),
+(0x524+4667-0x1724),(0x148c+3053-0x203d),(0x725+2714-0x1182),(0xdc7+6422-0x269f)
+,(0x1c20+2381-0x252e),(0x17cb+352-0x192b),(0x2004+1708-0x266f),
+(0x124+5571-0x16a5),(0xc36+1708-0x129f),(0x1a11+1752-0x20a5),(0x3b8+7659-0x215e)
+,(0xeb8+4075-0x1e5d),(0x1a9+1669-0x7e7),(0xaca+272-0xb92),(0xae7+678-0xd44),
+(0x16d+8033-0x2084),(0x16f6+2953-0x2234),(0x796+3813-0x162f),(0x4cf+5319-0x1949)
+,(0x12e7+1104-0x16e9),(0x720+2087-0xef8),(0x1111+1657-0x173a),
+(0xd78+1915-0x14a2),(0x37d+3539-0x10fe),(0x648+4673-0x1836),(0x105b+3420-0x1d63)
+,(0x98b+3679-0x1795),(0x1f7+4045-0x116e),(0x73+4173-0x1069),(0x1096+1208-0x14f6)
+,(0x8bc+3796-0x1737),(0x1ee2+1498-0x2462),NON_GSM,NON_GSM,NON_GSM,NON_GSM,
+(0x16c+662-0x3f1),NON_GSM,(0x1b4+2886-0xc99),(0x8fa+5537-0x1e39),
+(0x907+6816-0x2344),(0x1255+3875-0x2114),(0x1468+3900-0x233f),(0x237+1806-0x8df)
+,(0x15c8+328-0x16a9),(0x105f+4823-0x22ce),(0x1802+1313-0x1cba),
+(0xc95+4529-0x1ddc),(0x1005+3062-0x1b90),(0x143+9625-0x2670),(0xea7+4149-0x1e6f)
+,(0xd2b+6682-0x26d7),(0x19f+7121-0x1d01),(0x515+1016-0x89d),(0x1461+958-0x17ae),
+(0xe46+397-0xf61),(0x4d1+5618-0x1a50),(0x480+8593-0x259d),(0x1d1+3387-0xe97),
+(0x1896+1774-0x1f0e),(0x11f4+5504-0x26fd),(0x5d0+2386-0xeaa),
+(0x14ec+2357-0x1da8),(0x587+4320-0x15ed),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,(0x2274+15-0x2268),(0x1e9+6693-0x1bce),NON_GSM,
+(0x10d3+4782-0x2380),(0x997+6521-0x22ec),(0xdaa+4242-0x1e39),NON_GSM,
+(0x3b4+8250-0x238f),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,(0x2a1+1846-0x977),NON_GSM,
+NON_GSM,NON_GSM,NON_GSM,(0x15a+3157-0xd54),(0x5f0+5412-0x1b06),
+(0x1139+352-0x127d),(0xf76+4463-0x20dc),NON_GSM,(0x2431+178-0x24c4),NON_GSM,
+NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,NON_GSM,(0x3c2+2454-0xcfb),NON_GSM,
+NON_GSM,NON_GSM,NON_GSM,(0x1033+4384-0x20f7),NON_GSM,(0x16a7+678-0x1942),NON_GSM
+,NON_GSM,NON_GSM,(0x197+797-0x456),NON_GSM,NON_GSM,(0x2583+270-0x2673),
+(0x1047+4693-0x221d),NON_GSM,NON_GSM,NON_GSM,(0x42b+7596-0x215c),
+(0x1b74+1523-0x2158),(0x25d+8759-0x2477),NON_GSM,(0x602+3338-0x1308),
+(0x471+2938-0xfe6),NON_GSM,NON_GSM,(0x1ee6+1544-0x24e7),NON_GSM,NON_GSM,NON_GSM,
+NON_GSM,(0x702+1415-0xc0c),(0x15f+3338-0xe61),NON_GSM,NON_GSM,NON_GSM,
+(0x1164+4336-0x21d8),NON_GSM,(0x4dc+5675-0x1afb),(0x1e2d+1020-0x2223),NON_GSM,
+NON_GSM,(0x4d3+7461-0x217a),NON_GSM,NON_GSM,NON_GSM};const unsigned short 
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[]={(0x151d+3958-0x2453),(0x3d5+549-0x557),
+(0x19d3+2129-0x2200),(0x99f+7233-0x253b),(0x1b4c+2679-0x24d9),
+(0x19f2+808-0x1c31),(0x80d+2130-0xf65),(0x8b9+7357-0x2489),(0xa5d+5976-0x20c2),
+(0xf31+3942-0x1db0),(0x247a+95-0x24cf),(0x18a+8504-0x21ee),(0x9d1+3393-0x161e),
+(0x1478+4355-0x256e),(0x931+1968-0x1020),(0x14c2+4629-0x25f6),
+(0x553+5301-0x1674),(0x1229+3069-0x1dc7),(0xba4+506-0xcf4),(0x144+4415-0x11bc),
+(0x1386+2954-0x1e50),8734,(0x1ee8+150-0x1f20),(0x1a4b+1195-0x1e9a),8364,
+(0x860+5346-0x1c6f),(0x1737+1090-0x1afd),(0x15a0+2040-0x1cf8),
+(0x36a+7284-0x1f1c),(0x1edd+1807-0x250a),(0x8fb+860-0xb8d),(0x1324+4548-0x241f),
+(0x10f0+2576-0x1ae0),(0x1cd5+1739-0x237f),(0x1d92+121-0x1de9),
+(0xceb+2654-0x1726),(0x1971+2588-0x22dd),(0x3f1+2089-0xbf5),(0x6e6+5131-0x1acb),
+(0x2da+3762-0x1165),(0xd39+3609-0x1b2a),(0xd10+6691-0x270a),(0x11d0+1121-0x1607)
+,(0x612+4515-0x178a),(0x5e0+7229-0x21f1),(0xcf8+1796-0x13cf),(0x1aaa+33-0x1a9d),
+(0x16a2+1180-0x1b0f),(0x5bf+4238-0x161d),(0x18d+9542-0x26a2),(0x81d+1236-0xcbf),
+(0x111d+5123-0x24ed),(0x22bd+547-0x24ac),(0xf40+3691-0x1d76),(0x2bd+6309-0x1b2c)
+,(0x311+3924-0x122e),(0x2327+197-0x23b4),(0x2a9+3197-0xeed),(0xc39+3274-0x18c9),
+(0xd4a+5749-0x2384),(0x7fd+4376-0x18d9),(0x28b+6040-0x19e6),(0xd56+6537-0x26a1),
+(0x438+695-0x6b0),(0x9b4+3482-0x1681),(0x1fa1+925-0x22fd),(0x9db+3605-0x17ae),
+(0x19a2+2416-0x22cf),(0x1abf+833-0x1dbc),(0x1c99+1630-0x22b2),(0x2b3+1041-0x67e)
+,(0xa72+2976-0x15cb),(0x427+6320-0x1c8f),(0x170f+3952-0x2636),
+(0x1117+2374-0x1a13),(0x1f9b+1038-0x235e),(0x507+2598-0xee1),
+(0x1710+2619-0x20fe),(0x99f+3436-0x16bd),(0xafa+6576-0x245b),
+(0x211b+1281-0x25cc),(0x1254+2707-0x1c96),(0x150a+4345-0x25b1),
+(0x1287+5132-0x2640),(0x1259+5203-0x2658),(0x23d7+567-0x25b9),
+(0x122+4987-0x1447),(0x1714+2417-0x202e),(0x11fb+3585-0x1fa4),
+(0x1149+5062-0x24b6),(0x719+6527-0x203e),(0x1c7b+1387-0x2123),
+(0xdad+1423-0x1267),(0x1606+1050-0x1946),(0x4bf+3118-0x1011),(0xf67+2337-0x17e1)
+,(0xfe3+4998-0x22eb),(0x14a5+1739-0x1b0f),(0x511+1247-0x98e),(0x69f+589-0x889),
+(0xf97+4402-0x2065),(0xd01+6217-0x24e5),(0x1040+840-0x1322),(0x1b8c+2416-0x2495)
+,(0x1d6+1346-0x6b0),(0x9bb+291-0xa75),(0x1f7+1393-0x6fe),(0x803+7292-0x2414),
+(0x8a6+7740-0x2676),(0xd1a+6167-0x24c4),(0x189f+3223-0x24c8),(0x95f+5582-0x1ebe)
+,(0x13f6+3188-0x1ffa),(0xc8c+3587-0x1a1e),(0xa1b+6075-0x2164),
+(0x1f14+1600-0x24e1),(0x1c21+1157-0x2032),(0xf41+2005-0x16a1),
+(0x1a2d+728-0x1c8f),(0x2b9+3038-0xe20),(0x173b+4103-0x26ca),(0x623+7244-0x21f6),
+(0xcfc+2530-0x1664),(0x1044+5506-0x24e3),(0x64b+1045-0x96b),(0x770+6957-0x223d),
+(0xcb5+5449-0x2102),(0x1fa3+62-0x1f01)};const unsigned short 
+zte_sms_GSMDefault_To_UCS2_Table[]={(0xdeb+3752-0x1c53),(0x504+7926-0x2357),
+(0x19b+2271-0xa56),(0x3c5+5489-0x1891),(0x492+7074-0x1f4c),(0x9b7+1747-0xfa1),
+(0xca3+3827-0x1a9d),(0x385+3435-0x1004),(0x241+4967-0x14b6),(0x113b+5129-0x247d)
+,(0x1432+3611-0x2243),(0x382+4165-0x12ef),(0x1656+2025-0x1d47),
+(0x8f3+5768-0x1f6e),(0x3b8+7608-0x20ab),(0x7fd+1635-0xd7b),(0xdf9+7057-0x25f6),
+(0xce7+3020-0x1854),(0xf9a+5368-0x20ec),(0x1026+4350-0x1d91),(0x5ab+2661-0xc75),
+(0xfb3+800-0xf2a),(0x1a5f+756-0x19b3),(0x48a+8486-0x2208),(0x56b+2441-0xb51),
+(0xb32+8044-0x2706),(0x432+3599-0xea3),(0x51c+824-0x7b4),(0x1bb+9571-0x2658),
+(0x77d+3427-0x13fa),(0xf5d+2110-0x16bc),(0x1b69+1273-0x1f99),
+(0x1b91+1286-0x2077),(0xb96+4624-0x1d85),(0x494+2878-0xfb0),(0x1316+250-0x13ed),
+(0x151b+888-0x17ef),(0x156d+1039-0x1957),(0x3eb+8042-0x232f),
+(0x1094+4594-0x225f),(0x4da+7313-0x2143),(0x14a4+651-0x1706),
+(0x1856+1789-0x1f29),(0xf68+1447-0x14e4),(0x78d+4840-0x1a49),(0x15f+3789-0xfff),
+(0x7c9+3147-0x13e6),(0x1538+2112-0x1d49),(0x1355+4326-0x240b),
+(0x146+4973-0x1482),(0x9d8+6441-0x22cf),(0x225b+332-0x2374),(0x55b+5257-0x19b0),
+(0xf7b+1801-0x164f),(0x780+2375-0x1091),(0xa61+6454-0x2360),(0x586+6991-0x209d),
+(0x963+6330-0x21e4),(0x434+8381-0x24b7),(0x1295+46-0x1288),(0x7a2+4999-0x1aed),
+(0x8a7+4545-0x1a2b),(0x12dc+4367-0x23ad),(0x14e6+3651-0x22ea),
+(0x561+8426-0x25aa),(0x42c+6256-0x1c5b),(0xcfb+6008-0x2431),(0x7d1+236-0x87a),
+(0x17f7+913-0x1b44),(0x1da5+1582-0x238e),(0xcd5+5023-0x202e),(0x1f3+9145-0x2565)
+,(0x1461+319-0x1558),(0x1a7b+1547-0x203d),(0x748+4731-0x1979),
+(0x186+6019-0x18be),(0x1245+4803-0x24bc),(0x7cc+1103-0xbce),(0x4fd+7244-0x20fb),
+(0x698+2851-0x116c),(0x10a8+5538-0x25fa),(0xf28+4407-0x200e),(0x1eb+3073-0xd9a),
+(0x47f+2051-0xc2f),(0x7cf+3278-0x1449),(0x228+1854-0x911),(0x1869+3833-0x270c),
+(0x3fb+2912-0xf04),(0xad2+3421-0x17d7),(0x14b3+3882-0x2384),(0x1faa+1960-0x26f8)
+,(0xe38+4578-0x1f56),(0x1370+3271-0x1f61),(0x3e8+4728-0x158f),
+(0xc52+1568-0x1196),(0x668+5161-0x19ea),(0x1070+1846-0x16e7),(0x2a0+3483-0xfda),
+(0x708+1000-0xa8e),(0x15b0+1075-0x1980),(0x757+2367-0x1032),(0x1901+1345-0x1ddd)
+,(0x75d+2960-0x1287),(0xd11+1203-0x115d),(0x1be2+2242-0x243c),
+(0x1842+662-0x1a6f),(0x1233+3062-0x1dbf),(0x9b+8265-0x2079),(0x1fa+8245-0x21c3),
+(0x15c6+4429-0x26a6),(0x1a25+1495-0x1f8e),(0x14c6+3574-0x224d),
+(0xfc3+2633-0x199c),(0x72f+3210-0x1348),(0x86+5619-0x1607),(0x3b7+519-0x54b),
+(0xc33+3269-0x1884),(0x862+379-0x968),(0xeea+5227-0x22df),(0x1f8+4378-0x129b),
+(0x1313+1517-0x1888),(0x15cb+3505-0x2303),(0x256a+417-0x2691),
+(0xd0f+1189-0x10d0),(0x99f+5456-0x1df9),(0x1278+2357-0x1abc),
+(0x1ff6+1170-0x238c),(0x1292+3564-0x1f9e)};int Bytes2String(const unsigned char*
+pSrc,char*pDst,int nSrcLength){const char tab[]="0123456789ABCDEF";int i=
+(0xacf+4260-0x1b73);if(pSrc==NULL||pDst==NULL||nSrcLength<(0x2081+192-0x2141)){
+return-(0x929+4454-0x1a8e);}for(i=(0x3bc+7039-0x1f3b);i<nSrcLength;i++){*pDst++=
+tab[*pSrc>>(0xfea+3094-0x1bfc)];*pDst++=tab[*pSrc&(0x12a7+4829-0x2575)];pSrc++;}
+*pDst='\0';return nSrcLength*(0x432+1740-0xafc);}int String2Bytes(const char*
+pSrc,unsigned char*pDst,int nSrcLength){int i=(0x11a+4572-0x12f6);if(pSrc==NULL
+||pDst==NULL||nSrcLength<(0x139b+4717-0x2608)){return-(0xf8b+2960-0x1b1a);}for(i
+=(0x18b0+46-0x18de);i<nSrcLength;i+=(0x131a+1994-0x1ae2)){if(*pSrc>=
+((char)(0x530+7142-0x20e6))&&*pSrc<=((char)(0xb77+4547-0x1d01))){*pDst=(*pSrc-
+((char)(0x534+818-0x836)))<<(0x1994+541-0x1bad);}else{*pDst=((toupper(*pSrc)-
+((char)(0x132d+552-0x1514)))+(0x1645+414-0x17d9))<<(0x358+2360-0xc8c);}pSrc++;if
+(*pSrc>=((char)(0x7e5+375-0x92c))&&*pSrc<=((char)(0x1931+103-0x195f))){*pDst|=*
+pSrc-((char)(0x1046+2350-0x1944));}else{*pDst|=(toupper(*pSrc)-
+((char)(0x118c+2834-0x1c5d)))+(0x12f4+3606-0x2100);}pSrc++;pDst++;}return 
+nSrcLength/(0x42f+7254-0x2083);}int EncodeUcs2(const char*pSrc,unsigned char*
+pDst,int nSrcLength){if(pSrc==NULL||pDst==NULL||nSrcLength<(0x9ad+1944-0x1145)){
+return-(0x3f7+913-0x787);}(void)String2Bytes(pSrc,pDst,(int)nSrcLength);return 
+nSrcLength/(0x1397+811-0x16c0);}int Encode7bit(const char*pSrc,unsigned char*
+pDst,int nSrcLength){int nSrc;int nDst;int nChar;unsigned char nLeft=
+(0x2e5+4968-0x164d);if(pSrc==NULL||pDst==NULL||nSrcLength<(0x819+4435-0x196c)){
+return-(0x1d02+2281-0x25ea);}nSrc=(0x1f61+555-0x218c);nDst=(0x528+8115-0x24db);
+while(nSrc<nSrcLength){nChar=nSrc&(0x1227+2148-0x1a84);if(nChar==
+(0x8a9+5895-0x1fb0)){nLeft=*pSrc;if((g_zUfiSms_ConcatSms.total_msg>
+(0x1ad6+117-0x1b4a))&&(nSrc==(nSrcLength-(0x1044+5514-0x25cd)))){nDst++;}}else{*
+pDst=(*pSrc<<((0x65a+1349-0xb97)-nChar))|nLeft;nLeft=*pSrc>>nChar;pDst++;nDst++;
+}pSrc++;nSrc++;}return nDst;}SINT32 zUfiSms_EncodePdu_DeliverReport(CHAR*pDst,
+UINT8 TP_FCS){SINT32 nLength=(0x1916+789-0x1c2b);SINT32 nDstLength=
+(0x1602+3575-0x23f9);UINT8 buf[(0xeed+4879-0x20fc)]={(0x610+5777-0x1ca1)};if(
+NULL==pDst){return-(0x9ec+1479-0xfb2);}if(TP_FCS!=(0xc72+5228-0x20de)){buf[
+(0x148+7053-0x1cd5)]=(0x152+9466-0x264c);buf[(0x3c8+7523-0x212a)]=TP_FCS;buf[
+(0x24+5623-0x1619)]=(0xc6a+3849-0x1b73);nDstLength+=Bytes2String(buf,&pDst[
+nDstLength],(0x883+4830-0x1b5e));}else{buf[(0x1013+796-0x132f)]=
+(0x4d2+3870-0x13f0);buf[(0x1b6d+2162-0x23de)]=(0x981+7414-0x2677);nDstLength+=
+Bytes2String(buf,&pDst[nDstLength],(0x9ca+5301-0x1e7d));}return nDstLength;}
+unsigned long zUfiSms_ConvertAsciiToGsmDefault(const unsigned char*inputs,
+unsigned char*outputs,unsigned long len){unsigned long i=(0x662+1802-0xd6c);
+unsigned long j=(0xbec+1876-0x1340);unsigned long k=(0x1d02+1225-0x21cb);if(NULL
+==inputs||NULL==outputs){printf(
+"\x73\x6d\x73\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73");
+return(0x86d+2202-0x1107);}for(i=(0x29a+3523-0x105d);i<len;i++){j=inputs[i];if(
+g_zUfiSms_AsciiToGsmdefaultTable[j]<(0x181d+1907-0x1e91)){outputs[k]=
+g_zUfiSms_AsciiToGsmdefaultTable[j];}else{outputs[k]=(
+g_zUfiSms_AsciiToGsmdefaultTable[j]&65280)>>(0x1114+2100-0x1940);k++;outputs[k]=
+(g_zUfiSms_AsciiToGsmdefaultTable[j]&(0x19b+6300-0x1938));}k++;}return k;}
+unsigned long zUfiSms_ConvertUcs2ToSpanish(const unsigned char*def,unsigned char
+*gsm_default,unsigned long len){unsigned long i=(0x8d+8516-0x21d1);unsigned long
+ k=(0x364+1312-0x884);unsigned long p=(0x942+970-0xd0c);unsigned long tmp=
+(0xbf+9055-0x241e);unsigned long s1=(0x445+143-0x4d4),s2=(0xf39+2901-0x1a8e);
+unsigned long q=(0x79f+2207-0x103e);s1=sizeof(
+zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex)/sizeof(
+zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[(0x7a9+4490-0x1933)]);s2=sizeof(
+Ucs2_To_Gsm7_SPANISH_Table_UCS)/sizeof(Ucs2_To_Gsm7_SPANISH_Table_UCS[
+(0x19d1+3286-0x26a7)]);for(i=(0xdf4+5337-0x22cd);i<len;i++){if(def[i]==
+(0x718+4335-0x1807)){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]==(0x571+5085-0x192e)))
+{gsm_default[k]=(0xd70+4168-0x1d98);k++;continue;}for(q=(0x11ef+3478-0x1f85);q<
+s1;q++){if(def[i]==zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[q][(0xe5c+6014-0x25d9)]
+){gsm_default[k]=(0x2f+4487-0x119b);k++;gsm_default[k]=
+zte_sms_GSM7_SPANISH_To_UCS2_Table_Ex[q][(0x1c36+217-0x1d0f)];break;}}}else{tmp=
+(def[i]<<(0x2f2+5360-0x17da))+def[i+(0x1c59+2262-0x252e)];i++;if(tmp==8364){
+gsm_default[k]=(0xd91+5886-0x2474);k++;gsm_default[k]=(0x347+7664-0x20d2);k++;}
+for(p=(0xae0+967-0xea7);p<s2;p++){if(tmp==Ucs2_To_Gsm7_SPANISH_Table_UCS[p][
+(0x14b4+938-0x185d)]){gsm_default[k]=Ucs2_To_Gsm7_SPANISH_Table_UCS[p][
+(0x2359+817-0x268a)];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=(0x420+2654-0xe7e);unsigned long 
+k=(0xb49+1127-0xfb0);unsigned long p=(0x12b+762-0x425);unsigned long tmp=
+(0xb3f+6957-0x266c);unsigned long s1=(0xd86+2634-0x17d0),s2=(0x94c+2811-0x1447);
+unsigned long q=(0xb+7015-0x1b72);s1=sizeof(
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex)/sizeof(
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[(0x341+2467-0xce4)]);s2=sizeof(
+Ucs2_To_Gsm7_PORTUGUESE_Table_UCS)/sizeof(Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[
+(0x4ac+4613-0x16b1)]);for(i=(0x1277+1286-0x177d);i<len;i++){if(def[i]==
+(0x9f+5239-0x1516)){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]==
+(0x1a3+5972-0x18d7))){gsm_default[k]=(0x1157+1634-0x1799);k++;continue;}for(q=
+(0x21+1193-0x4ca);q<s1;q++){if(def[i]==zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[
+q][(0xf91+4645-0x21b5)]){gsm_default[k]=(0x653+3159-0x128f);k++;gsm_default[k]=
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[q][(0x11d3+2294-0x1ac9)];break;}}}else{
+tmp=(def[i]<<(0x13d2+2058-0x1bd4))+def[i+(0xa51+6931-0x2563)];i++;if(tmp==8364){
+gsm_default[k]=(0x180+4778-0x140f);k++;gsm_default[k]=(0x1fb5+1319-0x2477);k++;
+continue;}for(p=(0x216+6451-0x1b49);p<s2;p++){if(tmp==
+Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[p][(0xa90+4923-0x1dca)]){gsm_default[k]=
+Ucs2_To_Gsm7_PORTUGUESE_Table_UCS[p][(0x30d+2685-0xd8a)];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=(0x1383+3046-0x1f69);unsigned long k=(0xc28+1599-0x1267);unsigned long p=
+(0x857+2410-0x11c1);unsigned long tmp=(0x821+1971-0xfd4);unsigned long s1=
+(0x530+1330-0xa62),s2=(0x143+804-0x467);unsigned long q=(0x13b0+495-0x159f);s1=
+sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof(
+zte_sms_GSMDefault_To_UCS2_Table_Ex[(0x3fa+7886-0x22c8)]);s2=sizeof(
+UCS2_To_GSMDefault_Table_UCS2)/sizeof(UCS2_To_GSMDefault_Table_UCS2[
+(0xd47+3437-0x1ab4)]);for(i=(0xd4c+5580-0x2318);i<len;i++){if(def[i]==
+(0x998+6437-0x22bd)){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]==(0x748+6103-0x1eff))){
+gsm_default[k]=(0xd94+1454-0x1322);k++;continue;}for(q=(0x94f+1785-0x1048);q<s1;
+q++){if(def[i]==zte_sms_GSMDefault_To_UCS2_Table_Ex[q][(0xf9c+3150-0x1be9)]){
+gsm_default[k]=(0x742+7258-0x2381);k++;gsm_default[k]=
+zte_sms_GSMDefault_To_UCS2_Table_Ex[q][(0x106+1224-0x5ce)];break;}}}else{tmp=(
+def[i]<<(0x220a+1065-0x262b))+def[i+(0x5b7+6702-0x1fe4)];i++;if(tmp==8364){
+gsm_default[k]=(0x1825+254-0x1908);k++;gsm_default[k]=(0x912+4652-0x1ad9);k++;
+continue;}for(p=(0x1dec+1480-0x23b4);p<s2;p++){if(tmp==
+UCS2_To_GSMDefault_Table_UCS2[p][(0x1bb6+259-0x1cb8)]){gsm_default[k]=
+UCS2_To_GSMDefault_Table_UCS2[p][(0x696+697-0x94f)];break;}}}k++;}gsm_default[k]
+='\0';return k;}UINT8 zUfiSms_TsIntToBcd(const UINT8 i){return(UINT8)(((i%
+(0x18f9+97-0x1950))+((i/(0x168+6625-0x1b3f))<<(0x7df+3389-0x1518))));}void 
+zUfiSms_DecodeRelativeTime(UINT8 iValidTime,T_zUfiSms_TimeStamp*ptTimeStamp){
+uint32 i=(0x879+7654-0x265f);if(ptTimeStamp!=NULL){memset((void*)ptTimeStamp,
+(0x1da+3022-0xda8),sizeof(wms_timestamp_s_type));if(iValidTime<
+(0x8bc+4375-0x1943)){i=(iValidTime+(0x43f+5144-0x1856))*(0x19f5+523-0x1bfb);
+ptTimeStamp->hour=(UINT8)zUfiSms_TsIntToBcd((UINT8)(i/(0x1109+4969-0x2436)));
+ptTimeStamp->minute=(UINT8)zUfiSms_TsIntToBcd((UINT8)(i%(0xed4+6199-0x26cf)));}
+else if(iValidTime<(0xd43+4804-0x1f60)){i=(iValidTime-(0x11ba+2510-0x1af9))*
+(0xc73+4328-0x1d3d);ptTimeStamp->hour=(UINT8)zUfiSms_TsIntToBcd((UINT8)(
+(0x64+3945-0xfc1)+i/(0x1b23+851-0x1e3a)));ptTimeStamp->minute=(UINT8)
+zUfiSms_TsIntToBcd((UINT8)(i%(0x177+4971-0x14a6)));}else if(iValidTime<
+(0x313+6870-0x1d24)){i=iValidTime-(0xe13+1553-0x137e);ptTimeStamp->month=(UINT8)
+zUfiSms_TsIntToBcd((UINT8)(i/(0xdf1+2283-0x16be)));ptTimeStamp->day=(UINT8)
+zUfiSms_TsIntToBcd((UINT8)(i%(0xc4b+2804-0x1721)));}else{i=(iValidTime-
+(0x830+4761-0x1a09))*(0x869+977-0xc33);ptTimeStamp->year=(UINT8)
+zUfiSms_TsIntToBcd((UINT8)(i/(0xd56+3451-0x1964)));ptTimeStamp->month=(UINT8)
+zUfiSms_TsIntToBcd((UINT8)((i%(0x1f97+294-0x1f50))/(0x21d6+553-0x23e1)));
+ptTimeStamp->day=(UINT8)zUfiSms_TsIntToBcd((UINT8)((i%(0x7ef+1304-0xb9a))%
+(0x19fc+817-0x1d0f)));}}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=(0x1e38+2111-0x2677);if(pIntArray==NULL||pCharArray==NULL){return ZUFI_FAIL;}
+for(i=(0x1cb+3560-0xfb3);i<iLen;i++){pIntArray[i]=pCharArray[i]-
+((char)(0x3a0+856-0x6c8));}return ZUFI_SUCC;}void zUfiSms_FillGlobalTpudGsm7(
+T_zUfiSms_SubmitTpdu*ptSubmit,T_zUfiSms_ConcatInfo*ptConcatSms,
+T_zUfiSms_DbStoreData*ptDbSaveData){int i=(0xfec+4090-0x1fe6);if(ptConcatSms->
+total_msg>(0x1b92+1652-0x2205)){g_zUfiSms_SendingSms.TP_UDHI=(0x49c+6242-0x1cfd)
+;g_zUfiSms_SendingSms.TP_UD[(0x11af+3679-0x200e)]=(0x491+6534-0x1e12);
+g_zUfiSms_SendingSms.TP_UD[(0x7e0+6908-0x22db)]=(0x23b+7892-0x210a);
+g_zUfiSms_SendingSms.TP_UD[(0x279+137-0x300)]=(0xa10+5539-0x1fb0);
+g_zUfiSms_SendingSms.TP_UD[(0x10e6+1457-0x1694)]=(char)ptDbSaveData->concat_info
+[(0xa03+825-0xd3c)]%(0x1650+3525-0x2316);g_zUfiSms_SendingSms.TP_UD[
+(0x1724+1902-0x1e8e)]=(char)ptConcatSms->total_msg;g_zUfiSms_SendingSms.TP_UD[
+(0xe2a+1623-0x147c)]=(char)ptConcatSms->current_sending+(0x369+9096-0x26f0);
+g_zUfiSms_SendingSms.TP_UD[(0x928+4597-0x1b17)]=(0x3f5+8240-0x241f);for(i=
+(0xb67+3814-0x1a4d);i<ptSubmit->user_data.sm_len;i++){g_zUfiSms_SendingSms.TP_UD
+[i+(0x1e3b+1977-0x25ed)]=ptSubmit->user_data.sm_data[i];}g_zUfiSms_SendingSms.
+TP_UDLength=ptSubmit->user_data.sm_len+(0x1073+4641-0x228d);}else{for(i=
+(0x272+5526-0x1808);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>(0xe40+6102-0x2615)){g_zUfiSms_SendingSms.TP_UDHI=
+(0x1e6a+188-0x1f25);g_zUfiSms_SendingSms.TP_UD[(0x289+1027-0x68c)]=
+(0xb77+5175-0x1fa9);g_zUfiSms_SendingSms.TP_UD[(0x901+794-0xc1a)]=
+(0x131f+3192-0x1f92);g_zUfiSms_SendingSms.TP_UD[(0x196+9306-0x25ee)]=
+(0x16ca+2371-0x200a);g_zUfiSms_SendingSms.TP_UD[(0xee9+800-0x1206)]=(char)
+ptDbSaveData->concat_info[(0x2d+6694-0x1a53)]%(0x16a9+2163-0x1e1d);
+g_zUfiSms_SendingSms.TP_UD[(0x1888+3461-0x2609)]=(char)ptConcatSms->total_msg;
+g_zUfiSms_SendingSms.TP_UD[(0xd2d+6006-0x249e)]=(char)ptConcatSms->
+current_sending+(0x49+9320-0x24b0);(void)Bytes2String(ptSubmit->user_data.
+sm_data,&g_zUfiSms_SendingSms.TP_UD[(0xca9+1631-0x1302)],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)(0x103d+5205-0x2431))&&x<
+((char)(0x8d3+2059-0x1077))){x=(x-((char)(0x10f6+789-0x13aa)))+
+((char)(0x10e4+5097-0x248c));}return x;}unsigned char zUfiSms_Char2Dec(unsigned 
+char x){unsigned char d=(0xc3a+6252-0x24a6);if(x>=((char)(0x863+226-0x904))&&x<
+((char)(0x1103+4572-0x2298))){d=(x-((char)(0x1b90+110-0x1bbd)))+
+(0xbf+5126-0x14bb);}else{d=x-((char)(0x5c5+1077-0x9ca));}return d;}unsigned char
+ zUfiSms_Char2Byte(unsigned char a,unsigned char b){unsigned char data=
+(0x9d3+7124-0x25a7);unsigned char l=(0x1a43+3091-0x2656),h=(0x12a+2225-0x9db);a=
+zUfiSms_Low2High(a);b=zUfiSms_Low2High(b);h=zUfiSms_Char2Dec(a);l=
+zUfiSms_Char2Dec(b);data=h*(0xb74+3692-0x19d0)+l;return data;}void 
+zUfiSms_Str2Bytes(unsigned char*text,int text_len,unsigned char*data,int 
+data_len){int i=(0xc7+899-0x44a);while((0x592+3350-0x12a6)*i+(0xcf0+6352-0x25bf)
+<text_len){data[i]=zUfiSms_Char2Byte(text[(0x16e3+2507-0x20ac)*i],text[
+(0x110d+909-0x1498)*i+(0x1bf+7640-0x1f96)]);i++;}}int zUfiSms_SplitString(char*
+input,char***output,char cMatchChar){int src=(0x18c3+2553-0x22bc);int dst=
+(0xbf4+1718-0x12aa);int count=(0xd83+5863-0x246a);int size=(0x9df+587-0xc22);
+char quoted=(0x6d2+3563-0x14bd);char**tmpout=NULL;*output=(char**)malloc(sizeof(
+char*)*size);if(NULL==*output){return-(0xd61+3283-0x1a33);}(*output)[count++]=
+input;for(src=dst=(0x531+4125-0x154e);input[src];){char cInputChar=input[src];if
+(!quoted&&cInputChar==cMatchChar){input[dst++]=(0xf4c+1304-0x1464);while(input[
+++src]&&(int)isspace(input[src])){};if(count>=size){size+=(0x15+1789-0x702);
+tmpout=(char**)realloc(*output,sizeof(char*)*size);if(NULL==tmpout){return-
+(0x6a5+8102-0x264a);}*output=tmpout;}(*output)[count++]=input+dst;}else if(!
+quoted&&(cInputChar=='\''||cInputChar==((char)(0x1c33+729-0x1eea)))){quoted=
+cInputChar;src++;}else if(cInputChar==quoted){quoted=(0x1825+249-0x191e);src++;}
+else{if(cInputChar=='\\'&&quoted!='\''){src++;cInputChar=input[src];if(!
+cInputChar){free(*output);*output=NULL;return-(0x341+5070-0x170e);}}input[dst++]
+=cInputChar;src++;}}input[dst]=(0xe43+2550-0x1839);if(quoted){free(*output);*
+output=NULL;return-(0x1c76+808-0x1f9d);}return count;}int zUfiSms_atohex(char c)
+{int result=(0x18e4+1509-0x1ec9);if(c>=((char)(0x109c+3967-0x1feb))&&c<=
+((char)(0xa63+2818-0x152c))){result=c-((char)(0xfe8+5284-0x245c));}else if(c>=
+((char)(0x507+6560-0x1e46))&&c<=((char)(0x160d+3099-0x21c2))){result=(c-
+((char)(0x6fc+7684-0x249f)))+(0x166a+3551-0x243f);}else if(c>=
+((char)(0x28a+6484-0x1b9d))&&c<=((char)(0x176+7171-0x1d33))){result=(c-
+((char)(0x1bb+2486-0xb30)))+(0x3d+8829-0x22b0);}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=(0x1d77+10-0x1d81);int high=
+(0xe6c+71-0xeb3);if(in_ptr==NULL||out_ptr==NULL){printf(
+"\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>(0x15c1+1901-0x1d2e)){low=in_ptr[iLength-
+(0x1008+3487-0x1da6)]&(0x1cd0+891-0x203c);high=(in_ptr[iLength-
+(0xba4+2403-0x1506)]&(0xee7+2821-0x18fc))>>(0x811+410-0x9a7);out_ptr[
+(0x2f1+2455-0xc86)*iLength-(0x154+4340-0x1247)]=g_zUfiSms_DigAscMap[low];out_ptr
+[(0x249+7935-0x2146)*iLength-(0x1466+3831-0x235b)]=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=
+(0x1402+2970-0x1f9c);unsigned int j=(0x98+8064-0x2018);unsigned int k=
+(0xc9+9344-0x2549);unsigned int p=(0x13d+105-0x1a6);unsigned int s=
+(0xe29+1173-0x12be);s=sizeof(zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex)/sizeof(
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[(0x102d+1543-0x1634)]);for(i=
+(0x11a2+5322-0x266c);i<len;i++){j=gsmdef[i];if(j==(0x8b+5260-0x14fc)){i++;for(p=
+(0x13cc+1785-0x1ac5);p<s;p++){if(zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p][
+(0x608+5615-0x1bf7)]==gsmdef[i]){ucs2[k]=
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p][(0x12+6876-0x1aed)]>>
+(0xa7+2278-0x985);k++;ucs2[k]=(unsigned char)(
+zte_sms_GSM7_PORTUGUESE_To_UCS2_Table_Ex[p][(0x1a6c+2184-0x22f3)]);break;}}}else
+{ucs2[k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]>>(0x144b+3657-0x228c);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=
+(0x306+4785-0x15b7);unsigned int j=(0xfe9+2894-0x1b37);unsigned int k=
+(0x3ea+7081-0x1f93);unsigned int p=(0xd64+4260-0x1e08);unsigned int s=
+(0x68a+7413-0x237f);s=sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof(
+zte_sms_GSMDefault_To_UCS2_Table_Ex[(0x366+4452-0x14ca)]);for(i=
+(0x1585+2354-0x1eb7);i<len;i++){j=gsmdef[i];if(j==(0x60b+6662-0x1ff6)){i++;for(p
+=(0x78b+5145-0x1ba4);p<s;p++){if(zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
+(0x4b3+7043-0x2036)]==gsmdef[i]){ucs2[k]=zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
+(0x1ed5+1107-0x2327)]>>(0x159f+933-0x193c);k++;ucs2[k]=(unsigned char)(
+zte_sms_GSMDefault_To_UCS2_Table_Ex[p][(0x5d6+3651-0x1418)]);break;}}}else{ucs2[
+k]=zte_sms_GSM7_PORTUGUESE_To_UCS2_Table[j]>>(0xa1b+4408-0x1b4b);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=(0xcd6+5375-0x21d5)
+;unsigned long j=(0x52+5005-0x13df);unsigned long k=(0x3dd+5824-0x1a9d);unsigned
+ long p=(0xae3+349-0xc40);unsigned long s=(0x13e9+1312-0x1909);unsigned long 
+is_find=(0xd1c+5342-0x21fa);s=sizeof(zte_sms_GSMDefault_To_UCS2_Table_Ex)/sizeof
+(zte_sms_GSMDefault_To_UCS2_Table_Ex[(0x82f+1940-0xfc3)]);for(i=
+(0x1e59+800-0x2179);i<len;i++){j=gsmdef[i];if(j==(0xc6d+3796-0x1b26)){i++;for(p=
+(0xf4b+2945-0x1acc);p<s;p++){if(zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
+(0x995+670-0xc33)]==gsmdef[i]){ucs2[k]=zte_sms_GSMDefault_To_UCS2_Table_Ex[p][
+(0x4cb+7006-0x2028)]>>(0x331+470-0x4ff);k++;ucs2[k]=(unsigned char)(
+zte_sms_GSMDefault_To_UCS2_Table_Ex[p][(0xa3c+2752-0x14fb)]);is_find=
+(0x8c3+1184-0xd62);break;}}if(!is_find){at_print(LOG_DEBUG,
+"\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]>>(0x652+347-0x7a5);k
+++;ucs2[k]=(unsigned char)(zte_sms_GSMDefault_To_UCS2_Table[j]);}}else{ucs2[k]=
+zte_sms_GSMDefault_To_UCS2_Table[j]>>(0x159d+43-0x15c0);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[(0x4e4+7604-0x2296)*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX+
+(0x1f43+1579-0x256d)]={(0x26b+267-0x376)};UINT16 len=(0x1290+2694-0x1d16);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[(0x2bb+6895-0x1da9)+(0x3a2+6652-0x1cfe)+(0xa98+5718-0x20ed)]={
+(0xb5a+2595-0x157d)};int len=(0xf27+394-0x10b1);if(msg_content==NULL||
+out_content==NULL||sms_len>(0x1a3d+986-0x1cd7)||sms_len<(0x1923+2378-0x226b)){
+return endEsc;}len=sms_len;memset(data,(0xb07+6111-0x22e6),(0x9f2+1745-0x1021));
+p=data;if(isEsc){*p=(0x141c+519-0x1608);p++;}zUfiSms_Str2Bytes((unsigned char*)
+msg_content,len,(unsigned char*)p,(0xf41+5478-0x2407));if(p[len/
+(0xe3a+1266-0x132a)-(0x31+7294-0x1cae)]==(0xe14+4742-0x207f)){endEsc=TRUE;}
+zUfiSms_ConvertUcs2(data,len/(0x9d7+3061-0x15ca)+(isEsc?(0x18c9+855-0x1c1f):
+(0x1b9f+254-0x1c9d))-(endEsc?(0x8a8+4701-0x1b04):(0x633+7394-0x2315)),
+out_content);return endEsc;}byte*zUfiSms_SmsiUtilitoa(uint32 v,byte*s,UINT16 r){
+byte buf[(0x16a0+1565-0x1c9c)],c;int n;n=sizeof(buf)-(0xa42+171-0xaec);buf[n]=
+'\0';do{c=(byte)(v%r);if(n<=(0x39f+4111-0x13ae)){printf(
+"\x4f\x56\x45\x52\x46\x4c\x4f\x57\x20");break;}buf[--n]=(byte)((c>
+(0x6d5+5404-0x1be8))?c+((char)(0x123d+4776-0x24a4))-(0x40a+2099-0xc33):c+
+((char)(0xcf7+1990-0x148d)));}while((v/=r)>(0xbd2+2613-0x1607));while((*s++=buf[
+n++])!=(0xb7c+2450-0x150e));return(s-(0x9f1+326-0xb36));}byte*
+zUfiSms_SmsiAddrToStr(wms_address_s_type addr,byte*res_ptr,UINT8*type_of_addr){
+byte bcd_idx=(0x92d+1164-0xdb9);UINT8 temp=(0xb4d+2882-0x168f);*type_of_addr=
+(0x51f+606-0x77d);temp=(UINT8)((uint32)addr.number_type&(0xdcb+2009-0x159d));*
+type_of_addr=(UINT8)((*type_of_addr|temp)<<(0x9d2+4254-0x1a6c));temp=(UINT8)((
+uint32)addr.number_plan&(0x9db+3955-0x1947));*type_of_addr=*type_of_addr|temp;*
+type_of_addr=*type_of_addr|(0xd62+5217-0x2143);while(bcd_idx<addr.
+number_of_digits){if(addr.digits[bcd_idx]==(0x11ac+2270-0x1a80)){addr.digits[
+bcd_idx]=(0x1ad3+2666-0x253d);}res_ptr=zUfiSms_SmsiUtilitoa((uint32)addr.digits[
+bcd_idx],res_ptr,(0x594+3749-0x1429));bcd_idx++;}return res_ptr;}byte*
+zUfiSms_SmsiUtilitoaFill(word v,byte*rb_ptr){int n;byte c,*ptr;ptr=rb_ptr+
+(0xb24+4964-0x1e86);*ptr='\0';for(n=(0x41c+1992-0xbe4);n<(0x310+1134-0x77c);++n)
+{c=(byte)(v%(0x7c9+6469-0x2104));v/=(0xfa8+1677-0x162b);*--ptr=(c+
+((char)(0xceb+4482-0x1e3d)));}return rb_ptr+(0xb36+6886-0x261a);}void 
+zUfiSms_SprintfTime(char*str_time,int len,int t){if(t<(0x1510+2262-0x1ddc)){
+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=(0xe60+5788-0x24fc);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=(0x16f7+1411-0x1c79);db_data->concat_info[
+(0x204+4250-0x129e)]=(0x77d+2123-0xec9)*mux+concat_8->msg_ref;db_data->
+concat_info[(0xb00+5445-0x2043)]=concat_8->seq_num%ZTE_WMS_CONCAT_SMS_COUNT_MAX+
+(0xa0d+5315-0x1ecf);db_data->concat_info[(0xe43+3393-0x1b83)]=concat_8->total_sm
+-ZTE_WMS_CONCAT_SMS_COUNT_MAX*mux>ZTE_WMS_CONCAT_SMS_COUNT_MAX-
+(0x5ea+7958-0x24ff)?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=(0x1aef+2531-0x24d2);concat_16->seq_num--
+;db_data->concat_sms=(0x1ee8+1663-0x2566);
+#if (0xfa0+494-0x118e)

+db_data->concat_info[(0x2038+247-0x212f)]=concat_16->msg_ref;db_data->
+concat_info[(0xf4a+5755-0x25c4)]=concat_16->total_sm;db_data->concat_info[
+(0x1b8+2115-0x9f9)]=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[(0x1d0+6786-0x1c52)]=(0x318+4582-0x13ff)*mux+concat_16->
+msg_ref;db_data->concat_info[(0x1bf4+1851-0x232d)]=concat_16->seq_num%
+ZTE_WMS_CONCAT_SMS_COUNT_MAX+(0x12ff+2568-0x1d06);db_data->concat_info[
+(0xb1a+5609-0x2102)]=concat_16->total_sm-ZTE_WMS_CONCAT_SMS_COUNT_MAX*mux>
+ZTE_WMS_CONCAT_SMS_COUNT_MAX-(0x1d0+162-0x271)?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=
+(0x322+5940-0x1a55);zUfiSms_ParseDeliverConcat8(&(user_data_header->u.concat_8),
+db_data);break;case WMS_UDH_CONCAT_16:db_data->concat_sms=(0xf16+5144-0x232d);
+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=(0x376+6528-0x1cf6);int ind=(0x120a+1353-0x1753);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,
+(0xa93+5959-0x21da),ZTE_WMS_ADDRESS_LEN_MAX+(0x196c+46-0x1999));db_data->number[
+(0x6bd+5378-0x1bbf)]=((char)(0x37f+8904-0x261c));for(i=(0x50+3684-0xeb4);i<
+address_ptr->number_of_digits;i++){if((0xdab+269-0xeae)==address_ptr->digits[i])
+{db_data->number[i+(0xf90+4937-0x22d8)]=((char)(0x24ed+47-0x24ec));}else{db_data
+->number[i+(0x400+5258-0x1889)]=((char)(0x10aa+4277-0x212f))+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[(0xe83+2912-0x19e2)
+]),address_ptr->digits,address_ptr->number_of_digits);}else{for(i=
+(0x129f+2873-0x1dd8);i<address_ptr->number_of_digits;i++){if((0x3a3+6656-0x1d99)
+==address_ptr->digits[i]){db_data->number[i]=((char)(0xd2c+5449-0x2245));}else{
+db_data->number[i]=((char)(0x18ff+491-0x1aba))+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=(0x16ff+1543-0x1d05);}else{db_data->
+tp_udhi=(0x23c4+457-0x258d);}if(db_data->tp_udhi==(0x8c2+7143-0x24a8)){for(ind=
+(0x885+6755-0x22e8);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[
+(0x1c2f+1550-0x223c)]){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[(0x51d+4611-0x171f)],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)
+(0x302+4607-0x1500);}else if(WMS_GW_ALPHABET_UCS2==tp_dcs){db_data->tp_dcs=(
+unsigned char)(0x1373+1572-0x1995);}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=(0x158c+4208-0x25fc);ind<ts_data_ptr->u
+.gw_pp.u.deliver.user_data.sm_len;ind++){db_data->sms_content[
+(0x869+4815-0x1b34)*ind]=((char)(0xc94+2137-0x14bd));db_data->sms_content[
+(0x62a+8253-0x2663)*ind+(0xed1+3084-0x1adc)]=((char)(0x22bf+958-0x264d));db_data
+->sms_content[(0x361+4192-0x13bd)*ind+(0xcb5+1069-0x10e0)]=g_zUfiSms_DigAscMap[(
+(ts_data_ptr->u.gw_pp.u.deliver.user_data.sm_data[ind]&(0x151c+4771-0x26cf))>>
+(0x72d+4676-0x196d))];db_data->sms_content[(0x882+6746-0x22d8)*ind+
+(0x36a+6882-0x1e49)]=g_zUfiSms_DigAscMap[(ts_data_ptr->u.gw_pp.u.deliver.
+user_data.sm_data[ind]&(0x533+5829-0x1be9))];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)(0x55a+469-0x72d);}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=
+(0x460+8702-0x265e);int ind=(0xa58+803-0xd7b);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[
+(0xb44+1002-0xf2e)]=((char)(0x6b5+2327-0xfa1));for(i=(0x9d3+2722-0x1475);i<
+address_ptr->number_of_digits;i++){if((0x210c+463-0x22d1)==address_ptr->digits[i
+]){db_data->number[i+(0x1821+2253-0x20ed)]=((char)(0x178a+610-0x19bc));}else{
+db_data->number[i+(0x820+3210-0x14a9)]=((char)(0x2256+1078-0x265c))+address_ptr
+->digits[i];}}}else{for(i=(0x13b6+1066-0x17e0);i<address_ptr->number_of_digits;i
+++){if((0x1e21+2011-0x25f2)==address_ptr->digits[i]){db_data->number[i]=
+((char)(0x94+7176-0x1c6c));}else{db_data->number[i]=((char)(0xd9c+2473-0x1715))+
+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)
+(0xe72+5642-0x247b);}else if(WMS_GW_ALPHABET_UCS2==tp_dcs){db_data->tp_dcs=(
+unsigned char)(0x12a6+4848-0x2594);}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=
+(0x2b7+8477-0x23d3);}else{db_data->tp_udhi=(0xda6+5827-0x2469);}if(db_data->
+tp_udhi==(0x17f2+2328-0x2109)){for(ind=(0xe5c+3417-0x1bb5);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[(0xc30+4860-0x1f2b)]){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=(0xc15+5549-0x21c2);
+ind<ts_data_ptr->u.gw_pp.u.submit.user_data.sm_len;ind++){db_data->sms_content[
+(0x173f+2821-0x2240)*ind]=((char)(0x355+3022-0xef3));db_data->sms_content[
+(0x6fd+1633-0xd5a)*ind+(0x139d+1343-0x18db)]=((char)(0x40a+3535-0x11a9));db_data
+->sms_content[(0x176c+660-0x19fc)*ind+(0x303+4058-0x12db)]=g_zUfiSms_DigAscMap[(
+(ts_data_ptr->u.gw_pp.u.submit.user_data.sm_data[ind]&(0x1c90+2162-0x2412))>>
+(0xe68+5895-0x256b))];db_data->sms_content[(0xdea+765-0x10e3)*ind+
+(0xe67+2106-0x169e)]=g_zUfiSms_DigAscMap[(ts_data_ptr->u.gw_pp.u.submit.
+user_data.sm_data[ind]&(0x1f40+1657-0x25aa))];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)(0x3df+4127-0x13fc);}return result;}int InvertNumbers(
+const char*pSrc,char*pDst,int nSrcLength){int nDstLength;char ch;int i=
+(0xf87+4277-0x203c);if(pSrc==NULL||pDst==NULL||nSrcLength<(0x2248+1002-0x2632)){
+return-(0x1c8d+1650-0x22fe);}nDstLength=nSrcLength;for(i=(0xcc5+718-0xf93);i<
+nSrcLength;i+=(0x10c2+5270-0x2556)){ch=*pSrc++;*pDst++=*pSrc++;*pDst++=ch;}if(
+nSrcLength&(0x2+9904-0x26b1)){*(pDst-(0xa98+6226-0x22e8))=
+((char)(0x768+1322-0xc4c));nDstLength++;}*pDst='\0';return nDstLength;}int 
+code_is_gsm7(const SMS_PARAM*pSrc,unsigned char buf[],int nLength){if(pSrc->
+TP_UDHI==(0x1b92+2230-0x2447)){buf[(0x1922+827-0x1c5a)]=(unsigned char)nLength;
+buf[(0x162f+2073-0x1e44)]=(unsigned char)pSrc->TP_UD[(0x190c+937-0x1cb5)];buf[
+(0x16c5+3609-0x24d9)]=(0x1eaa+16-0x1eba);buf[(0x14fa+1378-0x1a56)]=(unsigned 
+char)pSrc->TP_UD[(0x215d+708-0x241f)];buf[(0x210a+431-0x22b2)]=(unsigned char)
+pSrc->TP_UD[(0x558+6767-0x1fc4)];buf[(0xa19+6600-0x23d9)]=(unsigned char)pSrc->
+TP_UD[(0x830+7206-0x2452)];buf[(0x19f+6471-0x1add)]=(unsigned char)pSrc->TP_UD[
+(0x1ea+898-0x567)];buf[(0xc97+5009-0x201e)]=(unsigned char)pSrc->TP_UD[
+(0xe1a+3835-0x1d0e)];buf[(0xf10+1556-0x151a)]=(unsigned char)(buf[
+(0x16f7+4117-0x2702)]<<(0x3c3+2153-0xc2b));nLength=nLength-(0x71+6277-0x18ef);
+nLength=Encode7bit(&(pSrc->TP_UD[(0xe31+5949-0x2566)]),&buf[(0x21c8+951-0x2574)]
+,nLength+(0x197+5128-0x159e))+(0xd6f+1466-0x1325)+(0x1776+933-0x1b15);
+#if (0x187+7156-0x1d7b)
+nLength+=(0x5e1+1835-0xd0a);
+#endif

+}else{nLength=pSrc->TP_UDLength;buf[(0xe4+3570-0xed3)]=nLength;nLength=
+Encode7bit(pSrc->TP_UD,&buf[(0xdc6+3651-0x1c05)],nLength+(0x1fc5+1206-0x247a))+
+(0x8ca+7504-0x2616);}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==(0x1d55+774-0x205a)){buf[
+(0x18fa+893-0x1c74)]=(unsigned char)nLength;buf[(0x1d5+548-0x3f5)]=(unsigned 
+char)pSrc->TP_UD[(0x14e9+346-0x1643)];buf[(0x1764+836-0x1aa3)]=
+(0xe00+2514-0x17d2);buf[(0x422+4605-0x1619)]=(unsigned char)pSrc->TP_UD[
+(0x10f+7830-0x1fa3)];buf[(0x17d+4015-0x1125)]=(unsigned char)pSrc->TP_UD[
+(0x17ec+1072-0x1c19)];buf[(0x194d+500-0x1b39)]=(unsigned char)pSrc->TP_UD[
+(0xb88+5128-0x1f8c)];buf[(0xcfd+234-0xdde)]=(unsigned char)pSrc->TP_UD[
+(0x12cd+107-0x1333)];buf[(0x132d+1980-0x1ae6)]=(unsigned char)(EncodeUcs2(&(pSrc
+->TP_UD[(0x1059+4971-0x23be)]),&buf[(0x1783+2827-0x2284)],nLength-
+(0xd2+441-0x285))+(0x1b97+2351-0x24c0));nLength=buf[(0x2440+137-0x24c6)]+
+(0x976+147-0xa05);}else{buf[(0x381+6753-0x1ddf)]=EncodeUcs2(pSrc->TP_UD,&buf[
+(0x224+9147-0x25db)],nLength);nLength=buf[(0x1397+1822-0x1ab2)]+
+(0x905+2135-0x1158);}return nLength;}int Encode8bit(const char*pSrc,unsigned 
+char*pDst,int nSrcLength){if(pSrc==NULL||pDst==NULL||nSrcLength<
+(0x2f4+8964-0x25f8)){return-(0x12e3+801-0x1603);}memcpy(pDst,pSrc,nSrcLength);
+return nSrcLength;}int EncodePdu_Submit(const SMS_PARAM*pSrc,char*pDst){int 
+nLength=(0x98d+1320-0xeb5);int nDstLength=(0x3d7+3579-0x11d2);unsigned char buf[
+(0x136+7997-0x1f73)]={(0x34+3452-0xdb0)};char tmpSCA[(0x112f+4312-0x21e3)]={
+(0xe24+2416-0x1794)};int check_udl=(0x927+6403-0x222a);memset(tmpSCA,
+(0x25e6+284-0x2702),sizeof(tmpSCA));if(pSrc==NULL||pDst==NULL){return-
+(0xfe6+4458-0x214f);}
+#if (0x8f6+4269-0x19a2)
+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[(0xb01+4137-0x1b2a)]=(char)(((nLength)&
+(0x8e5+362-0xa4e))==(0x42a+1043-0x83d)?(nLength):nLength+(0x13a7+2690-0x1e28))/
+(0x98c+1300-0xe9e)+(0xa74+3277-0x1740);buf[(0xf50+3288-0x1c27)]=
+(0x10c2+5623-0x2638);strncpy(tmpSCA,pSrc->SCA,sizeof(tmpSCA)-(0x450+2753-0xf10))
+;if(!(strncmp(pSrc->SCA,"\x30\x30\x38\x36",(0x1330+3098-0x1f46)))){memset(tmpSCA
+,(0x34a+2724-0xdee),sizeof(tmpSCA));nLength=nLength-(0xb6+5008-0x1445);
+#if (0xcac+1693-0x1348)
+nLength=nLength-(0x23c+4034-0x11fd);strncpy(tmpSCA,&(pSrc->SCA[
+(0x16e2+1518-0x1cce)]),sizeof(tmpSCA)-(0x297+731-0x571));
+#else

+tmpSCA[(0x189f+252-0x199b)]=((char)(0x2073+880-0x23b8));strcpy(&(tmpSCA[
+(0x969+728-0xc40)]),&(pSrc->SCA[(0xbd3+82-0xc23)]));
+#endif

+buf[(0x3f4+2304-0xcf4)]=(char)((nLength&(0x6a9+8212-0x26bc))==
+(0x18d9+1120-0x1d39)?nLength:nLength+(0x136a+1711-0x1a18))/(0xdd1+1127-0x1236)+
+(0xe21+601-0x1079);buf[(0x7b+1206-0x530)]=(0x13af+1035-0x1729);}else if(
+((char)(0xa82+5511-0x1fde))==pSrc->SCA[(0x976+5542-0x1f1c)]){memset(tmpSCA,
+(0x148d+1970-0x1c3f),sizeof(tmpSCA));
+#if (0x1348+4834-0x2629)
+nLength=nLength-(0x5d+2250-0x926);strncpy(tmpSCA,&(pSrc->SCA[(0x39a+880-0x709)])
+,sizeof(tmpSCA)-(0x75+5172-0x14a8));
+#else

+strcpy(tmpSCA,pSrc->SCA);
+#endif

+buf[(0x79d+2313-0x10a6)]=(char)((nLength&(0x1d4+3054-0xdc1))==
+(0x1b43+834-0x1e85)?(nLength):nLength+(0x2673+67-0x26b5))/(0x4ea+5768-0x1b70)+
+(0x798+7767-0x25ee);buf[(0x1c2c+1204-0x20df)]=(0x8bc+836-0xb6f);}
+#if (0x809+7113-0x23d1)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x70\x64\x73\x74\x32\x3a\x25\x73" "\n",
+pDst);
+#endif

+if(nLength<(0xe8d+6031-0x261b)||nLength>=sizeof(tmpSCA))return-
+(0x612+5402-0x1b2b);nDstLength=Bytes2String(buf,pDst,(0x96d+7346-0x261d));
+nDstLength+=InvertNumbers(tmpSCA,&pDst[nDstLength],nLength);
+#if (0x1185+5264-0x2614)
+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[(0xf3+6647-0x1aea)]==((char)(0xc43+4906-0x1f42))){nLength=strlen(&(
+pSrc->TPA[(0x526+8259-0x2568)]));}else{nLength=strlen(pSrc->TPA);}if(pSrc->
+TP_UDHI==(0x2292+988-0x266e)){if(pSrc->TP_SRR==(0x62b+7850-0x24d5)){buf[
+(0xa2a+3806-0x1908)]=(0x105f+1439-0x15ed);}if(pSrc->TP_SRR==(0x14c2+3547-0x229c)
+){buf[(0x9b7+5193-0x1e00)]=(0x988+2155-0x11c2);}}if(pSrc->TP_UDHI==
+(0x6c9+7306-0x2352)){if(pSrc->TP_SRR==(0xd68+3913-0x1cb1)){buf[
+(0x210+1822-0x92e)]=(0x81b+5232-0x1c3a);}if(pSrc->TP_SRR==(0xa83+6670-0x2490)){
+buf[(0x1fa+4579-0x13dd)]=(0x976+3952-0x1875);}}buf[(0x1811+1398-0x1d86)]=
+(0x463+8081-0x23f4);buf[(0x98d+6871-0x2462)]=(char)nLength;if(pSrc->TPA[
+(0xbb8+1098-0x1002)]==((char)(0x13aa+1663-0x19fe))){buf[(0xae2+3431-0x1846)]=
+(0xae8+5333-0x1f2c);nDstLength+=Bytes2String(buf,&pDst[nDstLength],
+(0xfc4+4788-0x2274));nDstLength+=InvertNumbers(&(pSrc->TPA[(0x4a4+6728-0x1eeb)])
+,&pDst[nDstLength],nLength);}else if(!(strncmp(pSrc->TPA,"\x30\x30\x38\x36",
+(0xa2a+1460-0xfda)))){buf[(0xa34+151-0xac9)]=(char)nLength-(0xa16+3536-0x17e4);
+buf[(0x124c+214-0x131f)]=(0xf87+1266-0x13e8);nDstLength+=Bytes2String(buf,&pDst[
+nDstLength],(0x1e9f+1711-0x254a));nDstLength+=InvertNumbers(&(pSrc->TPA[
+(0xc53+3594-0x1a5b)]),&pDst[nDstLength],nLength-(0x255f+116-0x25d1));}else{buf[
+(0xe9+2917-0xc4b)]=(0x879+4114-0x180a);nDstLength+=Bytes2String(buf,&pDst[
+nDstLength],(0x2b0+3037-0xe89));nDstLength+=InvertNumbers(pSrc->TPA,&pDst[
+nDstLength],nLength);}
+#if (0x1556+889-0x18ce)
+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[(0xfcb+5526-0x2561)]=pSrc->TP_PID;buf[
+(0x1479+2226-0x1d2a)]=pSrc->TP_DCS;buf[(0x48c+5977-0x1be3)]=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==(0xa65+3462-0x17ea)){buf[(0xbda+3579-0x19d2)]=(
+unsigned char)nLength;buf[(0x7a5+4766-0x1a3f)]=(unsigned char)pSrc->TP_UD[
+(0xda5+1398-0x131b)];buf[(0x1800+1468-0x1db7)]=(0x1c05+529-0x1e16);buf[
+(0xd67+4174-0x1daf)]=(unsigned char)pSrc->TP_UD[(0x3a8+1494-0x97c)];buf[
+(0x1b4f+2665-0x25b1)]=(unsigned char)pSrc->TP_UD[(0x13d9+803-0x16f9)];buf[
+(0x1786+457-0x1947)]=(unsigned char)pSrc->TP_UD[(0x1b0d+1556-0x211d)];buf[
+(0x19a7+1338-0x1ed8)]=(unsigned char)pSrc->TP_UD[(0x2a9+458-0x46e)];if(nLength-
+(0x29c+3173-0xefb)<=(0xb3d+7027-0x26b0)||nLength-(0x1454+2345-0x1d77)>=sizeof(
+buf)-(0x153+7652-0x1f2d))return-(0xf81+5502-0x24fe);buf[(0xe7+3152-0xd34)]=(
+unsigned char)(Encode8bit(&(pSrc->TP_UD[(0x7d9+4068-0x17b7)]),&buf[
+(0x1675+398-0x17f9)],(unsigned short)(nLength-(0x8f7+4169-0x193a)))+
+(0x9fd+7062-0x258d));nLength=buf[(0x12ac+8-0x12b1)]+(0xb7f+5098-0x1f65);}else{if
+(nLength<=(0x19d+3530-0xf67)||nLength>=sizeof(buf)-(0x13bc+4660-0x25ec))return-
+(0x1aeb+2758-0x25b0);buf[(0x93a+682-0xbe1)]=Encode8bit(pSrc->TP_UD,&buf[
+(0x391+7281-0x1ffe)],nLength);nLength=buf[(0x1ed6+397-0x2060)]+
+(0xc37+2843-0x174e);}}check_udl=nLength-(0x736+358-0x898);nDstLength+=
+Bytes2String(buf,&pDst[nDstLength],nLength);sc_cfg_set(NV_CHECK_UDL,"");if(
+check_udl>(0x999+3899-0x1848)){sc_cfg_set(NV_CHECK_UDL,"\x65\x72\x72\x6f\x72");}
+#if (0x5c2+374-0x737)
+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 (0x538+6694-0x1f5d)
+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<(0xf87+3793-0x1e58)){return-(0xf99+3794-0x1e6a);}nSrc=
+(0xcb+9528-0x2603);nDst=(0x53+7348-0x1d07);nByte=(0xd7d+3775-0x1c3c);nLeft=
+(0x598+2497-0xf59);while(nSrc<nSrcLength){*pDst=((*pSrc<<nByte)|nLeft)&
+(0x1bb8+347-0x1c94);nLeft=*pSrc>>((0x1cd1+2105-0x2503)-nByte);pDst++;nDst++;
+nByte++;if(nByte==(0x834+5856-0x1f0d)){*pDst=nLeft;pDst++;nDst++;nByte=
+(0xa82+3269-0x1747);nLeft=(0x1a27+330-0x1b71);}pSrc++;nSrc++;}*pDst='\0';return 
+nDst;}int DecodePushPdu(const char*pSrcPdu,SMS_PARAM*pDst){int nDstLength=
+(0x21+75-0x6c);unsigned char tmp=(0x585+73-0x5ce);int ud_length=
+(0x3e8+1640-0xa50);unsigned char buf[(0x11c1+4981-0x2436)]={(0x1784+469-0x1959)}
+;char temp_num[(0x1b49+1844-0x2219)]={(0x2f2+651-0x57d)};unsigned char 
+first_octet=(0xe64+2067-0x1677);unsigned char udhl=(0xc3b+2204-0x14d7);unsigned 
+int halftmp=(0xa4c+3910-0x1992);char tp_ra[(0x484+555-0x6ac)]={
+(0x1b4a+1220-0x200e)};int tmplen=(0x59+6469-0x199e);unsigned char IEIDL;int 
+pushType=(0x192+349-0x2ef);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-(0xe36+4961-0x2196);}String2Bytes(pSrc,&tmp,(0x4d0+8314-0x2548));
+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==(0x121+1095-0x568)){pSrc+=(0x16f3+2113-0x1f32);}else{tmp=(tmp-
+(0x56f+8058-0x24e8))*(0x51f+2548-0xf11);pSrc+=(0x488+400-0x614);if(tmp>
+(0x7e4+7561-0x254d)){SerializeNumbers_sms(pSrc,pDst->SCA,(0xcaa+2524-0x1666));
+tmp=(0xabb+2800-0x158b);}else{SerializeNumbers_sms(pSrc,pDst->SCA,tmp);}pSrc+=
+tmp;}String2Bytes(pSrc,&tmp,(0x418+3428-0x117a));first_octet=tmp;pSrc+=
+(0xc41+1705-0x12e8);String2Bytes(pSrc,&tmp,(0x3f6+6384-0x1ce4));halftmp=tmp;if(
+tmp&(0x70+454-0x235))tmp+=(0x42+5628-0x163d);pSrc+=(0xf3+7415-0x1de8);memset(
+tp_ra,(0x139a+4980-0x270e),sizeof(tp_ra));String2Bytes(pSrc,tp_ra,
+(0x1387+3435-0x20f0));pSrc+=(0x1136+333-0x1281);if((tp_ra[(0x30a+7401-0x1ff3)]&
+(0x1254+2928-0x1d74))==(0x75c+1781-0xe01)){char tempra[(0xc5f+5736-0x2247)];char
+ acAsc[(0x2d8+918-0x5ee)];if(halftmp>=(0x8a4+4862-0x1b94)){halftmp=(tmp/
+(0x1f13+1593-0x254a))/(0x38a+7388-0x205f)+(tmp/(0x140f+4105-0x2416));}else{
+halftmp=tmp/(0x733+2436-0x10b5);}memset(tempra,(0x891+1277-0xd8e),sizeof(tempra)
+);memcpy(tempra,pSrc,tmp);memset(acAsc,(0x857+1352-0xd9f),sizeof(acAsc));
+nDstLength=String2Bytes(tempra,buf,halftmp&(0xa+1248-0x4e3)?(int)halftmp*
+(0xb0d+1363-0x1059)/(0x85b+1065-0xc80)+(0x348+5341-0x1823):(int)halftmp*
+(0xe6f+5884-0x2564)/(0x104+9021-0x243d));halftmp=Decode7bit(buf,acAsc,nDstLength
+);memset(pDst->TPA,(0x8eb+6697-0x2314),sizeof(pDst->TPA));if(halftmp>
+(0x12b+7923-0x1ffe)){memcpy(pDst->TPA,acAsc,(0x301+5192-0x1729));tmp=
+(0x113a+2854-0x1c40);}else{memcpy(pDst->TPA,acAsc,halftmp);}}else{if(tmp>
+(0x124+1239-0x5db)){SerializeNumbers_sms(pSrc,pDst->TPA,(0x1d4a+2079-0x2549));}
+else{SerializeNumbers_sms(pSrc,pDst->TPA,tmp);}if((tp_ra[(0x68f+4039-0x1656)]&
+(0xa01+616-0xbd8))==(0x1329+2029-0x1a85)){memset(temp_num,(0x212a+1196-0x25d6),
+sizeof(temp_num));if(pDst->TPA[(0x3e3+771-0x6e6)]!=((char)(0x13d2+4628-0x25bb)))
+{snprintf(temp_num,sizeof(temp_num),"\x25\x73\x25\x73","\x2b",pDst->TPA);if(
+strlen(temp_num)>(0x155f+4263-0x25e6)){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,(0x5e2+7739-0x241b));pSrc+=(0xccc+399-0xe59);String2Bytes(pSrc,(unsigned 
+char*)&pDst->TP_DCS,(0x10c6+3883-0x1fef));pSrc+=(0x97+5472-0x15f5);
+SerializeNumbers_sms(pSrc,pDst->TP_SCTS,(0xcd0+5322-0x218c));pSrc+=
+(0xb37+3856-0x1a39);String2Bytes(pSrc,&tmp,(0xe22+1076-0x1254));pSrc+=
+(0x1933+635-0x1bac);memset(pDst->TP_UD,(0x500+7719-0x2327),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&(0x1ee9+1299-0x23bc)){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,(0x7fd+3690-0x1665));temp+=
+(0xca2+5609-0x2289);tmplen=String2Bytes(temp,&pDst->TP_IEI,(0xc6f+2050-0x146f));
+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==(0x142+1832-0x865)){temp+=(0x433+6001-0x1ba2)*
+tmplen+(0x2f4+7377-0x1fc3);tmplen=String2Bytes(temp,&DestPort1,
+(0x78a+4803-0x1a4b));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+=(0x1972+1081-0x1da9)*tmplen;tmplen=String2Bytes(temp,&
+DestPort2,(0xb44+808-0xe6a));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==(0x19d+9104-0x2522))&&((DestPort2==
+(0xcd6+2216-0x14fa))||(DestPort2==(0xa47+3109-0x15e7)))){pushType=SMS_PUSH;}}if(
+SMS_PUSH!=pushType){return pushType;}temp=pSrc+udhl*(0x7c4+3735-0x1659)+
+(0x7cb+7401-0x24b0);tmplen=String2Bytes(temp,&pduType,(0x7ef+6939-0x2308));if(
+pduType==(0x923+68-0x961)){pushType=SMS_PUSH;temp+=(0x9c5+6684-0x23dd);tmplen=
+String2Bytes(temp,&pduType,(0x717+5457-0x1c66));if(pduType==(0x1570+4429-0x25f9)
+){pushType=SMS_NOTIFICATION;}else{temp+=(0x1f6+6602-0x1bbc);tmplen=String2Bytes(
+temp,&pduType,(0x1e70+1696-0x250e));if((pduType==(0xd01+22-0xc55))||(pduType==
+(0x2e7+6699-0x1c5c))){pushType=SMS_BOOTSTRAP;}}}if((pDst->TP_IEI==
+(0x1476+1908-0x1be6))||(pDst->TP_IEI==(0x10a6+5685-0x26d6))||(pDst->TP_IEI==
+(0x1439+2686-0x1eaf))){temp=pSrc+(0x1675+2357-0x1fa6);tmplen=String2Bytes(temp,&
+IEIDL,(0x1611+2754-0x20d1));if(IEIDL==(udhl-(0x95c+44-0x986))){}else{temp+=
+(0x1489+638-0x1705)*(0x1473+877-0x17da);tmplen=String2Bytes(temp,&udhLen,
+(0x497+5543-0x1a3c));if(udhLen==(0x6a0+1564-0xcb9)){temp+=(0x2158+1387-0x26c1)*
+tmplen;tmplen=String2Bytes(temp,&RefNum1,(0x2241+970-0x2609));pDst->TP_ReferNum=
+RefNum1;temp+=(0x15e8+2948-0x216a)*tmplen;tmplen=String2Bytes(temp,&pDst->
+TP_AllPieceNum,(0x617+980-0x9e9));temp+=(0xca6+1366-0x11fa)*tmplen;tmplen=
+String2Bytes(temp,&pDst->TP_CurrentPieceNum,(0x13c6+1879-0x1b1b));temp+=
+(0x1171+690-0x1421)*tmplen;}else if(udhLen==(0x7d7+1199-0xc82)){temp+=
+(0xd57+5715-0x23a8)*tmplen;tmplen=String2Bytes(temp,&RefNum1,(0x540+6403-0x1e41)
+);temp+=(0x2f4+1000-0x6da)*tmplen;tmplen=String2Bytes(temp,&RefNum2,
+(0x5da+6443-0x1f03));int ReferNum=RefNum2+RefNum1*(0x2108+1155-0x248b);pDst->
+TP_ReferNum=ReferNum;temp+=(0x733+7883-0x25fc)*tmplen;tmplen=String2Bytes(temp,&
+pDst->TP_AllPieceNum,(0xdb1+3157-0x1a04));temp+=(0xb50+5213-0x1fab)*tmplen;
+tmplen=String2Bytes(temp,&pDst->TP_CurrentPieceNum,(0x1b2d+2349-0x2458));temp+=
+(0x946+5224-0x1dac)*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*(0x1a87+2156-0x22f1)+
+(0x1b28+2958-0x26b0);tmplen=String2Bytes(temp,&wspLen,(0xc7b+5527-0x2210));temp=
+temp+wspLen*(0x931+2733-0x13dc)+(0x200f+1174-0x24a3);}else{temp=pSrc+udhl*
+(0x252+253-0x34d)+(0xe79+5671-0x249e);}nDstLength=((strlen(temp)<sizeof(pDst->
+TP_UD))?strlen(temp):(sizeof(pDst->TP_UD)-(0x742+28-0x75d)));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=(0x526+4460-0x1692);if(pSrc==
+NULL||pDst==NULL||nSrcLength<(0xee1+3666-0x1d33)){return-(0x70b+4277-0x17bf);}
+nDstLength=nSrcLength;for(i=(0x5b2+8155-0x258d);i<nSrcLength;i+=
+(0x758+3085-0x1363)){ch=*pSrc++;*pDst++=*pSrc++;*pDst++=ch;}if(*(pDst-
+(0xbd4+2261-0x14a8))==((char)(0x39d+2095-0xb86))){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=(0xd4b+1232-0x121b);
+UINT16 pos=(0xe7f+3339-0x1b8a);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(0xd64+3344-0x1a74);}shift%=(0x6b3+4386-0x17ce);if(shift!=
+(0x3c0+4322-0x14a2)){out[pos]|=(UINT8)(in[i]<<shift);shift=((0x1568+4097-0x2562)
+-shift)+(0x502+4340-0x15f5);if(shift==(0x1748+634-0x19bb)){shift=
+(0xe3+7829-0x1f78);i++;}pos++;}for(;pos<out_len_max&&i<in_len;pos++,i++){out[pos
+]=in[i]>>shift;if(i+(0x632+4586-0x181b)<in_len){out[pos]|=(UINT8)(in[i+
+(0xf5c+2189-0x17e8)]<<((0x230c+903-0x268c)-shift));shift++;if(shift==
+(0x11e9+227-0x12c5)){shift=(0x1220+364-0x138c);i++;}}}return pos;}UINT8 
+wms_ts_encode_address(const wms_address_s_type*addr,UINT8*data){UINT8 i,pos=
+(0xcab+6737-0x26fc);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(0x2086+1547-0x2691);}if(addr->number_type==
+WMS_NUMBER_ALPHANUMERIC){data[pos]=(UINT8)((addr->number_of_digits*
+(0x7c5+659-0xa51)+(0x2389+29-0x23a3))/(0x5ad+1655-0xc20));}else{data[pos]=addr->
+number_of_digits;}pos++;data[pos]=(0xbbd+4333-0x1c2a);data[pos]|=(UINT8)((UINT8)
+addr->number_type<<(0x46b+3337-0x1170));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,
+(0x11b8+4814-0x2486),WMS_GW_ADDRESS_MAX,&data[pos]);}else{for(i=
+(0x108a+5447-0x25d1);i<addr->number_of_digits;i++){data[pos]=(UINT8)(addr->
+digits[i++]&(0xb3b+4672-0x1d6c));{data[pos]|=(UINT8)(addr->digits[i]<<
+(0x420+7162-0x2016));}pos++;}}return pos;}UINT8 wms_ts_encode_dcs(const 
+wms_gw_dcs_s_type*dcs,UINT8*data){UINT8 pos=(0x1f12+903-0x2299);if(dcs->
+msg_waiting==WMS_GW_MSG_WAITING_NONE){data[pos]=dcs->is_compressed?
+(0x1c83+108-0x1ccf):(0xe52+4845-0x213f);data[pos]|=(dcs->msg_class!=
+WMS_MESSAGE_CLASS_NONE)?(0xfac+4296-0x2064):(0xbe7+5838-0x22b5);data[pos]|=dcs->
+alphabet<<(0x55c+7109-0x211f);data[pos]|=dcs->msg_class&(0xb15+2869-0x1647);}
+else if(dcs->msg_waiting==WMS_GW_MSG_WAITING_NONE_1111){data[pos]=
+(0x115b+2697-0x1af4);if(dcs->alphabet==WMS_GW_ALPHABET_8_BIT)data[pos]|=
+(0x1c72+568-0x1ea6);data[pos]|=dcs->msg_class&(0xb00+6529-0x247e);}else{if(dcs->
+msg_waiting==WMS_GW_MSG_WAITING_DISCARD){data[pos]=(0x24af+164-0x2493);}else if(
+dcs->msg_waiting==WMS_GW_MSG_WAITING_STORE&&dcs->alphabet==
+WMS_GW_ALPHABET_7_BIT_DEFAULT){data[pos]=(0xd1d+5802-0x22f7);}else{data[pos]=
+(0x11a6+791-0x13dd);}data[pos]|=(dcs->msg_waiting_active==TRUE)?
+(0xf88+1004-0x136c):(0x138b+1854-0x1ac9);data[pos]|=dcs->msg_waiting_kind&
+(0x145a+3806-0x2335);}pos++;return pos;}UINT8 wms_ts_bcd_to_int(const UINT8 bcd,
+UINT8*result){unsigned char low_bit=(bcd&(0xc78+6771-0x26dc));unsigned char 
+high_bit=((bcd&(0x119a+2573-0x1ab7))>>(0xbc6+1874-0x1314));if(low_bit>
+(0x3f2+7944-0x22f1)||high_bit>(0xb0+4798-0x1365)){at_print(LOG_DEBUG,
+"\x49\x6e\x76\x61\x6c\x69\x64\x20\x42\x43\x44\x20\x64\x69\x67\x69\x74\x21");*
+result=(0x769+7779-0x25cc);return FALSE;}else{*result=((bcd&(0x101f+583-0x1257))
++(((bcd&(0xa2c+4534-0x1af2))>>(0x13c7+3825-0x22b4))*(0x61+4124-0x1073)));return 
+TRUE;}}UINT8 wms_ts_encode_timestamp(const wms_timestamp_s_type*timestamp,UINT8*
+data){sint7 i;UINT8 pos=(0x996+6965-0x24cb),j;if(!wms_ts_bcd_to_int(timestamp->
+year,&j)){return(0x47f+5846-0x1b55);}data[pos]=((timestamp->year&
+(0x38b+8962-0x267e))<<(0xa2a+2990-0x15d4))+((timestamp->year&
+(0x11ca+5600-0x26ba))>>(0x36c+2055-0xb6f));pos++;if(wms_ts_bcd_to_int(timestamp
+->month,&j)){if(j>(0x675+7274-0x22d3)||j<(0x529+3937-0x1489)){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(0x68a+4922-0x19c4);}}else{return(0x1a5+5656-0x17bd);}data[pos]=((
+timestamp->month&(0x7e6+2138-0x1031))<<(0x13fd+2818-0x1efb))+((timestamp->month&
+(0x110+2214-0x8c6))>>(0x498+2781-0xf71));pos++;if(wms_ts_bcd_to_int(timestamp->
+day,&j)){if(j>(0x70f+5715-0x1d43)||j<(0xd63+4978-0x20d4)){at_print(LOG_DEBUG,
+"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);
+return(0x379+6551-0x1d10);}}else{return(0xe8a+523-0x1095);}data[pos]=((timestamp
+->day&(0xb8f+1456-0x1130))<<(0xbf+356-0x21f))+((timestamp->day&
+(0x1ebf+1959-0x2576))>>(0x1022+1733-0x16e3));pos++;if(wms_ts_bcd_to_int(
+timestamp->hour,&j)){if(j>(0x1c00+648-0x1e71)){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(0x777+5795-0x1e1a);}}else{return(0x1578+2788-0x205c);}data[pos]=((
+timestamp->hour&(0xd7+4436-0x121c))<<(0x1a62+413-0x1bfb))+((timestamp->hour&
+(0x179d+128-0x172d))>>(0x1c9d+2497-0x265a));pos++;if(wms_ts_bcd_to_int(timestamp
+->minute,&j)){if(j>(0x1c3+3872-0x10a8)){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(0x1061+3381-0x1d96);}}else{return(0x1c0c+1166-0x209a);}data[pos]=((
+timestamp->minute&(0x67a+2367-0xfaa))<<(0x379+4244-0x1409))+((timestamp->minute&
+(0x79d+6289-0x1f3e))>>(0x1b+6799-0x1aa6));pos++;if(wms_ts_bcd_to_int(timestamp->
+second,&j)){if(j>(0xe0a+3979-0x1d5a)){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(0x18bf+2570-0x22c9);}}else{return(0x36f+6748-0x1dcb);}data[pos]=((
+timestamp->second&(0x1b53+2750-0x2602))<<(0x8f3+1096-0xd37))+((timestamp->second
+&(0x540+1727-0xb0f))>>(0x1889+1559-0x1e9c));pos++;i=(sint7)timestamp->timezone;
+if(i>(0x7f3+2527-0x11a2)||i<-(0x1c51+1475-0x21e4)){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(0x12ab+25-0x12c4);}if(i>=(0x70b+4104-0x1713)){data[pos]=(UINT8)(((
+UINT8)(i%(0x21c5+434-0x236d)))<<(0x75a+2138-0xfb0));data[pos]|=(i/
+(0x81f+3089-0x1426));}else{i*=(-(0x1170+561-0x13a0));data[pos]=(UINT8)(((UINT8)(
+i%(0x39f+3408-0x10e5)))<<(0x4ba+6922-0x1fc0));data[pos]|=(i/(0x316+4390-0x1432))
+;data[pos]|=(0x173f+12-0x1743);}pos++;return pos;}UINT8 wms_ts_get_udh_length(
+const wms_udh_s_type*udh){UINT8 length=(0x1314+2353-0x1c45);if(udh!=NULL){switch
+(udh->header_id){case WMS_UDH_CONCAT_8:length=(0x4a3+8252-0x24de)+
+(0x892+4358-0x1997)+WMS_UDH_OCTETS_CONCAT8;break;case WMS_UDH_CONCAT_16:length=
+(0x7e8+2407-0x114e)+(0x67+8779-0x22b1)+WMS_UDH_OCTETS_CONCAT16;break;case 
+WMS_UDH_SPECIAL_SM:length=(0x14c+4601-0x1344)+(0x1c32+1484-0x21fd)+
+WMS_UDH_OCTETS_SPECIAL_SM;break;case WMS_UDH_PORT_8:length=(0x309+6812-0x1da4)+
+(0x1682+2997-0x2236)+WMS_UDH_OCTETS_PORT8;break;case WMS_UDH_PORT_16:length=
+(0x36a+4770-0x160b)+(0xf83+2759-0x1a49)+WMS_UDH_OCTETS_PORT16;break;case 
+WMS_UDH_SMSC_CONTROL:length=(0x182f+3059-0x2421)+(0x97+6410-0x19a0)+udh->u.other
+.header_length;break;case WMS_UDH_SOURCE:length=(0x460+8814-0x26cd)+
+(0x1064+3174-0x1cc9)+udh->u.other.header_length;break;case WMS_UDH_WCMP:length=
+(0x18df+3084-0x24ea)+(0x14+3601-0xe24)+udh->u.other.header_length;break;case 
+WMS_UDH_TEXT_FORMATING:if(!udh->u.text_formating.is_color_present){length=
+(0x16b7+2395-0x2011)+(0x1104+2247-0x19ca)+WMS_UDH_OCTETS_TEXT_FORMATTING;}else{
+length=(0x6f5+3028-0x12c8)+(0x85f+2632-0x12a6)+WMS_UDH_OCTETS_TEXT_FORMATTING+
+(0x2e9+6476-0x1c34);}break;case WMS_UDH_PRE_DEF_SOUND:length=(0x620+4005-0x15c4)
++(0xca2+4135-0x1cc8)+WMS_UDH_OCTETS_PRE_DEF;break;case WMS_UDH_USER_DEF_SOUND:
+length=(0x15c+4537-0x1314)+(0x561+1309-0xa7d)+udh->u.user_def_sound.data_length+
+(0x7f8+746-0xae1);break;case WMS_UDH_PRE_DEF_ANIM:length=(0x152c+2669-0x1f98)+
+(0x11ea+2246-0x1aaf)+WMS_UDH_OCTETS_PRE_DEF;break;case WMS_UDH_LARGE_ANIM:length
+=(0x81+6225-0x18d1)+(0x138+9074-0x24a9)+WMS_UDH_LARGE_BITMAP_SIZE*
+WMS_UDH_ANIM_NUM_BITMAPS+(0x2a+8788-0x227d);break;case WMS_UDH_SMALL_ANIM:length
+=(0x920+5031-0x1cc6)+(0x64+1396-0x5d7)+WMS_UDH_SMALL_BITMAP_SIZE*
+WMS_UDH_ANIM_NUM_BITMAPS+(0x2e2+2559-0xce0);break;case WMS_UDH_LARGE_PICTURE:
+length=(0x78c+2222-0x1039)+(0xa49+4751-0x1cd7)+WMS_UDH_LARGE_PIC_SIZE+
+(0x1ca4+1229-0x2170);break;case WMS_UDH_SMALL_PICTURE:length=
+(0x1d6c+1282-0x226d)+(0x82d+2616-0x1264)+WMS_UDH_SMALL_PIC_SIZE+
+(0x9a+7755-0x1ee4);break;case WMS_UDH_VAR_PICTURE:length=(0xa6a+2094-0x1297)+
+(0x1fb+49-0x22b)+(UINT8)(udh->u.var_picture.height*udh->u.var_picture.width/
+(0xffa+4295-0x20b9))+(0x1625+2826-0x212c);break;case WMS_UDH_RFC822:length=
+(0x251f+268-0x262a)+(0x10f2+3152-0x1d41)+WMS_UDH_OCTETS_RFC822;break;case 
+WMS_UDH_NAT_LANG_SS:length=(0xddb+5503-0x2359)+(0x12c+2089-0x954)+
+WMS_UDH_OCTETS_NAT_LANG_SS;break;case WMS_UDH_NAT_LANG_LS:length=
+(0x4e7+1277-0x9e3)+(0x407+8744-0x262e)+WMS_UDH_OCTETS_NAT_LANG_LS;break;case 
+WMS_UDH_USER_PROMPT:length=(0x592+5502-0x1b0f)+(0x16ba+40-0x16e1)+
+WMS_UDH_OCTETS_USER_PROMPT;break;case WMS_UDH_EXTENDED_OBJECT:length=
+(0xc9b+4250-0x1d34)+(0x1d5+436-0x388)+udh->u.eo.content.length;if(udh->u.eo.
+first_segment==TRUE){length+=WMS_UDH_OCTETS_EO_HEADER;}break;default:length=
+(0x18b4+2793-0x239c)+(0x71d+2209-0xfbd)+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=(0x134c+3895-0x2283);
+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(0x1772+2699-0x21fd);}if(num_headers>(0xa44+4176-0x1a94)){length+=
+(0x942+2684-0x13bd);for(i=(0x1d9c+80-0x1dec);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=(0xa93+3328-0x1793);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(0x14d6+3737-0x236f);}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*(0x321+7300-0x1f9e))+
+(0x1203+3095-0x1e13))/(0x1323+858-0x1675);}else{length+=user_data->sm_len;}
+return length;}static int wms_ts_encode_udh_concat_8(UINT8*udh){int pos=
+(0x48f+3960-0x1407);if(const_header->u.concat_8.total_sm==(0xd4c+2862-0x187a)||
+const_header->u.concat_8.seq_num==(0x557+2904-0x10af)||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(0xe05+5799-0x24ac);}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=(0x35+9534-0x2573);if(const_header
+->u.concat_16.total_sm==(0xb1c+2875-0x1657)||const_header->u.concat_16.seq_num==
+(0x1e11+1177-0x22aa)||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(0x10e0+15-0x10ef);}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)>>(0x1ed5+442-0x2087));udh[pos++]=(UINT8
+)(const_header->u.concat_16.msg_ref&(0xe6d+5618-0x2360));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=(0xc21+3012-0x17e5);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=(0x7d5+7237-0x241a);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=
+(0x1f6+3051-0xde1);int pos=(0xccf+4933-0x2014);udh[pos++]=(UINT8)const_header->u
+.other.header_id;udh[pos++]=const_header->u.other.header_length;for(i=
+(0x9a+8609-0x223b);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=
+(0xc06+265-0xd0f);if(num_headers==(0x23d4+717-0x26a1))return(0x88+487-0x26f);++
+pos;for(i=(0xef6+3740-0x1d92);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 (0x10af+3011-0x1c72)

+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[
+(0x3a9+8753-0x25da)]=(UINT8)(pos-(0x10d5+294-0x11fa));return((UINT8)(pos-
+(0xf6f+383-0x10ed)));}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=
+(0x3df+1777-0xad0);UINT8 fill_bits=(0x18ab+2714-0x2345);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>(0x2cc+4061-0x12a9)){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+(0x559+3426-0x12ba);total_bits_occupied=(
+user_data_header_length+(0x1900+1001-0x1ce8))*(0xae9+3708-0x195d);fill_bits=(
+total_bits_occupied%(0x114+3590-0xf13));if(fill_bits!=(0xea4+513-0x10a5)){
+fill_bits=(0x37f+5344-0x1858)-fill_bits;}user_data_length=(total_bits_occupied+
+fill_bits+(user_data->sm_len*(0x5d0+7436-0x22d5)))/(0x7f+556-0x2a4);data[
+(0x5d9+3405-0x1326)]=(UINT8)user_data_length;data[(0x6e9+3075-0x12eb)]=
+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>
+(0xb1c+6061-0x22c9)){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[(0x5b7+5933-0x1ce4)]=(UINT8)(user_data->sm_len+user_data_header_length
++(0xf77+4243-0x2009));pos+=user_data_header_length+(0x8a1+2716-0x133c);}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=(0x1291+2870-0x1dc7),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,
+(0x4f9+3474-0x128b),WMS_MAX_LEN);data[pos]=(0x1bfd+2593-0x261e);data[pos]|=
+deliver->more?(0x1109+5500-0x2685):(0xed5+2017-0x16b2);data[pos]|=deliver->
+status_report_enabled?(0xf87+5971-0x26ba):(0x1c1f+2053-0x2424);data[pos]|=
+deliver->user_data_header_present?(0x1f4d+173-0x1fba):(0xcda+1156-0x115e);data[
+pos]|=deliver->reply_path_present?(0x680+7724-0x242c):(0x1afd+1876-0x2251);pos++
+;i=wms_ts_encode_address(&deliver->address,&data[pos]);if(i==
+(0x19c2+1320-0x1eea)){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==(0x14cf+1132-0x193b)
+){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=(0x1f11+165-0x1fb6),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*(0x18d3+2076-0x1f82);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*(0x409+5138-0x17fd);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>(0x842+1486-0xdf2)){v=(UINT8)((i+(0xc55+4003-0x1bf2))/
+(0x446+2700-0xecb)+(0x13d+5436-0x15b9));}else if(i>=(0xb19+5619-0x210b)){v=(
+UINT8)(i+(0x15b1+1991-0x1cd2));}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*(0x4ad+1745-0xb66)*(0x10e3+2926-0x1c15);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*(0xa0c+986-0xdaa);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>(0x15d5+1505-0x1baa)*(0x622+7507-0x2339)){v=(UINT8)((i-((
+(0x24d6+354-0x262c)*(0x1190+4226-0x21d6))+(0xe89+2838-0x1982)))/
+(0x2e8+4063-0x12a9)+(0x40f+173-0x42d));}else{v=(UINT8)((i+(0x6c9+4002-0x1667))/
+(0x138d+4457-0x24f1)-(0xc15+3062-0x180a));}}}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=(0xa07+6199-0x223e);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==(0x1bc6+2051-0x23c9)){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=(0x41d+6021-0x1ba2),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,
+(0x1327+2136-0x1b7f),WMS_MAX_LEN);data[pos]=(0x1f0c+168-0x1fb3);data[pos]|=
+submit->reject_duplicates?(0x14ac+623-0x1717):(0x43a+2156-0xca6);if(submit->
+validity.format>(0x508+1340-0xa41)){return st=WMS_INVALID_VALIDITY_FORMAT_S;}
+data[pos]|=submit->validity.format<<(0x833+5152-0x1c50);data[pos]|=submit->
+status_report_enabled?(0xa7+884-0x3fb):(0xce3+4276-0x1d97);data[pos]|=submit->
+user_data_header_present?(0x160b+1249-0x1aac):(0x1634+4127-0x2653);data[pos]|=
+submit->reply_path_present?(0xf19+4873-0x21a2):(0x49f+4131-0x14c2);pos++;data[
+pos]=(UINT8)submit->message_reference;pos++;i=wms_ts_encode_address(&submit->
+address,&data[pos]);if(i==(0x16b6+2457-0x204f)){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=(0x181b+1363-0x1d6e),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,
+(0x111f+4978-0x2491),WMS_MAX_LEN);data[pos]=(0x884+3445-0x15e9);data[pos]|=
+status_report->more?(0x74+8634-0x222e):(0x25b+1363-0x7aa);data[pos]|=
+status_report->status_report_qualifier?(0x1b01+261-0x1be6):(0x387+3770-0x1241);
+data[pos]|=status_report->user_data_header_present?(0x1a3c+2262-0x22d2):
+(0x987+2872-0x14bf);pos++;data[pos]=(UINT8)status_report->message_reference;pos
+++;i=wms_ts_encode_address(&status_report->address,&data[pos]);if(i==
+(0x3a+4874-0x1344)){return WMS_INVALID_PARM_SIZE_S;}pos+=i;i=
+wms_ts_encode_timestamp(&status_report->timestamp,data+pos);if(i==
+(0x1477+3155-0x20ca)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;i=
+wms_ts_encode_timestamp(&status_report->discharge_time,data+pos);if(i==
+(0x3a+8229-0x205f)){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 (0xb0f+6737-0x2560)

+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 (0x583+507-0x77e)

+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=(0x609+1968-0xdb9);UINT16 pos=
+(0xb07+3233-0x17a8);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(0x5a0+3902-0x14de);}if(shift!=(0x14b+3153-0xd9c))pos=pos+
+(0xd01+4248-0x1d98);if(shift==(0x15cf+2452-0x1f5c)){out[(0x1dad+254-0x1eab)]=in[
+(0x9f3+5666-0x2015)]>>(0xb34+4572-0x1d0f);shift=(0x9e3+5428-0x1f17);i=
+(0xd8c+6501-0x26f0);}for(i=i;i<out_len_max&&i<in_len;i++,pos++){out[i]=(in[pos]
+<<shift)&(0x5c0+2271-0xe20);if(pos!=(0x18a0+949-0x1c55)){
+#if (0x681+503-0x877)       
+if(shift==(0x677+4373-0x178c)){out[i]|=(0x1565+4356-0x2669);}else{out[i]|=in[pos
+-(0xc2a+4683-0x1e74)]>>((0xbf4+582-0xe32)-shift);}
+#else

+out[i]|=in[pos-(0x1287+4793-0x253f)]>>((0xab6+6124-0x229a)-shift);
+#endif

+}shift++;if(shift==(0x15b0+2336-0x1ec9)){shift=(0x1655+2161-0x1ec6);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]>>(0xbba+6797-0x2646);}}return(UINT8)(pos);}UINT8 
+wms_ts_decode_address(const UINT8*data,wms_address_s_type*addr){UINT8 i,pos=
+(0x934+4905-0x1c5d);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(0x110d+5296-0x25bd);}addr->number_of_digits=i;pos++;addr->digit_mode=
+WMS_DIGIT_MODE_4_BIT;addr->number_type=(wms_number_type_e_type)((data[pos]&
+(0x5ff+1238-0xa65))>>(0xe9c+162-0xf3a));addr->number_plan=(
+wms_number_plan_e_type)(data[pos]&(0x2150+224-0x2221));pos++;if(addr->
+number_type==WMS_NUMBER_ALPHANUMERIC){UINT8 bytes_increment=(0x90a+6702-0x2338);
+addr->digit_mode=WMS_DIGIT_MODE_8_BIT;bytes_increment=(addr->number_of_digits+
+(0x16fb+1669-0x1d7f))/(0x8d6+6327-0x218b);addr->number_of_digits=(UINT8)(addr->
+number_of_digits*(0x6cd+4063-0x16a8)/(0x1751+323-0x188d));(void)
+wms_ts_unpack_gw_7_bit_chars(&data[pos],addr->number_of_digits,
+WMS_GW_ADDRESS_MAX,(0x155+84-0x1a9),addr->digits);pos+=bytes_increment;}else{for
+(i=(0x1c09+1198-0x20b7);i<addr->number_of_digits;i++){addr->digits[i++]=data[pos
+]&(0xe05+4053-0x1dcb);addr->digits[i]=(data[pos]&(0x1e9+8610-0x229b))>>
+(0xcbc+5618-0x22aa);pos++;}}return pos;}UINT8 wms_ts_decode_dcs(const UINT8*data
+,wms_gw_dcs_s_type*dcs){UINT8 pos=(0x4ca+4776-0x1772);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(0x4db+2561-0xedc);}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]&(0x337+7398-0x1f5d))>>(0x519+4505-0x16ac);
+switch(i){case(0x16+5237-0x148b):dcs->is_compressed=data[pos]&
+(0xb30+1876-0x1264);if(data[pos]&(0xb75+1455-0x1114)){dcs->msg_class=(
+wms_message_class_e_type)(data[pos]&(0x1203+3038-0x1dde));}else{dcs->msg_class=
+WMS_MESSAGE_CLASS_NONE;}dcs->alphabet=(wms_gw_alphabet_e_type)((data[pos]&
+(0x13f8+2494-0x1daa))>>(0x293+8806-0x24f7));break;case(0x393+8583-0x2517):if((
+data[pos]&(0x17c9+482-0x197b))==(0x1fac+930-0x231e)){dcs->alphabet=(data[pos]&
+(0x2a8+2293-0xb99))?WMS_GW_ALPHABET_8_BIT:WMS_GW_ALPHABET_7_BIT_DEFAULT;dcs->
+msg_class=(wms_message_class_e_type)(data[pos]&(0x44c+3013-0x100e));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]&
+(0x16a+1506-0x71c))==(0x766+1398-0xcdc)){dcs->msg_waiting=
+WMS_GW_MSG_WAITING_DISCARD;dcs->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}else if(
+(data[pos]&(0x375+4674-0x1587))==(0x173d+3418-0x2487)){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]&(0xe94+4536-0x2044))?TRUE:FALSE;dcs->
+msg_waiting_kind=(wms_gw_msg_waiting_kind_e_type)(data[pos]&(0x1570+569-0x17a6))
+;}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=(0x657+3769-0x1510),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(0x12c4+2443-0x1c4f);}i=((data[pos]&(0x1148+1957-0x18de))<<
+(0x1187+51-0x11b6))+((data[pos]&(0x1861+2399-0x20d0))>>(0x587+674-0x825));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=(0xba6+4078-0x1b94);}timestamp->year=i;pos++;i=((data[pos]&
+(0x2103+1414-0x267a))<<(0x1623+2191-0x1eae))+((data[pos]&(0x1ef4+1891-0x2567))>>
+(0x13ff+2926-0x1f69));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x368+1390-0x8ca)||j<
+(0xb6d+5999-0x22db)){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=(0xd51+4775-0x1ff7);}}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=(0x5fa+7577-0x2392);}timestamp->month=i;pos++;i=((data[pos]&
+(0x1046+5439-0x2576))<<(0x317+2673-0xd84))+((data[pos]&(0x462+8101-0x2317))>>
+(0x1c4+1118-0x61e));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x58b+4830-0x184a)||j<
+(0x584+7797-0x23f8)){at_print(LOG_DEBUG,
+"\x44\x61\x79\x20\x69\x73\x20\x69\x6e\x76\x61\x6c\x69\x64\x3a\x20\x25\x64",j);i=
+(0xcf3+3326-0x19f0);}}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=(0x618+1903-0xd86);}timestamp->day=i;pos++;i=((data[pos]&
+(0x418+104-0x471))<<(0x5c+3899-0xf93))+((data[pos]&(0x433+1171-0x7d6))>>
+(0x641+3223-0x12d4));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x3e2+1769-0xab4)){
+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=(0xd58+4057-0x1d31);}}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=(0xd0+7516-0x1e2c);}timestamp->hour=i;pos++;i=((data[pos]&
+(0x132f+4556-0x24ec))<<(0x2bc+6234-0x1b12))+((data[pos]&(0x123d+1518-0x173b))>>
+(0x15dc+2286-0x1ec6));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x3e9+8969-0x26b7)){
+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=(0x1425+2084-0x1c49);}}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=(0x868+1485-0xe35);}timestamp->minute=i;pos++;i=((data[pos]&
+(0x10e1+722-0x13a4))<<(0x16af+535-0x18c2))+((data[pos]&(0xc1a+3565-0x1917))>>
+(0x603+4710-0x1865));if(wms_ts_bcd_to_int(i,&j)){if(j>(0x1012+1344-0x1517)){
+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=(0x222+6039-0x19b9);}}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=(0x8f4+5200-0x1d44);}timestamp->second=i;pos++;if(data[pos]&
+(0xfb5+1738-0x1677)){timestamp->timezone=(data[pos]&(0xedc+2532-0x18b9))*
+(0x1687+786-0x198f)+((data[pos]&(0xb87+5134-0x1ea5))>>(0xff+5283-0x159e));
+timestamp->timezone*=(-(0x14d9+3277-0x21a5));}else{timestamp->timezone=(sint7)((
+data[pos]&(0x59d+2230-0xe44))*(0x2222+1229-0x26e5)+((data[pos]&
+(0xa36+6618-0x2320))>>(0x103a+3180-0x1ca2)));}if(timestamp->timezone>
+(0x8b9+4215-0x1900)||timestamp->timezone<-(0x947+4618-0x1b21)){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=(0x2a0+6188-0x1acc);}pos++;return pos;
+}static UINT8 wms_ts_decode_udh_concat_8(const UINT8*udh,wms_udh_s_type*
+header_ptr){UINT8 pos=(0x19+8136-0x1fe1);if(udh==NULL||header_ptr==NULL){
+at_print(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
+(0x1aa+5520-0x173a);}if(udh[pos]<(0xc02+299-0xd2a)){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(0x15a0+3768-0x2458);}if(udh[pos+(0xbdb+3312-0x18c9)]==
+(0x1823+1325-0x1d50)||udh[pos+(0x503+3300-0x11e4)]>udh[pos+(0x33b+1860-0xa7d)]){
+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(0x9b5+6452-0x22e9);}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[(0x899+5690-0x1ed3)]
++(0x82c+49-0x85c));}static UINT8 wms_ts_decode_udh_concat16(const UINT8*udh,
+wms_udh_s_type*header_ptr){UINT8 pos=(0x14e9+3327-0x21e8);if(udh==NULL||
+header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1519+3301-0x21fe);}if(
+udh[pos]<(0x1c50+2245-0x2511)){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(0x120d+1894-0x1973);}if(udh[pos+(0x1426+1609-0x1a6c)]==
+(0x1196+3195-0x1e11)||udh[pos+(0x147b+4196-0x24db)]==(0xfc+5227-0x1567)||udh[pos
++(0x683+4951-0x19d6)]>udh[pos+(0x296+51-0x2c6)])return(0x11d+263-0x224);
+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<<(0xf1c+4265-0x1fbd))|udh[pos++];header_ptr->u.concat_16.total_sm=udh[
+pos++];header_ptr->u.concat_16.seq_num=udh[pos++];return(udh[
+(0x187a+1877-0x1fcf)]+(0x23bb+762-0x26b4));}static UINT8 
+wms_ts_udh_decode_first_seg_check(const UINT8 len,const UINT8*data,UINT8*
+is_first_segment_ptr){UINT8 pos=(0xd66+5460-0x22ba);UINT8 num_headers=
+(0x1356+408-0x14ee);UINT8 udhl=(0x1317+3381-0x204c);UINT8 iedl=
+(0x7dc+1287-0xce3);UINT8 iei=(0x16a5+181-0x175a);*is_first_segment_ptr=TRUE;if(
+data==NULL||data[pos]==(0x5c1+1177-0xa5a)||len==(0x52c+2858-0x1056)){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+(0x13b4+2640-0x1e03)];if(iei==
+WMS_UDH_CONCAT_16){if(data[pos+(0x13e0+2920-0x1f43)]!=(0x3fa+8413-0x24d6)){
+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+=((0xf5c+4677-0x219f)+iedl);}}return TRUE;}static UINT8 
+wms_ts_decode_udh_special_sm(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 
+pos=(0x15e8+690-0x189a);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x745+6048-0x1ee5);}if(
+udh[pos]<(0x6+5970-0x1756)){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(0x1195+2588-0x1bb1);}pos++;header_ptr->header_id=
+WMS_UDH_SPECIAL_SM;header_ptr->u.special_sm.msg_waiting=(
+wms_gw_msg_waiting_e_type)((udh[pos]>>(0x254a+50-0x2575)==(0x264+8689-0x2455))?
+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++]&(0x99c+1971-0x10d0)
+);header_ptr->u.special_sm.message_count=udh[pos++];return(udh[
+(0x231a+582-0x2560)]+(0xcd1+910-0x105e));}static UINT8 wms_ts_decode_udh_port_8(
+const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x6b8+5814-0x1d6e);if(udh
+==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1a7b+2997-0x2630);}if(
+udh[pos]<(0x1e77+1444-0x2419)){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(0x8d1+723-0xba4);}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[(0xc50+3059-0x1843)]+(0x121b+185-0x12d3));}static UINT8 
+wms_ts_decode_udh_port16(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=
+(0x128c+1717-0x1941);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x675+8227-0x2698);}if(
+udh[pos]<(0xbc6+6464-0x2502)){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(0x93d+2621-0x137a);}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<<(0xb0+1919-0x827))|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<<(0x1384+213-0x1451))|udh[pos++];return(udh[
+(0x1925+1915-0x20a0)]+(0x943+1069-0xd6f));}static UINT8 
+wms_ts_decode_udh_text_formatting(const UINT8*udh,wms_udh_s_type*header_ptr){
+UINT8 pos=(0x711+5456-0x1c61);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG
+,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x208+3968-0x1188);}if(
+udh[pos]<(0x1a5d+2780-0x2536)){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(0xf82+4755-0x2215);}if(udh[pos]>=(0xca4+3196-0x191c)){
+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]&
+(0x2108+981-0x24da));header_ptr->u.text_formating.font_size=(
+wms_udh_font_size_e_type)((udh[pos]&(0x389+5012-0x1711))>>(0x586+6904-0x207c));
+header_ptr->u.text_formating.style_bold=(udh[pos]&(0x7a4+7232-0x23d4))>>
+(0xd24+2585-0x1739);header_ptr->u.text_formating.style_italic=(udh[pos]&
+(0xc4f+1526-0x1225))>>(0x19a+3571-0xf88);header_ptr->u.text_formating.
+style_underlined=(udh[pos]&(0x705+7973-0x25ea))>>(0x71c+2259-0xfe9);header_ptr->
+u.text_formating.style_strikethrough=(udh[pos]&(0x36f+1644-0x95b))>>
+(0x7c1+2808-0x12b2);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]&(0x1668+3580-0x2455));header_ptr->u.text_formating.
+text_color_background=(wms_udh_text_color_e_type)((udh[pos]&(0x407+6989-0x1e64))
+>>(0xb17+5844-0x21e7));pos++;}return(udh[(0x5d8+5002-0x1962)]+
+(0x5bc+7250-0x220d));}static UINT8 wms_ts_decode_udh_pre_def_sound(const UINT8*
+udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x1706+4084-0x26fa);if(udh==NULL||
+header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x670+7932-0x256c);}if(
+udh[pos]<(0xad8+2484-0x148a)){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(0x3c0+7104-0x1f80);}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[(0x181a+219-0x18f5)]+
+(0x5cd+6410-0x1ed6));}static UINT8 wms_ts_decode_udh_user_def_sound(const UINT8*
+udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x142b+4344-0x2523),j;if(udh==NULL||
+header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x56+3050-0xc40);}if(udh[
+pos]==(0x4da+6941-0x1ff7)){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(0x465+2388-0xdb9);}header_ptr->header_id=WMS_UDH_USER_DEF_SOUND;
+header_ptr->u.user_def_sound.data_length=udh[pos++]-(0xf86+772-0x1289);
+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(0xc86+3896-0x1bbe);}memset(header_ptr->u.
+user_def_sound.user_def_sound,(0x6aa+3253-0x1260),WMS_UDH_MAX_SND_SIZE);for(j=
+(0x866+656-0xaf6);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=(0x410+888-0x788);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x214+3174-0xe7a);}if(udh
+[pos]!=(0x14a7+1409-0x1a26)){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(0x489+6891-0x1f74);}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=(0x994+6156-0x21a0),j,k;if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x745+3239-0x13ec);}if(
+udh[pos]!=(WMS_UDH_ANIM_NUM_BITMAPS*WMS_UDH_LARGE_BITMAP_SIZE+
+(0x533+7042-0x20b4))){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(0x14a6+3061-0x209b);}header_ptr->header_id=WMS_UDH_LARGE_ANIM;
+pos++;header_ptr->u.large_anim.position=udh[pos++];for(j=(0xa1c+3755-0x18c7);j<
+WMS_UDH_ANIM_NUM_BITMAPS;j++)for(k=(0xc91+4647-0x1eb8);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=(0x1ccf+940-0x207b),j,k;if(udh==NULL||
+header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0xa29+2840-0x1541);}if(
+udh[pos]!=(WMS_UDH_ANIM_NUM_BITMAPS*WMS_UDH_SMALL_BITMAP_SIZE+
+(0x2312+266-0x241b))){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(0x1b8f+74-0x1bd9);}header_ptr->header_id=WMS_UDH_SMALL_ANIM;
+pos++;header_ptr->u.small_anim.position=udh[pos++];for(j=(0x76d+3732-0x1601);j<
+WMS_UDH_ANIM_NUM_BITMAPS;j++)for(k=(0x87+8262-0x20cd);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=(0x1b02+64-0x1b42),j;if(udh==NULL||
+header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x499+80-0x4e9);}if(udh[
+pos]!=WMS_UDH_LARGE_PIC_SIZE+(0x643+3583-0x1441)){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(0x50b+4095-0x150a);}header_ptr->header_id=
+WMS_UDH_LARGE_PICTURE;pos++;header_ptr->u.large_picture.position=udh[pos++];for(
+j=(0x1be5+1947-0x2380);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=(0x593+5973-0x1ce8),j;if(
+udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x19f+3845-0x10a4);}if(
+udh[pos]!=WMS_UDH_SMALL_PIC_SIZE+(0xfbc+216-0x1093)){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(0x10af+1169-0x1540);}header_ptr->header_id=
+WMS_UDH_SMALL_PICTURE;pos++;header_ptr->u.small_picture.position=udh[pos++];for(
+j=(0x848+3704-0x16c0);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=(0x1824+1280-0x1d24),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(0x317+836-0x65b);}if(udh[
+pos]>WMS_UDH_VAR_PIC_SIZE+(0x217+7076-0x1db8)){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(0x182+2366-0xac0);}if((udh[pos]-(0x352+8735-0x256e))!=(udh[pos
++(0x5da+1584-0xc08)]*udh[pos+(0x1a1f+1301-0x1f31)])){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(0x3db+8691-0x25ce);}pic_size=udh[pos++]-(0x10e8+3176-0x1d4d);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++]*(0x869+6322-0x2113));
+header_ptr->u.var_picture.height=udh[pos++];for(j=(0x53b+2288-0xe2b);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=(0x922+215-0x9f9);if(udh==NULL||header_ptr==NULL){at_print
+(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
+(0x1516+1946-0x1cb0);}if(udh[pos]<(0x23a7+51-0x23d9)){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(0xe94+5797-0x2539);}pos++;header_ptr->header_id=
+WMS_UDH_USER_PROMPT;header_ptr->u.user_prompt.number_of_objects=udh[pos++];
+return(udh[(0xb21+6513-0x2492)]+(0x931+3398-0x1676));}static UINT8 
+wms_ts_decode_udh_eo(const UINT8*udh,UINT8 first_segment,wms_udh_s_type*
+header_ptr){UINT8 pos=(0xb15+5548-0x20c1),udh_length;if(udh==NULL||header_ptr==
+NULL){at_print(LOG_DEBUG,"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return
+(0xa14+1000-0xdfc);}if(udh[pos]==(0xc3d+465-0xe0e)){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(0x2389+9-0x2392);}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
+(0x168d+1978-0x1e47);}header_ptr->u.eo.reference=udh[pos++];header_ptr->u.eo.
+length=udh[pos++]<<(0xf+9467-0x2502);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++]<<(0x498+982-0x866);header_ptr->u
+.eo.position|=udh[pos++];}header_ptr->u.eo.content.length=(udh_length-pos)+
+(0x1427+2727-0x1ecd);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=
+(0x1de7+495-0x1fd6);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x7b2+4335-0x18a1);}if(
+udh[pos]<(0x1413+2109-0x1c4f)){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(0x1454+2243-0x1d17);}pos++;header_ptr->header_id=
+WMS_UDH_RFC822;header_ptr->u.rfc822.header_length=udh[pos++];return(udh[
+(0x961+4483-0x1ae4)]+(0x18fc+1393-0x1e6c));}static UINT8 
+wms_ts_decode_udh_nat_lang_ss(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 
+pos=(0x7+8231-0x202e);if(udh==NULL||header_ptr==NULL){return(0x5ba+3025-0x118b);
+}if(udh[pos]!=WMS_UDH_OCTETS_NAT_LANG_SS){return(0x71b+1881-0xe74);}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(0xe93+1350-0x13d9);}header_ptr
+->u.nat_lang_ss.nat_lang_id=(wms_udh_nat_lang_id_e_type)udh[pos++];return(udh[
+(0xb72+5913-0x228b)]+(0xc6a+2247-0x1530));}static UINT8 
+wms_ts_decode_udh_nat_lang_ls(const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 
+pos=(0x12e9+3566-0x20d7);if(udh==NULL||header_ptr==NULL){return(0x100+515-0x303)
+;}if(udh[pos]!=WMS_UDH_OCTETS_NAT_LANG_LS){return(0x8ba+80-0x90a);}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(0xe3b+6147-0x263e);}header_ptr
+->u.nat_lang_ls.nat_lang_id=(wms_udh_nat_lang_id_e_type)udh[pos++];return(udh[
+(0x801+455-0x9c8)]+(0x13bc+3634-0x21ed));}static UINT8 wms_ts_decode_udh_other(
+const UINT8*udh,wms_udh_s_type*header_ptr){UINT8 pos=(0x79+7147-0x1c64),i=
+(0x3b5+5715-0x1a08);if(udh==NULL||header_ptr==NULL){at_print(LOG_DEBUG,
+"\x75\x64\x68\x20\x69\x73\x20\x4e\x55\x4c\x4c");return(0x1cfb+2222-0x25a9);}if(
+udh[pos+(0x995+3000-0x154c)]>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(0x288+6066-0x1a3a);}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=(0x2084+537-0x229d);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=(0x2067+142-0x20f5);UINT8 
+header_length=(0x11d3+5349-0x26b8),num_headers=(0x101d+4669-0x225a);UINT8 udhl;
+UINT8 first_segment=TRUE;if(data==NULL||len==(0x46d+6918-0x1f73)||data[pos]==
+(0x769+1334-0xc9f)||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(0x1886+2744-0x233e);}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(0x1c49+1301-0x215e);}else if(header_length!=(0x167b+1049-0x1a94)){
+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=(0xa10+7339-0x26bb);return(0xb10+5684-0x2144);}
+}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+(0x77a+3631-0x15a8);}if(pos!=(udhl+(0xa7d+1878-0x11d2))){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=(0x680+7310-0x230e);udhl=(0x18f8+1214-0x1db6);}if(num_headers>
+(0xa84+2012-0x1260)){*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=(0x1410+3367-0x2137);UINT8 fill_bits=(0x1123+551-0x134a);
+UINT8 user_data_length;UINT8 user_data_header_length=(0x1227+2069-0x1a3c);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(0x8fb+6283-0x2186);}(void)memset(user_data,(0x10a1+3823-0x1f90),sizeof(
+wms_gw_user_data_s_type));if(len==(0x417+5122-0x1819)){return(0xbea+5965-0x2337)
+;}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(0x2168+604-0x23c4);}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(0x8b+3344-0xd9b);}if(user_data_header_length>(0x11e4+4622-0x23f2)){
+fill_bits=((len*(0xfe0+2894-0x1b27))-((user_data_header_length+(0x80+2060-0x88b)
+)*(0x786+6484-0x20d2)))%(0xbf6+2428-0x156b);user_data_length=(UINT8)(((len*
+(0xee5+3383-0x1c15))-((user_data_header_length+(0x632+5206-0x1a87))*
+(0x1b30+1070-0x1f56)))/(0xbdd+183-0xc8d));pos=user_data_header_length+
+(0x1301+3026-0x1ed2);if(fill_bits!=(0xd4+3687-0xf3b)){fill_bits=
+(0x2d4+4960-0x162c)-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(0x3aa+1471-0x969);}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(0xa37+3620-0x185b);}pos+=user_data_header_length+(0x6b+1927-0x7f1);
+user_data_length=(len-user_data_header_length)-(0x662+8204-0x266d);}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=
+(0x529+3604-0x133d),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]&(0x129d+2459-0x1c35))!=
+(0x4e3+6314-0x1d8d)){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]&
+(0x6c2+6864-0x218e))?FALSE:TRUE;deliver->status_report_enabled=(data[pos]&
+(0x44f+5779-0x1ac2))?TRUE:FALSE;deliver->user_data_header_present=(data[pos]&
+(0xe81+599-0x1098))?TRUE:FALSE;deliver->reply_path_present=(data[pos]&
+(0x85f+6405-0x20e4))?TRUE:FALSE;pos++;i=wms_ts_decode_address(&data[pos],&
+deliver->address);if(i==(0xdf1+2227-0x16a4)){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==(0x636+7768-0x248e)){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-(0x110b+1114-0x1564)],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=(0x1ba0+2079-0x23bf);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(0x9cd+3879-0x18f4);}else{switch(validity->format){case 
+WMS_GW_VALIDITY_NONE:memset(validity,(0x553+3393-0x1294),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=
+(0x4da+6667-0x1ee5),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]&(0xb94+2481-0x1541))?TRUE:FALSE;submit->validity.format=(
+wms_gw_validity_format_e_type)((data[pos]&(0x120f+5068-0x25c3))>>
+(0x2077+664-0x230c));submit->status_report_enabled=(data[pos]&
+(0x2b7+5713-0x18e8))?TRUE:FALSE;submit->user_data_header_present=(data[pos]&
+(0x1f37+249-0x1ff0))?TRUE:FALSE;submit->reply_path_present=(data[pos]&
+(0x169+4510-0x1287))?TRUE:FALSE;pos++;submit->message_reference=data[pos];pos++;
+i=wms_ts_decode_address(&data[pos],&submit->address);if(i==(0x342+542-0x560)){
+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==(0xcb+7077-0x1c70))){return WMS_INVALID_PARM_VALUE_S;}pos+=i;pos++;i=
+wms_ts_decode_gw_user_data(&submit->dcs,data[pos-(0x223f+975-0x260d)],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=(0x1899+1889-0x1ffa),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]&
+(0x151f+1575-0x1b42)?FALSE:TRUE;status_report->status_report_qualifier=data[pos]
+&(0x66f+3362-0x1371)?TRUE:FALSE;status_report->user_data_header_present=(data[
+pos]&(0x6ab+4738-0x18ed))?TRUE:FALSE;pos++;status_report->message_reference=data
+[pos];pos++;i=wms_ts_decode_address(&data[pos],&status_report->address);if(i==
+(0xa7d+1024-0xe7d)){return WMS_INVALID_PARM_SIZE_S;}pos+=i;i=
+wms_ts_decode_timestamp(data+pos,&status_report->timestamp);if(i==
+(0x55f+4889-0x1878)){return WMS_INVALID_PARM_VALUE_S;}pos+=i;i=
+wms_ts_decode_timestamp(data+pos,&status_report->discharge_time);if(i==
+(0x94f+5214-0x1dad)){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)(0x28c+2568-0xc94);status_report->user_data.
+sm_len=(0x473+8802-0x26d5);status_report->mask&=(0x575+2862-0xfa4);if((
+status_report->mask!=(0x7ba+411-0x856))&&(status_report->mask!=
+(0xf0c+867-0x126f))){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-(0x19e4+2241-0x22a4)],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=
+(0xcaf+5880-0x23a7);}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
+;}
diff --git a/ap/app/zte_comm/sms/src/sms_db.c b/ap/app/zte_comm/sms/src/sms_db.c
new file mode 100755
index 0000000..b4b00e6
--- /dev/null
+++ b/ap/app/zte_comm/sms/src/sms_db.c
@@ -0,0 +1,551 @@
+
+#include <stdio.h>

+#include <time.h>

+#include <limits.h>

+#include "sms_db.h"

+#include "sms_code.h"

+#include "cfg_nv_def.h"

+typedef sqlite3_callback zte_wms_db_callback;
+#define ZTE_WMS_CREATE_TABLE_SMS_SQL        \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73"\
+ \

+                                            \
+"\x28\x69\x64\x20\x49\x4e\x54\x45\x47\x45\x52\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59\x20\x41\x55\x54\x4f\x49\x4e\x43\x52\x45\x4d\x45\x4e\x54"\
+ \

+                                            \
+"\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\x2c\x20\x69\x6e\x64\x20\x54\x45\x58\x54\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x20\x54\x45\x58\x54\x2c\x54\x61\x67"\
+ \

+                                            \
+"\x20\x54\x45\x58\x54\x2c\x4e\x75\x6d\x62\x65\x72\x20\x54\x45\x58\x54\x2c\x43\x63\x5f\x53\x6d\x73\x20\x54\x45\x58\x54\x2c\x43\x63\x5f\x52\x65\x66\x20"\
+ \

+                                            \
+"\x20\x54\x45\x58\x54\x2c\x43\x63\x5f\x54\x6f\x74\x61\x6c\x20\x54\x45\x58\x54\x2c\x20\x43\x63\x5f\x53\x65\x71\x20\x54\x45\x58\x54\x2c\x43\x63\x5f\x4e\x75\x6d"\
+ \

+                                            \
+"\x20\x54\x45\x58\x54\x2c\x43\x63\x5f\x43\x6f\x6e\x74\x65\x6e\x74\x20\x54\x45\x58\x54\x2c\x4c\x61\x6e\x67\x75\x61\x67\x65\x20\x54\x45\x58\x54\x2c\x54\x70\x5f\x44\x63\x73"\
+ \

+                                            \
+"\x20\x54\x45\x58\x54\x2c\x4d\x73\x67\x5f\x52\x65\x66\x20\x54\x45\x58\x54\x2c\x43\x6f\x6e\x74\x65\x6e\x74\x20\x54\x45\x58\x54\x2c\x20"\
+ \

+                                            \
+"\x20\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x5f\x52\x65\x63\x69\x76\x65\x64\x20\x54\x45\x58\x54\x2c\x44\x72\x61\x66\x74\x5f\x47\x72\x6f\x75\x70\x5f\x49\x64\x20\x54\x45\x58\x54\x2c\x59\x65\x61\x72\x20\x54\x45\x58\x54\x2c\x4d\x6f\x6e\x74\x68\x20\x54\x45\x58\x54\x2c"\
+ \

+                                            \
+"\x20\x44\x61\x79\x20\x54\x45\x58\x54\x2c\x48\x6f\x75\x72\x20\x54\x45\x58\x54\x2c\x4d\x69\x6e\x75\x74\x65\x20\x54\x45\x58\x54\x2c\x53\x65\x63\x6f\x6e\x64\x20\x54\x45\x58\x54\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x20\x54\x45\x58\x54\x2c\x4d\x6b\x74\x69\x6d\x65\x20\x49\x4e\x54\x45\x47\x45\x52\x2c\x44\x69\x73\x70\x6c\x61\x79\x4d\x6f\x64\x65\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_CMD_STATUS_SQL       \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x63\x6d\x64\x5f\x73\x74\x61\x74\x75\x73\x28\x43\x6d\x64\x20\x54\x45\x58\x54\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59\x2c\x43\x6d\x64\x5f\x53\x74\x61\x74\x75\x73\x20\x54\x45\x58\x54\x2c"\
+ \

+                                            \
+"\x20\x45\x72\x72\x5f\x43\x6f\x64\x65\x20\x54\x45\x58\x54\x2c\x53\x65\x6e\x64\x5f\x46\x61\x69\x6c\x5f\x43\x6f\x75\x6e\x74\x20\x54\x45\x58\x54\x2c\x44\x65\x6c\x5f\x54\x79\x70\x65\x20\x54\x45\x58\x54\x2c"\
+ \

+                                            \
+"\x20\x44\x65\x6c\x5f\x43\x6f\x75\x6e\x74\x20\x54\x45\x58\x54\x2c\x44\x65\x6c\x5f\x69\x6e\x64\x65\x78\x20\x54\x45\x58\x54\x2c\x20\x46\x61\x69\x6c\x65\x64\x5f\x43\x6f\x75\x6e\x74\x20\x54\x45\x58\x54\x2c\x46\x61\x69\x6c\x65\x64\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_SMS_REP_SQL          \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x72\x65\x70\x6f\x72\x74\x28\x69\x64\x20\x49\x4e\x54\x45\x47\x45\x52\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59"\
+ \

+                                            \
+"\x20\x41\x55\x54\x4f\x49\x4e\x43\x52\x45\x4d\x45\x4e\x54\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\x2c\x20\x20\x61\x64\x64\x72\x65\x73\x73\x20\x54\x45\x58\x54\x2c\x63\x6f\x6e\x74\x65\x6e\x74\x20\x54\x45\x58\x54\x2c\x59\x65\x61\x72\x20\x54\x45\x58\x54\x2c\x4d\x6f\x6e\x74\x68\x20\x54\x45\x58\x54\x2c"\
+ \

+                                            \
+"\x20\x44\x61\x79\x20\x54\x45\x58\x54\x2c\x48\x6f\x75\x72\x20\x54\x45\x58\x54\x2c\x4d\x69\x6e\x75\x74\x65\x20\x54\x45\x58\x54\x2c\x53\x65\x63\x6f\x6e\x64\x20\x54\x45\x58\x54\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_PAR_SQL              \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x28\x69\x64\x20\x49\x4e\x54\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59\x2c\x20\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x20\x54\x45\x58\x54\x2c\x20\x53\x6d\x73\x5f\x53\x63\x61\x20\x54\x45\x58\x54\x2c\x20"\

+                                            \
+"\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x20\x54\x45\x58\x54\x2c\x54\x70\x5f\x56\x61\x6c\x69\x64\x69\x74\x79\x20\x54\x45\x58\x54\x2c\x53\x65\x6e\x64\x5f\x52\x65\x74\x72\x79\x20\x54\x45\x58\x54\x2c\x4f\x75\x74\x64\x61\x74\x65\x5f\x44\x65\x6c\x65\x74\x65\x20\x54\x45\x58\x54\x2c\x44\x65\x66\x61\x75\x6c\x74\x5f\x53\x74\x6f\x72\x65\x20\x54\x45\x58\x54\x2c\x4d\x61\x78\x5f\x43\x63\x5f\x52\x65\x66\x20\x54\x45\x58\x54\x2c\x20"\
+ \

+                                            \
+"\x20\x4d\x61\x78\x5f\x53\x6d\x73\x5f\x52\x65\x66\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_INFO_SQL             \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x69\x6e\x66\x6f\x28\x69\x64\x20\x49\x4e\x54\x45\x47\x45\x52\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59"\
+ \

+                                            \
+"\x20\x41\x55\x54\x4f\x49\x4e\x43\x52\x45\x4d\x45\x4e\x54\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\x2c\x20\x6e\x61\x6d\x65\x20\x54\x45\x58\x54\x2c\x20\x76\x61\x6c\x75\x65\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_CELL_BRO_SQL         \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x63\x65\x6c\x6c\x5f\x62\x72\x6f\x20\x28\x69\x64\x20\x49\x4e\x54\x45\x47\x45\x52\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59"\
+ \

+                                            \
+"\x20\x41\x55\x54\x4f\x49\x4e\x43\x52\x45\x4d\x45\x4e\x54\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\x2c\x20\x6d\x73\x67\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_CREATE_SEND_CONTENT_SQL     \
+"\x43\x52\x45\x41\x54\x45\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x4e\x4f\x54\x20\x45\x58\x49\x53\x54\x53\x20\x73\x65\x6e\x64\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x20\x28\x69\x64\x20\x49\x4e\x54\x45\x47\x45\x52\x20\x50\x52\x49\x4d\x41\x52\x59\x20\x4b\x45\x59"\
+ \

+                                            \
+"\x20\x41\x55\x54\x4f\x49\x4e\x43\x52\x45\x4d\x45\x4e\x54\x20\x4e\x4f\x54\x20\x4e\x55\x4c\x4c\x2c\x20\x6d\x73\x67\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x20\x54\x45\x58\x54\x29\x3b"

+#define ZTE_WMS_DROP_ALL_TABLE_SQL          \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x63\x6d\x64\x5f\x73\x74\x61\x74\x75\x73\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x72\x65\x70\x6f\x72\x74\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x69\x6e\x66\x6f\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x63\x65\x6c\x6c\x5f\x62\x72\x6f\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x65\x6e\x64\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x3b"

+#define ZTE_WMS_DROP_TABLE_EXCEPTSMS_SQL    \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x63\x6d\x64\x5f\x73\x74\x61\x74\x75\x73\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x72\x65\x70\x6f\x72\x74\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x6d\x73\x5f\x69\x6e\x66\x6f\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x63\x65\x6c\x6c\x5f\x62\x72\x6f\x3b"\

+                                            \
+"\x44\x52\x4f\x50\x20\x54\x41\x42\x4c\x45\x20\x49\x46\x20\x45\x58\x49\x53\x54\x53\x20\x73\x65\x6e\x64\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x3b"

+#define ZTE_WMS_DEL_SIM_SQL \
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x68\x65\x72\x65\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x73\x69\x6d\x27\x3b"

+#define OUTDATEINTERVAL 7776000

+typedef struct{char*buf_addr;int buf_len;}T_zUfiSms_BufInfo;typedef struct{int 
+valid;char*strSQL;}T_zUfiSms_SQLMap;sqlite3*g_zUfiSms_DbPointer=
+(0xeb1+2241-0x1772);extern T_zUfiSms_ParaInfo g_zUfiSms_CurSmsPara;extern 
+unsigned long g_zUfiSms_StoreCapablity[ZTE_WMS_MEMORY_MAX];extern 
+T_zUfiSms_DelSms g_zUfiSms_DelMsg;static int isSucess(T_zUfiSms_DbResult dbRst){
+return dbRst==ZTE_WMS_DB_OK?ZUFI_SUCC:ZUFI_FAIL;}time_t zte_getsecond(
+T_zUfiSms_Date date){time_t timet;struct tm tmtime={(0x1b5f+443-0x1d1a)};int 
+tmp_i=(0x14e5+2500-0x1ea9);
+#if (0x522+422-0x6c8)

+if(atoi(date.year)>(0x2b5+270-0x360)||atoi(date.year)<(0x238c+400-0x251c)){
+printf("[SMS] getsecond error, year out of range: %d!!!",atoi(date.year));return
+(0x197d+2628-0x23c1);}
+#endif

+tmp_i=atoi(date.year);if(tmp_i<(0x37c+3735-0x1213)||tmp_i>INT_MAX-
+(0x8c4+6103-0x209a)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x79\x65\x61\x72\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x310+8950-0x2606);}tmtime.tm_year=tmp_i+(0x26bb+736-0x21cb)-
+(0xeeb+7383-0x2456);tmp_i=atoi(date.month);if(tmp_i<(0x145+26-0x15f)||tmp_i>
+INT_MAX-(0x1eb1+1873-0x2601)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x6d\x6f\x6e\x74\x68\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x348+1836-0xa74);}tmtime.tm_mon=tmp_i-(0x2260+750-0x254d);tmp_i=
+atoi(date.day);if(tmp_i<(0x17af+2149-0x2014)||tmp_i>INT_MAX-(0x37f+205-0x44b)){
+at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x64\x61\x79\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x2120+680-0x23c8);}tmtime.tm_mday=tmp_i;tmp_i=atoi(date.hour);if
+(tmp_i<(0x265+4153-0x129e)||tmp_i>INT_MAX-(0x2436+704-0x26f5)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x68\x6f\x75\x72\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x1546+4548-0x270a);}tmtime.tm_hour=tmp_i;tmp_i=atoi(date.min);if
+(tmp_i<(0x119c+1018-0x1596)||tmp_i>INT_MAX-(0x69b+7014-0x2200)){at_print(LOG_ERR
+,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x6d\x69\x6e\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x598+846-0x8e6);}tmtime.tm_min=tmp_i;tmp_i=atoi(date.sec);if(
+tmp_i<(0x1af7+827-0x1e32)||tmp_i>INT_MAX-(0xe35+2781-0x1911)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x64\x61\x74\x65\x2e\x73\x65\x63\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return(0x2ba+7020-0x1e26);}tmtime.tm_sec=tmp_i;timet=mktime(&tmtime);
+return timet;}T_zUfiSms_DbResult zUfiSms_OpenDb(void){int retry_times=
+(0x1084+4219-0x20ff);int open_rst=SQLITE_ERROR;if(g_zUfiSms_DbPointer!=NULL){
+sqlite3_close(g_zUfiSms_DbPointer);g_zUfiSms_DbPointer=NULL;}do{open_rst=
+sqlite3_open(ZTE_WMS_DB_PATH,&g_zUfiSms_DbPointer);}while(open_rst==
+SQLITE_CANTOPEN&&retry_times++<(0x966+6994-0x24ae));printf(
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4f\x70\x65\x6e\x44\x62\x3a\x20\x72\x65\x74\x72\x79\x5f\x74\x69\x6d\x65\x73\x20\x3d\x20\x25\x64\x2c\x20\x6f\x70\x65\x6e\x5f\x72\x73\x74\x20\x3d\x20\x25\x64" "\n"
+,retry_times,open_rst);return open_rst==SQLITE_OK?ZTE_WMS_DB_OK:
+ZTE_SMS_DB_ERROR_NOT_OPEN_DB;}T_zUfiSms_DbResult zUfiSms_CloseDb(void){if(
+sqlite3_close(g_zUfiSms_DbPointer)!=SQLITE_OK){return ZTE_SMS_DB_ERROR;}
+g_zUfiSms_DbPointer=NULL;return ZTE_WMS_DB_OK;}T_zUfiSms_DbResult 
+zUfiSms_ExecSql(const char*exec_sql,zte_wms_db_callback callback,void*fvarg){int
+ try_times=(0x149c+3937-0x23fd);int sqlRst=SQLITE_ERROR;while(try_times++<
+(0x91c+5930-0x203c)){sqlRst=sqlite3_exec(g_zUfiSms_DbPointer,exec_sql,callback,
+fvarg,NULL);if(sqlRst!=SQLITE_BUSY&&sqlRst!=SQLITE_LOCKED&&sqlRst!=SQLITE_IOERR)
+{break;}printf(
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x45\x78\x65\x63\x53\x71\x6c\x3a\x20\x74\x72\x79\x5f\x74\x69\x6d\x65\x73\x3d\x25\x64\x2c\x20\x53\x51\x4c\x3d\x25\x73\x2c\x20\x45\x72\x72\x6d\x73\x67\x3d\x25\x73" "\n"
+,try_times,exec_sql,sqlite3_errmsg(g_zUfiSms_DbPointer));sleep(
+(0x5c2+4116-0x15d5));}if(sqlRst!=SQLITE_OK){printf(
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x45\x78\x65\x63\x53\x71\x6c\x3a\x20\x74\x72\x79\x5f\x74\x69\x6d\x65\x73\x3d\x25\x64\x2c\x20\x53\x51\x4c\x3d\x25\x73\x2c\x20\x45\x72\x72\x6d\x73\x67\x3d\x25\x73" "\n"
+,try_times,exec_sql,sqlite3_errmsg(g_zUfiSms_DbPointer));return ZTE_SMS_DB_ERROR
+;}else{
+#ifdef WEBS_SECURITY

+if(access(ZTE_WMS_TMP1_PATH,F_OK)==(0x1175+995-0x1558)){slog(PB_PRINT,SLOG_ERR,
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x45\x78\x65\x63\x53\x71\x6c\x20\x64\x62\x20\x73\x74\x61\x79"
+);if(remove(ZTE_WMS_TMP1_PATH)!=(0x3a9+4726-0x161f)){slog(SMS_PRINT,SLOG_ERR,
+"\x72\x65\x6d\x6f\x76\x65\x20\x57\x4d\x53\x5f\x54\x4d\x50\x31\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c"
+);}}{char rnum_buf[(0xea7+1240-0x1367)]={(0xa41+6939-0x255c)};char cmd[
+(0x1b3c+763-0x1db7)]={(0xe39+4745-0x20c2)};sc_cfg_get(
+"\x72\x6e\x75\x6d\x5f\x61\x74",rnum_buf,sizeof(rnum_buf));snprintf(cmd,sizeof(
+cmd),
+"\x2f\x62\x69\x6e\x2f\x6f\x70\x65\x6e\x73\x73\x6c\x20\x65\x6e\x63\x20\x2d\x65\x20\x2d\x61\x65\x73\x32\x35\x36\x20\x2d\x73\x61\x6c\x74\x20\x2d\x69\x6e\x20\x25\x73\x20\x2d\x6f\x75\x74\x20\x25\x73\x20\x2d\x70\x61\x73\x73\x20\x70\x61\x73\x73\x3a\x25\x73"
+,ZTE_WMS_DB_PATH,ZTE_WMS_TMP1_PATH,rnum_buf);zxic_system(cmd);if(access(
+ZTE_WMS_TMP1_PATH,F_OK)==(0x1b0b+2439-0x2492)){if(remove(ZTE_WMS_SEC_PATH)!=
+(0x77d+897-0xafe)){slog(SMS_PRINT,SLOG_ERR,
+"\x72\x65\x6d\x6f\x76\x65\x20\x57\x4d\x53\x5f\x53\x45\x43\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c"
+);}if(rename(ZTE_WMS_TMP1_PATH,ZTE_WMS_SEC_PATH)!=(0x47b+7892-0x234f)){slog(
+SMS_PRINT,SLOG_ERR,
+"\x72\x65\x6e\x61\x6d\x65\x20\x57\x4d\x53\x5f\x54\x4d\x50\x31\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c"
+);}}}
+#endif	

+return ZTE_WMS_DB_OK;}}int zUfiSms_GetFirstColumnInt(void*fvarg,int columns,char
+**zresult,char**lname){if(columns>=(0xddd+464-0xfac)){if(zresult[
+(0x1638+847-0x1987)]==NULL){*(int*)fvarg=(0x1893+688-0x1b43);}else{*(int*)fvarg=
+atoi(zresult[(0x15a6+1215-0x1a65)]);}return SQLITE_OK;}else{return SQLITE_ERROR;
+}}int zUfiSms_SetCmdStatus(T_zUfiSms_StatusInfo*ptSetStatus){T_zUfiSms_DbResult 
+result=ZTE_WMS_DB_OK;char*strSQL=NULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x74\x43\x6d\x64\x53\x74\x61\x74\x75\x73\x20\x65\x6e\x74\x65\x72\x2e" "\n"
+);strSQL=sqlite3_mprintf(
+"\x49\x4e\x53\x45\x52\x54\x20\x4f\x52\x20\x52\x45\x50\x4c\x41\x43\x45\x20\x49\x4e\x54\x4f\x20\x25\x73\x28\x43\x6d\x64\x2c\x43\x6d\x64\x5f\x53\x74\x61\x74\x75\x73\x2c\x45\x72\x72\x5f\x43\x6f\x64\x65\x2c\x53\x65\x6e\x64\x5f\x46\x61\x69\x6c\x5f\x43\x6f\x75\x6e\x74\x2c\x44\x65\x6c\x5f\x43\x6f\x75\x6e\x74\x29\x20"
+"\x56\x41\x4c\x55\x45\x53\x28\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x29\x3b"
+,ZTE_WMS_DB_CMD_STATUS_TABLE,ptSetStatus->cmd,ptSetStatus->cmd_status,
+ptSetStatus->err_code,ptSetStatus->send_failed_count,ptSetStatus->
+delete_failed_count);result=zUfiSms_ExecSql(strSQL,NULL,NULL);sqlite3_free(
+strSQL);return isSucess(result);}void zUfiSms_SetParameterNv(T_zUfiSms_ParaInfo*
+para){if((0xfbd+4774-0x2263)==(int)para->status_report_on){sc_cfg_set(
+NV_REPORT_ENABLE,"\x30");}else{sc_cfg_set(NV_REPORT_ENABLE,"\x31");}if(
+(0x9e2+995-0xdc5)==(int)para->sendfail_retry_on){sc_cfg_set(NV_SENDFAIL_RETRY,
+"\x30");}else{sc_cfg_set(NV_SENDFAIL_RETRY,"\x31");}if((0x19c+4627-0x13af)==(int
+)para->outdate_delete_on){sc_cfg_set(NV_OUTDATE_DELETE,"\x30");}else{sc_cfg_set(
+NV_OUTDATE_DELETE,"\x31");}if(*(para->default_store)!='\0'){sc_cfg_set(
+NV_DEFAULT_STORE,(char*)para->default_store);}if((0x6db+1323-0xc06)==(int)para->
+mem_store){sc_cfg_set(NV_PRA_MEMSTORE,"\x30");}else{sc_cfg_set(NV_PRA_MEMSTORE,
+"\x31");}if((0x1738+1044-0x1a4d)==(int)para->tp_validity_period){sc_cfg_set(
+NV_SMS_VP,"\x6c\x6f\x6e\x67\x65\x73\x74");}else if((0x1482+3300-0x20b9)==(int)
+para->tp_validity_period){sc_cfg_set(NV_SMS_VP,"\x6f\x6e\x65\x77\x65\x65\x6b");}
+else if((0x416+785-0x680)==(int)para->tp_validity_period){sc_cfg_set(NV_SMS_VP,
+"\x6f\x6e\x65\x5f\x64\x61\x79");}else if((0x138b+2607-0x1d2b)==(int)para->
+tp_validity_period){sc_cfg_set(NV_SMS_VP,"\x74\x77\x65\x6c\x76\x65\x68");}printf
+(
+"\x77\x6d\x73\x5f\x64\x62\x5f\x73\x65\x74\x5f\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x3a\x3a\x20\x73\x65\x74\x20\x74\x70\x5f\x76\x61\x6c\x69\x64\x69\x74\x79\x5f\x70\x65\x72\x69\x6f\x64\x20\x25\x64" "\n"
+,(int)para->tp_validity_period);}int zUfiSms_SetDbParameters(T_zUfiSms_ParaInfo*
+para){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;char*strSQL=NULL;int count=
+(0x15b+4865-0x145c);if(NULL==para){return-(0x1aa+2177-0xa2a);}zUfiSms_ExecSql(
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20"
+ ZTE_WMS_DB_PARAMETER_TABLE"\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x31\x3b",
+zUfiSms_GetFirstColumnInt,&count);if(count>(0x140c+3365-0x2131)){strSQL=
+sqlite3_mprintf(
+"\x55\x50\x44\x41\x54\x45\x20\x25\x73\x20\x53\x45\x54\x20\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x3d\x27\x25\x64\x27\x2c\x53\x6d\x73\x5f\x53\x63\x61\x3d\x27\x25\x71\x27\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x64\x27\x2c\x54\x70\x5f\x56\x61\x6c\x69\x64\x69\x74\x79\x3d\x27\x25\x64\x27\x2c\x53\x65\x6e\x64\x5f\x52\x65\x74\x72\x79\x3d\x27\x25\x64\x27\x2c\x4f\x75\x74\x64\x61\x74\x65\x5f\x44\x65\x6c\x65\x74\x65\x3d\x27\x25\x64\x27\x2c\x44\x65\x66\x61\x75\x6c\x74\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x71\x27\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x31\x3b"
+,ZTE_WMS_DB_PARAMETER_TABLE,(int)para->status_report_on,para->sca,(int)para->
+mem_store,(int)para->tp_validity_period,(int)para->sendfail_retry_on,(int)para->
+outdate_delete_on,para->default_store,ZTE_WMS_DB_PARAMETER_TABLE);}else{strSQL=
+sqlite3_mprintf(
+"\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54\x4f\x20\x25\x73\x28\x69\x64\x2c\x20\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x2c\x53\x6d\x73\x5f\x53\x63\x61\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x2c\x54\x70\x5f\x56\x61\x6c\x69\x64\x69\x74\x79\x2c\x53\x65\x6e\x64\x5f\x52\x65\x74\x72\x79\x2c\x4f\x75\x74\x64\x61\x74\x65\x5f\x44\x65\x6c\x65\x74\x65\x2c\x44\x65\x66\x61\x75\x6c\x74\x5f\x53\x74\x6f\x72\x65\x2c\x4d\x61\x78\x5f\x43\x63\x5f\x52\x65\x66\x2c\x4d\x61\x78\x5f\x53\x6d\x73\x5f\x52\x65\x66\x29\x20"
+"\x56\x41\x4c\x55\x45\x53\x28\x27\x31\x27\x2c\x20\x27\x25\x64\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x71\x27\x2c\x27\x30\x27\x2c\x27\x30\x27\x29\x3b"
+,ZTE_WMS_DB_PARAMETER_TABLE,(int)para->status_report_on,para->sca,(int)para->
+mem_store,(int)para->tp_validity_period,(int)para->sendfail_retry_on,(int)para->
+outdate_delete_on,para->default_store);}result=zUfiSms_ExecSql(strSQL,NULL,NULL)
+;sqlite3_free(strSQL);if(result==ZTE_WMS_DB_OK){zUfiSms_SetParameterNv(para);
+return(0xfd8+198-0x109e);}return-(0x17d+6657-0x1b7d);}int zUfiSms_GetTotalCount(
+const char*pDbTable,int*pTotalCount){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;
+char*strSQL=NULL;strSQL=sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x71\x27\x3b"
+,pDbTable);result=zUfiSms_ExecSql(strSQL,zUfiSms_GetFirstColumnInt,pTotalCount);
+sqlite3_free(strSQL);return isSucess(result);}int zUfiSms_GetSmsMaxReferInDb(
+void){int max_sms_ref=-(0x139a+4947-0x26ec);zUfiSms_ExecSql(
+"\x53\x45\x4c\x45\x43\x54\x20\x4d\x61\x78\x5f\x53\x6d\x73\x5f\x52\x65\x66\x20\x46\x52\x4f\x4d\x20"
+ ZTE_WMS_DB_PARAMETER_TABLE
+"\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x3d\x20\x31\x3b",
+zUfiSms_GetFirstColumnInt,&max_sms_ref);return max_sms_ref;}int 
+zUfiSms_GetConcatInfo(char*mem_store,long id,T_zUfiSms_DbStoreStr*pac,char*
+content,int len){sqlite3_stmt*stmt=NULL;char*strSQL=sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x69\x6e\x64\x2c\x43\x63\x5f\x53\x65\x71\x2c\x43\x63\x5f\x43\x6f\x6e\x74\x65\x6e\x74\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x71\x27\x3b"
+,id,mem_store);(void)sqlite3_prepare(g_zUfiSms_DbPointer,strSQL,-
+(0x102+2933-0xc76),&stmt,(0xaf7+5571-0x20ba));while(SQLITE_ROW==sqlite3_step(
+stmt)){char*column_text=NULL;memset(pac->IndStr,(0x4ba+6692-0x1ede),sizeof(pac->
+IndStr));memset(pac->Seg_Seq,(0x13a7+4589-0x2594),sizeof(pac->Seg_Seq));if((
+column_text=sqlite3_column_text(stmt,(0x699+8114-0x264b)))!=NULL)strncpy(pac->
+IndStr,column_text,sizeof(pac->FormatInd)-(0x537+3345-0x1247));if((column_text=
+sqlite3_column_text(stmt,(0x8b7+6627-0x2299)))!=NULL)strncpy(pac->Seg_Seq,
+column_text,sizeof(pac->FormatSeq)-(0x6f3+2189-0xf7f));if((column_text=
+sqlite3_column_text(stmt,(0x184c+239-0x1939)))!=NULL)strncpy(content,column_text
+,len-(0x6b4+7554-0x2435));printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x43\x6f\x6e\x63\x61\x74\x49\x6e\x66\x6f\x3a\x25\x73\x2c\x25\x73" "\n"
+,pac->IndStr,pac->Seg_Seq);}(void)sqlite3_finalize(stmt);sqlite3_free(strSQL);
+return(0xcd0+1398-0x1246);}int zUfiSms_UpdateConcatSmsToDb(T_zUfiSms_DbStoreData
+*db_data,const char*mem_store,char*format_concat,char*content,
+T_zUfiSms_DbStoreStr*pac,int concat_num,long id){char*sql=NULL;
+T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;sql=sqlite3_mprintf(
+"\x55\x50\x44\x41\x54\x45\x20\x73\x6d\x73\x20\x53\x45\x54\x20\x69\x6e\x64\x3d\x27\x25\x73\x27\x2c\x54\x61\x67\x3d\x27\x25\x64\x27\x2c\x43\x63\x5f\x53\x65\x71\x3d\x27\x25\x73\x27\x2c\x43\x63\x5f\x4e\x75\x6d\x3d\x27\x25\x64\x27\x2c\x20"
+"\x43\x63\x5f\x43\x6f\x6e\x74\x65\x6e\x74\x3d\x27\x25\x71\x27\x2c\x43\x6f\x6e\x74\x65\x6e\x74\x3d\x27\x25\x71\x27\x2c\x59\x65\x61\x72\x3d\x27\x25\x71\x27\x2c\x4d\x6f\x6e\x74\x68\x3d\x27\x25\x71\x27\x2c\x20"
+"\x44\x61\x79\x3d\x27\x25\x71\x27\x2c\x48\x6f\x75\x72\x3d\x27\x25\x71\x27\x2c\x4d\x69\x6e\x75\x74\x65\x3d\x27\x25\x71\x27\x2c\x53\x65\x63\x6f\x6e\x64\x3d\x27\x25\x71\x27\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x3d\x27\x25\x71\x27\x20"
+"\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x71\x27\x3b"
+,pac->FormatInd,db_data->tag,pac->FormatSeq,concat_num,format_concat,content,
+db_data->julian_date.year,db_data->julian_date.month,db_data->julian_date.day,
+db_data->julian_date.hour,db_data->julian_date.min,db_data->julian_date.sec,
+db_data->julian_date.timezone,id,mem_store);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x55\x70\x64\x61\x74\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x3a\x25\x73\x2d\x2d\x25\x73" "\n"
+,sql,pac->FormatSeq);result=zUfiSms_ExecSql(sql,NULL,NULL);sqlite3_free(sql);
+return isSucess(result);}int zUfiSms_InsertConcatSmsToDb(T_zUfiSms_DbStoreData*
+db_data,const char*mem_store,char*format_concat,char*content,
+T_zUfiSms_DbStoreStr*pac,int concat_num){char*sql=NULL;T_zUfiSms_DbResult result
+=ZTE_WMS_DB_OK;sql=sqlite3_mprintf(
+"\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54\x4f\x20\x73\x6d\x73\x28\x69\x6e\x64\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x2c\x54\x61\x67\x2c\x4e\x75\x6d\x62\x65\x72\x2c\x43\x63\x5f\x53\x6d\x73\x2c\x43\x63\x5f\x52\x65\x66\x2c\x43\x63\x5f\x54\x6f\x74\x61\x6c\x2c\x43\x63\x5f\x53\x65\x71\x2c\x43\x63\x5f\x4e\x75\x6d\x2c\x43\x63\x5f\x43\x6f\x6e\x74\x65\x6e\x74\x2c\x54\x70\x5f\x44\x63\x73\x2c\x20\x4d\x73\x67\x5f\x52\x65\x66\x2c"
+"\x43\x6f\x6e\x74\x65\x6e\x74\x2c\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x5f\x52\x65\x63\x69\x76\x65\x64\x2c\x44\x72\x61\x66\x74\x5f\x47\x72\x6f\x75\x70\x5f\x49\x64\x2c\x59\x65\x61\x72\x2c\x4d\x6f\x6e\x74\x68\x2c\x44\x61\x79\x2c\x48\x6f\x75\x72\x2c\x4d\x69\x6e\x75\x74\x65\x2c\x53\x65\x63\x6f\x6e\x64\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x2c\x4d\x6b\x74\x69\x6d\x65\x2c\x44\x69\x73\x70\x6c\x61\x79\x4d\x6f\x64\x65\x29\x20"
+"\x56\x41\x4c\x55\x45\x53\x28" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c\x20\x27\x25\x64\x27\x2c" "\'" "\x25\x71" "\'" "\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c" "\'" "\x25\x71" "\'" "\x2c\x27\x25\x64\x27\x2c" "\'" "\x25\x71" "\'" "\x2c\x27\x25\x64\x27\x2c\x20\x27\x25\x64\x27\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c\x20" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c" "\'" "\x25\x71" "\'" "\x2c\x27\x25\x64\x27\x2c\x20\x27\x25\x64\x27\x29\x3b"
+,pac->FormatInd,mem_store,db_data->tag,db_data->number,db_data->concat_sms,
+db_data->concat_info[(0x185+8310-0x21fb)],db_data->concat_info[
+(0x1184+2574-0x1b91)],pac->FormatSeq,concat_num,format_concat,db_data->tp_dcs,
+db_data->msg_ref,content,"\x30",db_data->draft_group_id,db_data->julian_date.
+year,db_data->julian_date.month,db_data->julian_date.day,db_data->julian_date.
+hour,db_data->julian_date.min,db_data->julian_date.sec,db_data->julian_date.
+timezone,(unsigned int)zte_getsecond(db_data->julian_date),db_data->
+msg_displaymode);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x49\x6e\x73\x65\x72\x74\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x20\x73\x71\x6c\x3d\x25\x73\x2e" "\n"
+,sql);result=zUfiSms_ExecSql(sql,NULL,NULL);sqlite3_free(sql);return isSucess(
+result);}int zUfiSms_GetConcatMaxReferInDb(void){int ConcatMaxRefer=
+(0x32d+745-0x616);int result=(0x171d+2111-0x1f5c);result=zUfiSms_ExecSql(
+"\x53\x45\x4c\x45\x43\x54\x20\x4d\x61\x78\x5f\x43\x63\x5f\x52\x65\x66\x20\x46\x52\x4f\x4d\x20"
+ ZTE_WMS_DB_PARAMETER_TABLE
+"\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x3d\x20\x31\x3b",
+zUfiSms_GetFirstColumnInt,&ConcatMaxRefer);if(ZTE_WMS_DB_OK!=result){return-
+(0x1754+3707-0x25ce);}return ConcatMaxRefer;}int zUfiSms_CreateTables(){int iMap
+=(0xfb8+839-0x12ff);const T_zUfiSms_SQLMap SQL_MAP[]={{(0xf2f+2256-0x17fe),
+ZTE_WMS_CREATE_TABLE_SMS_SQL},{(0xf0b+114-0xf7c),ZTE_WMS_DEL_SIM_SQL},{
+(0x160+721-0x430),ZTE_WMS_CREATE_CMD_STATUS_SQL},{(0xd7c+6088-0x2543),
+ZTE_WMS_CREATE_SMS_REP_SQL},{(0xe8+7962-0x2001),ZTE_WMS_CREATE_PAR_SQL},{
+(0x19+1232-0x4e8),ZTE_WMS_CREATE_INFO_SQL},{(0x10ba+4254-0x2157),
+ZTE_WMS_CREATE_CELL_BRO_SQL},{(0x57f+5789-0x1c1b),
+ZTE_WMS_CREATE_SEND_CONTENT_SQL},};for(iMap=(0x222+2184-0xaaa);iMap<sizeof(
+SQL_MAP)/sizeof(T_zUfiSms_SQLMap);iMap++){if(SQL_MAP[iMap].valid==
+(0x1dec+1626-0x2445)){if(zUfiSms_ExecSql(SQL_MAP[iMap].strSQL,NULL,NULL)!=
+ZTE_WMS_DB_OK){return ZUFI_FAIL;}}}return ZUFI_SUCC;}int zUfiSms_CreateAllTable(
+void){if(ZTE_WMS_DB_OK!=zUfiSms_OpenDb()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x61\x6e\x20\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x64\x61\x74\x61\x62\x61\x73\x65\x2e\x72\x65\x74\x75\x72\x6e\x2e" "\n"
+);return ZTE_SMS_DB_ERROR_NOT_OPEN_DB;}return zUfiSms_CreateTables();}int 
+zUfiSms_DropAllTable(void){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;if(
+ZTE_WMS_DB_OK!=zUfiSms_OpenDb()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x61\x6e\x20\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x64\x61\x74\x61\x62\x61\x73\x65\x2e\x72\x65\x74\x75\x72\x6e\x2e" "\n"
+);return ZTE_SMS_DB_ERROR_NOT_OPEN_DB;}result=zUfiSms_ExecSql(
+ZTE_WMS_DROP_ALL_TABLE_SQL,NULL,NULL);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x3a\x20\x73\x71\x6c\x20\x3d\x20\x25\x73\x2c\x20\x72\x65\x73\x75\x6c\x74\x20\x3d\x20\x25\x64\x21\x20" "\n"
+,ZTE_WMS_DROP_ALL_TABLE_SQL,result);return ZUFI_SUCC;}int 
+zUfiSms_DropAllTableExceptSms(void){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;if(
+ZTE_WMS_DB_OK!=zUfiSms_OpenDb()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x61\x6e\x20\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x64\x61\x74\x61\x62\x61\x73\x65\x2e\x72\x65\x74\x75\x72\x6e\x2e" "\n"
+);return ZTE_SMS_DB_ERROR_NOT_OPEN_DB;}result=zUfiSms_ExecSql(
+ZTE_WMS_DROP_TABLE_EXCEPTSMS_SQL,NULL,NULL);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x3a\x20\x73\x71\x6c\x20\x3d\x20\x25\x73\x2c\x20\x72\x65\x73\x75\x6c\x74\x20\x3d\x20\x25\x64\x21\x20" "\n"
+,ZTE_WMS_DROP_ALL_TABLE_SQL,result);return ZUFI_SUCC;}int zUfiSms_IsDbEmpty(
+const char*tab,int*pCount){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;char*strSQL=
+sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20\x25\x73\x3b"
+,tab);result=zUfiSms_ExecSql(strSQL,zUfiSms_GetFirstColumnInt,pCount);
+sqlite3_free(strSQL);return isSucess(result);}int zUfiSms_InsertNormalSmsToDb(
+T_zUfiSms_DbStoreData*ptDbSaveData,const char*pStorePos,char*pContent){char*
+strSQL=NULL;T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;strSQL=sqlite3_mprintf(
+"\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54\x4f\x20\x73\x6d\x73\x28\x69\x6e\x64\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x2c\x54\x61\x67\x2c\x4e\x75\x6d\x62\x65\x72\x2c\x43\x63\x5f\x53\x6d\x73\x2c\x43\x63\x5f\x52\x65\x66\x2c\x43\x63\x5f\x54\x6f\x74\x61\x6c\x2c\x43\x63\x5f\x53\x65\x71\x2c\x54\x70\x5f\x44\x63\x73\x2c\x20"
+"\x4d\x73\x67\x5f\x52\x65\x66\x2c\x43\x6f\x6e\x74\x65\x6e\x74\x2c\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x5f\x52\x65\x63\x69\x76\x65\x64\x2c\x44\x72\x61\x66\x74\x5f\x47\x72\x6f\x75\x70\x5f\x49\x64\x2c\x59\x65\x61\x72\x2c\x4d\x6f\x6e\x74\x68\x2c\x44\x61\x79\x2c\x48\x6f\x75\x72\x2c\x4d\x69\x6e\x75\x74\x65\x2c\x53\x65\x63\x6f\x6e\x64\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x2c\x4d\x6b\x74\x69\x6d\x65\x2c\x44\x69\x73\x70\x6c\x61\x79\x4d\x6f\x64\x65\x29\x20\x56\x41\x4c\x55\x45\x53\x28\x27\x25\x64\x27\x2c\x27\x25\x71\x27\x2c\x20"
+"\x27\x25\x64\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x20"
+"\x27\x25\x71\x27\x2c\x27\x25\x71\x27\x2c\x27\x25\x75\x27\x2c\x20\x27\x25\x64\x27\x29\x3b"
+,ptDbSaveData->index,pStorePos,ptDbSaveData->tag,ptDbSaveData->number,
+ptDbSaveData->concat_sms,ptDbSaveData->concat_info[(0x14e1+42-0x150b)],
+ptDbSaveData->concat_info[(0x1ab+2232-0xa62)],ptDbSaveData->concat_info[
+(0xcf8+3907-0x1c39)],ptDbSaveData->tp_dcs,ptDbSaveData->msg_ref,pContent,"\x30",
+ptDbSaveData->draft_group_id,ptDbSaveData->julian_date.year,ptDbSaveData->
+julian_date.month,ptDbSaveData->julian_date.day,ptDbSaveData->julian_date.hour,
+ptDbSaveData->julian_date.min,ptDbSaveData->julian_date.sec,ptDbSaveData->
+julian_date.timezone,(unsigned int)zte_getsecond(ptDbSaveData->julian_date),
+ptDbSaveData->msg_displaymode);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x49\x6e\x73\x65\x72\x74\x4e\x6f\x72\x6d\x61\x6c\x53\x6d\x73\x54\x6f\x44\x62\x20\x73\x71\x6c\x3d\x25\x73" "\n"
+,strSQL);result=zUfiSms_ExecSql(strSQL,NULL,NULL);sqlite3_free(strSQL);return 
+isSucess(result);}int zUfiSms_UpdateNormalSmsToDb(T_zUfiSms_DbStoreData*
+ptDbSaveData,const char*pStorePos,char*pContent,long iSmsId){char*strSQL=NULL;
+T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;strSQL=sqlite3_mprintf(
+"\x55\x50\x44\x41\x54\x45\x20\x73\x6d\x73\x20\x53\x45\x54\x20\x4e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x2c\x43\x6f\x6e\x74\x65\x6e\x74\x3d\x27\x25\x71\x27\x2c\x59\x65\x61\x72\x3d\x27\x25\x71\x27\x2c\x4d\x6f\x6e\x74\x68\x3d\x27\x25\x71\x27\x2c\x20"
+"\x44\x61\x79\x3d\x27\x25\x71\x27\x2c\x48\x6f\x75\x72\x3d\x27\x25\x71\x27\x2c\x4d\x69\x6e\x75\x74\x65\x3d\x27\x25\x71\x27\x2c\x53\x65\x63\x6f\x6e\x64\x3d\x27\x25\x71\x27\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x3d\x27\x25\x71\x27\x20"
+"\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x20\x61\x6e\x64\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x71\x27\x3b"
+,ptDbSaveData->number,pContent,ptDbSaveData->julian_date.year,ptDbSaveData->
+julian_date.month,ptDbSaveData->julian_date.day,ptDbSaveData->julian_date.hour,
+ptDbSaveData->julian_date.min,ptDbSaveData->julian_date.sec,ptDbSaveData->
+julian_date.timezone,iSmsId,pStorePos);if(NULL==strSQL){return ZUFI_FAIL;}printf
+(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x55\x70\x64\x61\x74\x65\x4e\x6f\x72\x6d\x61\x6c\x53\x6d\x73\x54\x6f\x44\x62\x20\x73\x71\x6c\x3d\x25\x73" "\n"
+,strSQL);result=zUfiSms_ExecSql(strSQL,NULL,NULL);sqlite3_free(strSQL);return 
+isSucess(result);}int zUfiSms_GetFirstColumnStr(void*fvarg,int columns,char**
+zresult,char**lname){if(columns>=(0x33d+8227-0x235f)&&fvarg!=NULL){if(zresult[
+(0x1d12+2318-0x2620)]!=NULL){T_zUfiSms_BufInfo*para=(T_zUfiSms_BufInfo*)fvarg;
+strncpy(para->buf_addr,zresult[(0xcaf+5297-0x2160)],para->buf_len-
+(0x77f+4026-0x1738));return SQLITE_OK;}}return SQLITE_ERROR;}int 
+zUfiSms_GetStorePosById(char*item,char*item_data,int item_len,int id){
+T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;T_zUfiSms_BufInfo buf_info={
+(0x1d4a+769-0x204b)};char*strSQL=NULL;if(NULL==item||NULL==item_data){return 
+ZUFI_FAIL;}buf_info.buf_addr=item_data;buf_info.buf_len=item_len;strSQL=
+sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x25\x71\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,item,id);result=zUfiSms_ExecSql(strSQL,zUfiSms_GetFirstColumnStr,&buf_info);
+sqlite3_free(strSQL);if((ZTE_WMS_DB_OK!=result)||((0x1d7a+1557-0x238f)==strcmp(
+item_data,""))){at_print(LOG_ERR,
+"\x67\x65\x74\x20\x74\x61\x62\x6c\x65\x5f\x6d\x65\x6d\x62\x65\x72\x20\x62\x79\x20\x69\x64\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);return ZUFI_FAIL;}return ZUFI_SUCC;}int zUfiSms_DeleteSmsInDb(void){char sql[
+(0x992+5310-0x1dd0)]={(0xe29+3733-0x1cbe)};snprintf(sql,sizeof(sql),
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x61\x6e\x64\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SIM_TABLE,g_zUfiSms_DelMsg.sim_id[g_zUfiSms_DelMsg.sim_index-
+(0xdfc+5286-0x22a1)]);return isSucess(zUfiSms_ExecSql(sql,NULL,NULL));}int 
+zUfiSms_DeleteAllSimSmsInDb(void){return isSucess(zUfiSms_ExecSql(
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27"
+ ZTE_WMS_DB_SIM_TABLE"\x27\x3b",NULL,NULL));}int zUfiSms_DeleteNvSms(void){if(
+g_zUfiSms_StoreCapablity[ZTE_WMS_MEMORY_NV]==g_zUfiSms_DelMsg.nv_count){if(
+ZTE_WMS_DB_OK!=zUfiSms_ExecSql(
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27"
+ ZTE_WMS_DB_NV_TABLE"\x27\x3b",NULL,NULL)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x3a\x64\x65\x6c\x65\x74\x65\x20\x66\x61\x69\x6c" "\n"
+);return WMS_CMD_FAILED;}}else{int i=(0x10d4+557-0x1301);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x3a\x64\x65\x6c\x65\x74\x65\x20\x6e\x76\x5f\x63\x6f\x75\x6e\x74\x3d\x25\x64" "\n"
+,g_zUfiSms_DelMsg.nv_count);for(i=(0x1141+3886-0x206f);i<g_zUfiSms_DelMsg.
+nv_count;i++){char sql[(0x136+5889-0x17b7)]={(0xbda+447-0xd99)};snprintf(sql,
+sizeof(sql),
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x61\x6e\x64\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_NV_TABLE,g_zUfiSms_DelMsg.nv_id[i]);if(ZTE_WMS_DB_OK!=
+zUfiSms_ExecSql(sql,NULL,NULL)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x65\x78\x65\x63\x20\x73\x71\x6c\x20\x66\x61\x69\x6c\x65\x64\x2c\x69\x3d\x25\x64" "\n"
+,i);return WMS_CMD_FAILED;}}}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x3a\x64\x65\x6c\x65\x74\x65\x20\x73\x75\x63\x63\x65\x73\x73" "\n"
+);return WMS_CMD_SUCCESS;}int zUfiSms_GetSmsIndex(int id,T_zUfiSms_ModifyTag*
+ptModifyTag,int is_cc){char sql[(0x6e5+168-0x70d)]={(0x12b9+4884-0x25cd)};
+T_zUfiSms_BufInfo buf_info={(0x6fc+791-0xa13)};char str_index[(0x9d3+1512-0xfb9)
+*WMS_MESSAGE_LIST_MAX]={(0x5a1+7115-0x216c)};buf_info.buf_addr=str_index;
+buf_info.buf_len=sizeof(str_index);snprintf(sql,sizeof(sql),
+"\x53\x45\x4c\x45\x43\x54\x20\x69\x6e\x64\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,id);if(zUfiSms_ExecSql(sql,zUfiSms_GetFirstColumnStr,&buf_info)!=ZTE_WMS_DB_OK)
+{at_print(LOG_ERR,
+"\x6f\x70\x65\x6e\x20\x74\x61\x62\x6c\x65\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64"
+);return ZUFI_FAIL;}if((0x5e9+5112-0x19e0)==is_cc){int i=(0x466+7097-0x201f);int
+ j=(0x10bc+3567-0x1eab);int count=(0x107+7533-0x1e74);char**out_result=NULL;
+count=zUfiSms_SplitString(str_index,&out_result,((char)(0x147d+2216-0x1cea)));
+for(i=(0x883+7539-0x25f6);i<count;i++){if((0x190b+2427-0x2286)!=strcmp(
+out_result[i],"")){ptModifyTag->indices[j++]=atoi(out_result[i]);}}ptModifyTag->
+num_of_indices=j;free(out_result);}else{ptModifyTag->indices[(0x21ba+330-0x2304)
+]=atoi(str_index);ptModifyTag->num_of_indices=(0x199+7151-0x1d87);}ptModifyTag->
+total_indices=ptModifyTag->num_of_indices;printf(
+"\x6d\x6f\x64\x69\x66\x79\x5f\x74\x61\x67\x5f\x70\x74\x72\x2d\x3e\x74\x6f\x74\x61\x6c\x5f\x69\x6e\x64\x69\x63\x65\x73\x3d\x25\x64" "\n"
+,ptModifyTag->total_indices);return ZUFI_SUCC;}int zUfiSms_IsConcatSms(int id){
+char sql[(0x268+4914-0x151a)]={(0x445+4138-0x146f)};int is_cc=
+(0x293+7365-0x1f58);T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;snprintf(sql,sizeof(
+sql),
+"\x53\x45\x4c\x45\x43\x54\x20\x43\x63\x5f\x53\x6d\x73\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,id);result=zUfiSms_ExecSql(sql,zUfiSms_GetFirstColumnInt,&
+is_cc);if(ZTE_WMS_DB_OK!=result){at_print(LOG_ERR,
+"\x6f\x70\x65\x6e\x20\x74\x61\x62\x6c\x65\x20\x25\x73\x20\x66\x61\x69\x6c\x65\x64"
+,ZTE_WMS_DB_SMS_TABLE);return-(0xcd0+3418-0x1a29);}return is_cc;}int 
+zUfiSms_UpdateSmsTagInDb(unsigned long id,unsigned int tags){char sql[
+(0x2249+384-0x2349)]={(0xcea+3599-0x1af9)};snprintf(sql,sizeof(sql),
+"\x55\x50\x44\x41\x54\x45\x20\x25\x73\x20\x53\x45\x54\x20\x54\x61\x67\x3d\x27\x25\x64\x27\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,tags,id);return isSucess(zUfiSms_ExecSql(sql,NULL,NULL));}
+int zUfiSms_GetTagCountInDb(T_zUfiSms_MemoryType mem_store,unsigned int tags,int
+*pTotalCount){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;char sql[
+(0xe89+2312-0x1711)]={(0x65f+1470-0xc1d)};if(pTotalCount==NULL){return ZUFI_FAIL
+;}if(mem_store==ZTE_WMS_MEMORY_MAX){snprintf(sql,sizeof(sql),
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x54\x61\x67\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,tags);}else if(mem_store==ZTE_WMS_MEMORY_NV){snprintf(sql,
+sizeof(sql),
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x41\x4e\x44\x20\x54\x61\x67\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,ZTE_WMS_DB_NV_TABLE,tags);}else{snprintf(sql,sizeof(sql),
+"\x53\x45\x4c\x45\x43\x54\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x41\x4e\x44\x20\x54\x61\x67\x3d\x27\x25\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,ZTE_WMS_DB_SIM_TABLE,tags);}result=zUfiSms_ExecSql(sql,(
+zte_wms_db_callback)zUfiSms_GetFirstColumnInt,pTotalCount);return isSucess(
+result);}int zUfiSms_DeleteDraftSms(long iSmsId){char sql[(0xcd4+6820-0x26f8)]={
+(0x8a+340-0x1de)};snprintf(sql,sizeof(sql),
+"\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x27\x25\x6c\x64\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,iSmsId);return isSucess(zUfiSms_ExecSql(sql,NULL,NULL));}
+int zUfiSms_SetConcatMaxRefer(int ref){char sql[(0x420+6292-0x1c34)]={
+(0x62f+6419-0x1f42)};if(ZTE_WMS_MAX_CONCAT_REF<ref){ref=(0xd61+841-0x10aa);}
+snprintf(sql,sizeof(sql),
+"\x55\x50\x44\x41\x54\x45\x20\x25\x73\x20\x53\x45\x54\x20\x4d\x61\x78\x5f\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x31\x3b"
+,ZTE_WMS_DB_PARAMETER_TABLE,ref);return isSucess(zUfiSms_ExecSql(sql,NULL,NULL))
+;}int zUfiSms_SetMaxReference(int ref){char sql[(0xd54+1123-0x1137)]={
+(0x2300+163-0x23a3)};if(ZTE_WMS_MAX_SMS_REF<ref){ref=(0x87b+4801-0x1b3c);}
+snprintf(sql,sizeof(sql),
+"\x55\x50\x44\x41\x54\x45\x20\x25\x73\x20\x53\x45\x54\x20\x4d\x61\x78\x5f\x53\x6d\x73\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3d\x31\x3b"
+,ZTE_WMS_DB_PARAMETER_TABLE,ref);return isSucess(zUfiSms_ExecSql(sql,NULL,NULL))
+;}int zUfiSms_InsertReportStatusToDb(unsigned char*pNumber,T_zUfiSms_Date*
+ptSmsDate,int iReportStatus){char*strSQL=NULL;T_zUfiSms_DbResult result=
+ZTE_WMS_DB_OK;strSQL=sqlite3_mprintf(
+"\x49\x4e\x53\x45\x52\x54\x20\x49\x4e\x54\x4f\x20\x73\x6d\x73\x5f\x72\x65\x70\x6f\x72\x74\x28\x61\x64\x64\x72\x65\x73\x73\x2c\x63\x6f\x6e\x74\x65\x6e\x74\x2c\x59\x65\x61\x72\x2c\x4d\x6f\x6e\x74\x68\x2c\x44\x61\x79\x2c\x48\x6f\x75\x72\x2c\x4d\x69\x6e\x75\x74\x65\x2c\x53\x65\x63\x6f\x6e\x64\x2c\x54\x69\x6d\x65\x5a\x6f\x6e\x65\x29\x20"
+"\x56\x41\x4c\x55\x45\x53\x28\x27\x25\x73\x27\x2c\x27\x25\x64\x27\x2c\x27\x25\x73\x27\x2c\x27\x25\x73\x27\x2c\x27\x25\x73\x27\x2c\x27\x25\x73\x27\x2c\x20\x27\x25\x73\x27\x2c\x27\x25\x73\x27\x2c\x27\x25\x73\x27\x29\x3b"
+,pNumber,iReportStatus,ptSmsDate->year,ptSmsDate->month,ptSmsDate->day,ptSmsDate
+->hour,ptSmsDate->min,ptSmsDate->sec,ptSmsDate->timezone);result=zUfiSms_ExecSql
+(strSQL,NULL,NULL);sqlite3_free(strSQL);return isSucess(result);}int 
+zUfiSms_GetFirstColumnParaInfo(void*fvarg,int columns,char**zresult,char**lname)
+{if(columns>=(0xaf6+5536-0x2095)&&fvarg!=NULL){if(zresult[(0x8b9+5235-0x1d2c)]!=
+NULL){T_zUfiSms_ParaInfo*para=(T_zUfiSms_ParaInfo*)fvarg;strncpy(para->sca,
+zresult[(0x1a9a+80-0x1aea)],sizeof(para->sca)-(0x863+1275-0xd5d));para->
+mem_store=atoi(zresult[(0xa8a+5390-0x1f97)]);para->tp_validity_period=atoi(
+zresult[(0x873+96-0x8d1)]);para->status_report_on=atoi(zresult[
+(0xa4f+4707-0x1caf)]);para->sendfail_retry_on=atoi(zresult[(0x5c6+4934-0x1908)])
+;para->outdate_delete_on=atoi(zresult[(0x1a73+1569-0x208f)]);(void)strncpy(para
+->default_store,zresult[(0xa1c+5676-0x2042)],sizeof(para->default_store)-
+(0x64f+7128-0x2226));return SQLITE_OK;}}return SQLITE_ERROR;}int 
+zUfiSms_GetDbParameters(void){char*strSQL=
+"\x53\x45\x4c\x45\x43\x54\x20\x53\x6d\x73\x5f\x53\x63\x61\x2c\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x2c\x54\x70\x5f\x56\x61\x6c\x69\x64\x69\x74\x79\x2c\x53\x6d\x73\x5f\x52\x65\x70\x6f\x72\x74\x2c\x53\x65\x6e\x64\x5f\x52\x65\x74\x72\x79\x2c\x4f\x75\x74\x64\x61\x74\x65\x5f\x44\x65\x6c\x65\x74\x65\x2c\x44\x65\x66\x61\x75\x6c\x74\x5f\x53\x74\x6f\x72\x65\x20\x46\x52\x4f\x4d\x20"
+ ZTE_WMS_DB_PARAMETER_TABLE"\x3b";memset(&g_zUfiSms_CurSmsPara,
+(0x12f9+4445-0x2456),sizeof(T_zUfiSms_ParaInfo));return isSucess(zUfiSms_ExecSql
+(strSQL,zUfiSms_GetFirstColumnParaInfo,&g_zUfiSms_CurSmsPara));}int 
+zUfiSms_GetSendContent(void*fvarg,int column,char**zresult,char**lname){
+T_zUfiSms_BufInfo*para=(T_zUfiSms_BufInfo*)fvarg;if(column>=(0x219+7385-0x1ef1)
+&&para!=NULL)(void)strncpy(para->buf_addr,zresult[(0x2cf+313-0x408)],para->
+buf_len-(0x1b4d+2377-0x2495));return(0xbba+4265-0x1c63);}int 
+zUfiSms_GetSmsContent(char*pSmsBuf,int len){T_zUfiSms_BufInfo buf_info={
+(0x1d01+1416-0x2289)};char*strSQL=
+"\x53\x45\x4c\x45\x43\x54\x20\x6d\x73\x67\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x20\x46\x52\x4f\x4d\x20"
+ ZTE_WMS_DB_SEND_CONTENT_TABLE"\x3b";buf_info.buf_addr=pSmsBuf;buf_info.buf_len=
+len;memset(buf_info.buf_addr,(0x7bd+973-0xb8a),len);return isSucess(
+zUfiSms_ExecSql(strSQL,zUfiSms_GetSendContent,&buf_info));}int 
+zUfiSms_SearchConcatSmsInDb(T_zUfiSms_DbStoreData*ptDbSaveData,char*pMemStore){
+char*sql=NULL;sqlite3_stmt*stmt=NULL;int id=-(0x1552+3618-0x2373);switch(
+ptDbSaveData->tag){case WMS_TAG_TYPE_MO_SENT_V01:case 
+WMS_TAG_TYPE_MO_NOT_SENT_V01:{sql=sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x43\x63\x5f\x53\x65\x71\x2c\x69\x64\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x54\x6f\x74\x61\x6c\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x41\x4e\x44\x20\x28\x54\x61\x67\x20\x3d\x20\x27\x25\x64\x27\x20\x4f\x52\x20\x54\x61\x67\x3d\x20\x27\x25\x64\x27\x29\x3b"
+,ptDbSaveData->number,ptDbSaveData->concat_info[(0x1155+4005-0x20fa)],
+ptDbSaveData->concat_info[(0x11eb+2345-0x1b13)],pMemStore,
+WMS_TAG_TYPE_MO_SENT_V01,WMS_TAG_TYPE_MO_NOT_SENT_V01);break;}case
+(0x1a7c+1586-0x20aa):{sql=sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x43\x63\x5f\x53\x65\x71\x2c\x69\x64\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x54\x6f\x74\x61\x6c\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x41\x4e\x44\x20\x54\x61\x67\x20\x3d\x20\x27\x25\x64\x27\x3b"
+,ptDbSaveData->number,ptDbSaveData->concat_info[(0xe07+2245-0x16cc)],
+ptDbSaveData->concat_info[(0x200+7307-0x1e8a)],pMemStore,(0x1413+711-0x16d6));
+break;}case WMS_TAG_TYPE_MT_READ_V01:case WMS_TAG_TYPE_MT_NOT_READ_V01:{sql=
+sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x43\x63\x5f\x53\x65\x71\x2c\x69\x64\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x54\x6f\x74\x61\x6c\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x20\x41\x4e\x44\x20\x28\x54\x61\x67\x20\x3d\x20\x27\x25\x64\x27\x20\x4f\x52\x20\x54\x61\x67\x3d\x20\x27\x25\x64\x27\x29\x3b"
+,ptDbSaveData->number,ptDbSaveData->concat_info[(0x9b0+4881-0x1cc1)],
+ptDbSaveData->concat_info[(0x618+31-0x636)],pMemStore,WMS_TAG_TYPE_MT_READ_V01,
+WMS_TAG_TYPE_MT_NOT_READ_V01);break;}default:{sql=sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x43\x63\x5f\x53\x65\x71\x2c\x69\x64\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x4e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x54\x6f\x74\x61\x6c\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x3b"
+,ptDbSaveData->number,ptDbSaveData->concat_info[(0x2b7+355-0x41a)],ptDbSaveData
+->concat_info[(0xcd9+2799-0x17c7)],pMemStore);at_print(LOG_ERR,
+"\x74\x61\x67\x20\x25\x64\x20\x69\x73\x20\x75\x6e\x6b\x6e\x6f\x77\x6e",
+ptDbSaveData->tag);break;}}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x3a\x25\x73" "\n",sql);if(
+sqlite3_prepare(g_zUfiSms_DbPointer,sql,-(0x13a1+2788-0x1e84),&stmt,
+(0xd53+3471-0x1ae2))!=SQLITE_OK){at_print(LOG_ERR,
+"\x63\x61\x6e\x20\x6e\x6f\x74\x20\x65\x78\x65\x63\x20\x73\x71\x6c\x2c\x73\x71\x6c\x69\x74\x65\x33\x5f\x65\x72\x72\x6d\x73\x67\x3a\x25\x73\x2e" "\n"
+,sqlite3_errmsg(g_zUfiSms_DbPointer));sqlite3_free(sql);return-
+(0x1607+1862-0x1d4c);}while(SQLITE_ROW==sqlite3_step(stmt)){int j=
+(0xa3b+1491-0x100e);char**out_result=NULL;char*column_text=sqlite3_column_text(
+stmt,(0x436+4562-0x1608));int count=-(0x306+4454-0x146b);if(column_text!=NULL)
+count=zUfiSms_SplitString(column_text,&out_result,((char)(0x928+2108-0x1129)));
+for(j=(0xdfb+2675-0x186e);j<count;j++){if((0xf1b+721-0x11ec)==strcmp(out_result[
+j],"")){if(j+(0x109f+4285-0x215b)==ptDbSaveData->concat_info[
+(0x1920+2864-0x244e)]){id=sqlite3_column_int(stmt,(0x1d98+2296-0x268f));break;}}
+}if(out_result!=NULL){free(out_result);out_result=NULL;}if(-(0x81d+458-0x9e6)!=
+id){break;}}(void)sqlite3_finalize(stmt);sqlite3_free(sql);return id;}int 
+zUfiSms_CheckDbOutdateSms_Callback(void*fvarg,int columns,char**zresult,char**
+lname){if(fvarg!=NULL&&columns>=(0x8a5+218-0x97e)){if(zresult[
+(0x54f+6622-0x1f2d)]!=NULL){T_zUfiSms_DelReq*result=(T_zUfiSms_DelReq*)fvarg;
+result->id[result->all_or_count]=atoi(zresult[(0x1230+4965-0x2595)]);result->
+all_or_count++;return SQLITE_OK;}}return SQLITE_ERROR;}VOID 
+zUfiSms_CheckDbOutdateSms(const char*pDbTable,T_zUfiSms_DelReq*pSmsDel){char 
+acSql[(0x555+5846-0x1bab)]={(0x1422+3897-0x235b)};struct timeval tp;if(
+(0x144+7158-0x1d3a)!=gettimeofday(&tp,NULL)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x67\x65\x74\x74\x69\x6d\x65\x6f\x66\x64\x61\x79\x20\x65\x72\x72\x6f\x72\x21\x21\x21"
+);return;}if(tp.tv_sec<=OUTDATEINTERVAL){return;}snprintf(acSql,sizeof(acSql),
+"\x53\x45\x4c\x45\x43\x54\x20\x69\x64\x20\x46\x52\x4f\x4d\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x4d\x6b\x74\x69\x6d\x65\x3c\x27\x25\x75\x27\x20\x41\x4e\x44\x20\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65\x3d\x27\x25\x73\x27\x3b"
+,ZTE_WMS_DB_SMS_TABLE,(unsigned int)(tp.tv_sec-OUTDATEINTERVAL),pDbTable);if(
+ZTE_WMS_DB_OK!=zUfiSms_ExecSql(acSql,zUfiSms_CheckDbOutdateSms_Callback,pSmsDel)
+){at_print(LOG_ERR,
+"\x6f\x70\x65\x6e\x20\x74\x61\x62\x6c\x65\x20\x25\x73\x20\x66\x61\x69\x6c\x65\x64"
+,ZTE_WMS_DB_CMD_STATUS_TABLE);}return;}int 
+zUfiSms_GetCurrentRecvTotalSeq_Callback(void*fvarg,int column,char**zresult,char
+**lname){if(fvarg!=NULL&&column>=(0xef2+4631-0x2107)){if(zresult[
+(0x11e8+4187-0x2243)]!=NULL&&zresult[(0x180f+143-0x189d)]!=NULL){SMS_MSG_INFO*
+msg=(SMS_MSG_INFO*)fvarg;memset(msg->id,(0x1beb+2115-0x242e),sizeof(msg->id));
+memset(msg->total_seq,(0x11d2+4763-0x246d),sizeof(msg->total_seq));strncpy(msg->
+id,zresult[(0x48c+4658-0x16be)],sizeof(msg->id)-(0x15cb+2018-0x1dac));strncpy(
+msg->total_seq,zresult[(0xc84+4466-0x1df5)],sizeof(msg->total_seq)-
+(0xf24+3865-0x1e3c));printf(
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x43\x75\x72\x72\x65\x6e\x74\x52\x65\x63\x76\x54\x6f\x74\x61\x6c\x53\x65\x71\x5f\x43\x61\x6c\x6c\x62\x61\x63\x6b\x20\x69\x64\x20\x3d\x20\x25\x73\x2c\x20\x74\x6f\x74\x61\x6c\x5f\x73\x65\x71\x20\x3d\x20\x25\x73" "\n"
+,msg->id,msg->total_seq);return SQLITE_OK;}}return SQLITE_ERROR;}int 
+zUfiSms_GetCurrentRecvTotalSeq(T_zUfiSms_DbStoreData*ptDbSaveData,SMS_MSG_INFO*
+pmsg){T_zUfiSms_DbResult result=ZTE_WMS_DB_OK;char*strSQL=NULL;strSQL=
+sqlite3_mprintf(
+"\x53\x45\x4c\x45\x43\x54\x20\x69\x64\x2c\x20\x43\x63\x5f\x4e\x75\x6d\x20\x46\x52\x4f\x4d\x20\x73\x6d\x73\x20\x57\x48\x45\x52\x45\x20\x20\x6e\x75\x6d\x62\x65\x72\x3d\x27\x25\x71\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x52\x65\x66\x3d\x27\x25\x64\x27\x20\x41\x4e\x44\x20\x43\x63\x5f\x54\x6f\x74\x61\x6c\x3d\x27\x25\x64\x27\x3b"
+,ptDbSaveData->number,ptDbSaveData->concat_info[(0x911+3339-0x161c)],
+ptDbSaveData->concat_info[(0x1cc3+1693-0x235f)]);printf(
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x43\x75\x72\x72\x65\x6e\x74\x52\x65\x63\x76\x54\x6f\x74\x61\x6c\x53\x65\x71\x20\x73\x71\x6c\x20\x3a\x20\x25\x73\x20" "\n"
+,strSQL);result=zUfiSms_ExecSql(strSQL,zUfiSms_GetCurrentRecvTotalSeq_Callback,
+pmsg);sqlite3_free(strSQL);return isSucess(result);}
diff --git a/ap/app/zte_comm/sms/src/sms_fnc.c b/ap/app/zte_comm/sms/src/sms_fnc.c
new file mode 100755
index 0000000..ca36ccf
--- /dev/null
+++ b/ap/app/zte_comm/sms/src/sms_fnc.c
@@ -0,0 +1,1193 @@
+
+#include <fcntl.h>

+#include <stdio.h>

+#include <sys/types.h>

+#include <fcntl.h>

+#include <sys/time.h>

+#include <limits.h>

+#include "sms_fnc.h"

+#include "sms_db.h"

+#include "sms_code.h"

+#define SMS_RETRY_COUNT (0x1724+3554-0x2503)

+#define SHORT_INT_LEN (0x1e1+7983-0x210a)

+SMS_LOCATION g_zUfiSms_CurLocation=SMS_LOCATION_SIM;int 
+g_zUfiSms_ConcatSmsReference=(0x692+4359-0x1799);T_zUfiSms_ParaInfo 
+g_zUfiSms_CurSmsPara={"",WMS_STORAGE_TYPE_UIM_V01,
+ZTE_WMS_SMS_DEFAULT_TP_VALIDITY_PERIOD_GW,(0x26b+8859-0x2506),
+(0x153b+2179-0x1dbe),(0x13f+6602-0x1b09),"\x6e\x76"};int g_zUfiSms_Language=
+NOT_DEFINE_LANGUAGE;int g_zUfiSms_Dcs=(0x157f+1090-0x19c1);unsigned long 
+g_zUfiSms_StoreCapablity[ZTE_WMS_MEMORY_MAX]={(0x93a+6807-0x236d),
+ZTE_WMS_DB_MSG_COUNT_MAX};T_zSms_SendSmsReq g_zUfiSms_FinalCmgsBuf;SMS_PARAM 
+g_zUfiSms_SendingSms;UINT16 g_zUfiSms_IsLanguageShift=(0x9a2+6667-0x23ad);extern
+ int g_zUfiSms_MsgRefer;extern T_zUfiSms_DelSms g_zUfiSms_DelMsg;extern 
+T_zUfiSms_DelIndexInfo g_deleteIndex;extern T_zUfiSms_ModifyIndexInfo 
+g_modifyIndex;extern T_zUfiSms_ModifySms g_zUfiSms_modifyMsg;extern UINT8 
+g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_MAX];extern int g_zUfiSms_ConcatTotalNum;
+extern T_zUfiSms_ConcatInfo g_zUfiSms_ConcatSms;extern T_zUfiSms_GroupInfo 
+g_zUfiSms_GroupSms;extern int g_zUfiSms_UnitLen;extern UINT8 
+g_zUfiSms_IsConcatSendSuc;extern int g_zUfiSms_SendFailedCount;extern 
+T_zUfiSms_DbStoreData g_zUfiSms_DbStoreData[ZTE_WMS_CONCAT_SMS_COUNT_MAX];extern
+ int g_zUfiSms_SendFailedRetry;void zUfiSms_SetSmsLocation(SMS_LOCATION 
+eLocation){switch(eLocation){case SMS_LOCATION_SIM:{g_zUfiSms_CurLocation=
+SMS_LOCATION_SIM;break;}case SMS_LOCATION_ME:{g_zUfiSms_CurLocation=
+SMS_LOCATION_ME;break;}default:{return;}}}int zUfiSms_SetDeleteInfo(
+T_zUfiSms_DelReq*ptDelMsg){char acStorePos[(0x19b9+895-0x1d06)];int i=
+(0xaaf+5336-0x1f87);g_zUfiSms_DelMsg.nv_count=(0x191b+2863-0x244a);
+g_zUfiSms_DelMsg.nv_index=(0x2dd+9023-0x261c);g_zUfiSms_DelMsg.sim_count=
+(0x1e2a+2009-0x2603);g_zUfiSms_DelMsg.sim_index=(0xa6b+4922-0x1da5);for(i=
+(0x3a6+1237-0x87b);i<ptDelMsg->all_or_count;i++){memset(acStorePos,
+(0x20ad+710-0x2373),sizeof(acStorePos));if(ZUFI_FAIL==zUfiSms_GetStorePosById(
+"Mem_Store",acStorePos,sizeof(acStorePos),ptDelMsg->id[i])){return ZUFI_FAIL;}if
+((0x3a+4474-0x11b4)==strcmp(acStorePos,ZTE_WMS_DB_NV_TABLE)){g_zUfiSms_DelMsg.
+nv_id[g_zUfiSms_DelMsg.nv_count]=ptDelMsg->id[i];g_zUfiSms_DelMsg.nv_count++;
+g_zUfiSms_DelMsg.nv_index_count++;}else if((0x708+1891-0xe6b)==strcmp(acStorePos
+,ZTE_WMS_DB_SIM_TABLE)){g_zUfiSms_DelMsg.sim_id[g_zUfiSms_DelMsg.sim_count]=
+ptDelMsg->id[i];g_zUfiSms_DelMsg.sim_count++;g_zUfiSms_DelMsg.sim_index_count++;
+}}return ZUFI_SUCC;}void zUfiSms_ChangeMainState(T_zUfiSms_MainState iNewState){
+char*ptStrSmsState[]={"\x73\x6d\x73\x5f\x69\x6e\x69\x74\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x69\x6e\x69\x74\x65\x64",
+"\x73\x6d\x73\x5f\x6c\x6f\x61\x64\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x6c\x6f\x61\x64\x65\x64",
+"\x73\x6d\x73\x5f\x73\x65\x6e\x64\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x73\x65\x6e\x64\x65\x64",
+"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x64\x65\x6c\x65\x64",
+"\x73\x6d\x73\x5f\x72\x65\x63\x76\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x72\x65\x63\x76\x65\x64",
+"\x73\x6d\x73\x5f\x73\x61\x76\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x73\x61\x76\x65\x64",
+"\x73\x6d\x73\x5f\x64\x65\x6c\x73\x61\x76\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x64\x65\x6c\x73\x61\x76\x65\x64",
+"\x73\x6d\x73\x5f\x73\x69\x6d\x5f\x6c\x6f\x61\x64\x65\x64",
+"\x73\x6d\x73\x5f\x73\x65\x74\x74\x69\x6e\x67",
+"\x73\x6d\x73\x5f\x68\x61\x76\x65\x73\x65\x74",
+"\x73\x6d\x73\x5f\x63\x6f\x6e\x63\x61\x74\x73\x65\x6e\x64\x69\x6e\x67",};switch(
+iNewState){case SMS_STATE_INITING:case SMS_STATE_INITED:case SMS_STATE_LOADING:
+case SMS_STATE_LOADED:case SMS_STATE_SIM_LOADED:case SMS_STATE_SENDING:case 
+SMS_STATE_SENDED:case SMS_STATE_DELING:case SMS_STATE_DELED:case 
+SMS_STATE_RECVING:case SMS_STATE_RECVED:case SMS_STATE_DELSAVING:case 
+SMS_STATE_DELSAVED:{break;}default:{return;}}sc_cfg_set(NV_SMS_STATE,
+ptStrSmsState[iNewState]);}int zUfiSms_CheckStoreDir(void){if(-
+(0x1f11+1232-0x23e0)==access(ZTE_WMS_DB_DIR,F_OK)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x25\x73\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x65\x78\x69\x73\x74\x2c\x73\x6f\x63\x72\x65\x61\x74\x65\x20\x69\x74\x2e" "\n"
+,ZTE_WMS_DB_DIR);if(-(0xc27+1129-0x108f)==mkdir(ZTE_WMS_DB_DIR,
+(0x5e3+5166-0x1812))){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x66\x61\x69\x6c\x65\x64\x20\x74\x6f\x20\x63\x72\x65\x61\x74\x65\x20\x64\x62\x20\x64\x69\x72\x2e" "\n"
+);return ZUFI_FAIL;}}return ZUFI_SUCC;}int zUfiSms_CheckSmsDb(void){if(-
+(0x16ec+2738-0x219d)==access(ZTE_WMS_DB_PATH,F_OK)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x25\x73\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x65\x78\x69\x73\x74\x2c\x73\x6f\x20\x67\x65\x74\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x63\x6f\x6e\x66\x69\x67\x2e" "\n"
+,ZTE_WMS_DB_PATH);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x3d\x3d\x3d\x3d\x3d\x3d\x25\x73\x20\x65\x78\x69\x73\x74\x2e" "\n"
+,ZTE_WMS_DB_PATH);return ZUFI_SUCC;}void zUfiSms_GetDefaultCfgPara(void){
+unsigned char sts_flag=(0xb74+771-0xe77);unsigned char mem_store_flag=
+(0xfa6+3038-0x1b84);unsigned int tp_validity_period=(0xd53+2543-0x1742);char 
+Temp_sms_vp[(0x1242+3892-0x216e)]={(0x1c6c+563-0x1e9f)};CHAR reportEnable[
+(0xa9b+2816-0x1569)]={(0x1633+2679-0x20aa)};CHAR smsLocation[(0x72+4280-0x10f8)]
+={(0x13b4+1090-0x17f6)};CHAR sendfailRetry[(0xf5a+873-0x1291)]={
+(0x37d+8203-0x2388)};CHAR outdateDelete[(0x1b6d+890-0x1eb5)]={(0x5d8+583-0x81f)}
+;CHAR defaultStore[(0xf4f+2795-0x1a08)]={(0x1658+2353-0x1f89)};sc_cfg_get(
+NV_REPORT_ENABLE,reportEnable,sizeof(reportEnable));sc_cfg_get(
+NV_SMS_LOCATION_SET,smsLocation,sizeof(smsLocation));sc_cfg_get(
+NV_SENDFAIL_RETRY,sendfailRetry,sizeof(sendfailRetry));sc_cfg_get(
+NV_OUTDATE_DELETE,outdateDelete,sizeof(outdateDelete));sc_cfg_get(
+NV_DEFAULT_STORE,defaultStore,sizeof(defaultStore));if((0x8e3+5065-0x1cac)==
+strcmp(reportEnable,"\x31")){sts_flag=(0x53b+6460-0x1e76);}g_zUfiSms_CurSmsPara.
+status_report_on=sts_flag;if((0x5df+3266-0x12a1)==strcmp(smsLocation,"\x4d\x45")
+){mem_store_flag=(0x64c+2947-0x11cf);}else{mem_store_flag=(0x926+7021-0x2492);}
+g_zUfiSms_CurSmsPara.mem_store=(unsigned int)((0x15b0+1099-0x19fb)==
+mem_store_flag?WMS_STORAGE_TYPE_NV_V01:WMS_STORAGE_TYPE_UIM_V01);sc_cfg_get(
+NV_SMS_VP,Temp_sms_vp,sizeof(Temp_sms_vp));tp_validity_period=
+(0x1f08+424-0x1fb1);if((0xb33+649-0xdbc)==strncmp(Temp_sms_vp,
+"\x6c\x6f\x6e\x67\x65\x73\x74",(0x12e7+688-0x1590))){tp_validity_period=
+(0x2592+411-0x262e);}if((0x19ef+741-0x1cd4)==strncmp(Temp_sms_vp,
+"\x6f\x6e\x65\x5f\x64\x61\x79",(0x18dd+2264-0x21ae))){tp_validity_period=
+(0x605+6972-0x209a);}if((0x12a1+64-0x12e1)==strncmp(Temp_sms_vp,
+"\x6f\x6e\x65\x77\x65\x65\x6b",(0x1724+2729-0x21c6))){tp_validity_period=
+(0x777+6585-0x2083);}if((0x579+2580-0xf8d)==strncmp(Temp_sms_vp,
+"\x74\x77\x65\x6c\x76\x65\x68",(0x1d09+1911-0x2479))){tp_validity_period=
+(0x181+8082-0x2084);}g_zUfiSms_CurSmsPara.tp_validity_period=tp_validity_period;
+if((0x66c+7869-0x2529)==strcmp(sendfailRetry,"\x31")){g_zUfiSms_CurSmsPara.
+sendfail_retry_on=(0x3c6+335-0x514);}else{g_zUfiSms_CurSmsPara.sendfail_retry_on
+=(0x871+1099-0xcbc);}if((0x1060+109-0x10cd)==strcmp(outdateDelete,"\x31")){
+g_zUfiSms_CurSmsPara.outdate_delete_on=(0x47c+2722-0xf1d);}else{
+g_zUfiSms_CurSmsPara.outdate_delete_on=(0x737+6363-0x2012);}if(
+(0x2bb+4231-0x1342)==strcmp(defaultStore,"\x73\x69\x6d")){strncpy(
+g_zUfiSms_CurSmsPara.default_store,"\x73\x69\x6d",sizeof(g_zUfiSms_CurSmsPara.
+default_store)-(0x38d+3933-0x12e9));}else{strncpy(g_zUfiSms_CurSmsPara.
+default_store,"\x6e\x76",sizeof(g_zUfiSms_CurSmsPara.default_store)-
+(0x5e8+6678-0x1ffd));}}void zUfiSms_GetDefaultPara(void){memset(&
+g_zUfiSms_CurSmsPara,(0x15e3+357-0x1748),sizeof(T_zUfiSms_ParaInfo));
+g_zUfiSms_CurSmsPara.status_report_on=(0x2a7+8614-0x244d);g_zUfiSms_CurSmsPara.
+mem_store=WMS_STORAGE_TYPE_NV_V01;g_zUfiSms_CurSmsPara.tp_validity_period=
+ZTE_WMS_SMS_DEFAULT_TP_VALIDITY_PERIOD_GW;g_zUfiSms_CurSmsPara.sendfail_retry_on
+=(0x7ea+2018-0xfcc);g_zUfiSms_CurSmsPara.outdate_delete_on=(0xd9f+364-0xf0b);
+strncpy(g_zUfiSms_CurSmsPara.default_store,"\x6e\x76",sizeof(
+g_zUfiSms_CurSmsPara.default_store)-(0x1c62+1280-0x2161));}
+#if (0x1903+2217-0x21ac)

+T_zUfiSms_CmdStatus zUfiSms_SetParameters(T_zUfiSms_CmdMsgBuff*ptSmsBuffer){
+T_zUfiSms_ParaInfo*ptSmsParameter=NULL;T_zUfiSms_ParaInfo tNewSmsParameter={
+(0x696+5609-0x1c7f)};if(NULL==ptSmsBuffer){return WMS_CMD_FAILED;}ptSmsParameter
+=(T_zUfiSms_ParaInfo*)(&(ptSmsBuffer->cmd_info.set_sms_para));memcpy((void*)&
+tNewSmsParameter,(void*)ptSmsParameter,sizeof(T_zUfiSms_ParaInfo));
+#ifndef TSP_MODEL

+if((g_zUfiSms_CurSmsPara.mem_store!=ptSmsParameter->mem_store)){if(
+ZUFI_SMS_FAILURE==zUfiSms_SetCpms(ptSmsParameter)){at_print(LOG_ERR,
+"\x73\x65\x74\x20\x63\x66\x67\x20\x72\x6f\x75\x74\x65\x73\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return WMS_CMD_FAILED;}}
+#endif

+if(strlen(ptSmsParameter->sca)!=(0x123f+2364-0x1b7b)){if(ZUFI_SMS_FAILURE==
+zUfiSms_SetCsca(ptSmsParameter)){return WMS_CMD_FAILED;}}if(ZUFI_SMS_FAILURE==
+zUfiSms_SetDbParameters(ptSmsParameter)){return WMS_CMD_FAILED;}else{sc_cfg_set(
+"\x73\x6d\x73\x5f\x63\x65\x6e\x74\x65\x72\x5f\x6e\x75\x6d",ptSmsParameter->sca);
+}memcpy((void*)&g_zUfiSms_CurSmsPara,(void*)&tNewSmsParameter,sizeof(
+T_zUfiSms_ParaInfo));return WMS_CMD_SUCCESS;}
+#endif

+int zUfiSms_LoadSmsPara(){int count=(0x509+8303-0x2578);if(ZUFI_SUCC!=
+zUfiSms_IsDbEmpty(ZTE_WMS_DB_PARAMETER_TABLE,&count)){return ZUFI_FAIL;}if(count
+==(0x206+767-0x505)){zUfiSms_GetDefaultCfgPara();if((0x2e7+5231-0x1756)!=
+zUfiSms_SetDbParameters(&g_zUfiSms_CurSmsPara)){return ZUFI_FAIL;}}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x68\x61\x76\x65\x20\x64\x65\x66\x61\x75\x6c\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x20\x69\x6e\x20\x64\x61\x74\x61\x62\x61\x73\x65\x2e" "\n"
+);if(ZUFI_SUCC!=zUfiSms_GetDbParameters()){return ZUFI_FAIL;}if(
+WMS_STORAGE_TYPE_NV_V01!=g_zUfiSms_CurSmsPara.mem_store&&
+WMS_STORAGE_TYPE_UIM_V01!=g_zUfiSms_CurSmsPara.mem_store){zUfiSms_GetDefaultPara
+();if((0x1ec+3612-0x1008)!=zUfiSms_SetDbParameters(&g_zUfiSms_CurSmsPara)){
+printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x66\x61\x69\x6c\x73\x20\x32\x2e" "\n"
+);return ZUFI_FAIL;}}}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4c\x6f\x61\x64\x53\x6d\x73\x50\x61\x72\x61\x20\x73\x75\x63\x63\x2e" "\n"
+);return ZUFI_SUCC;}int zUfiSms_CheckMemoryFull(T_zUfiSms_MemoryType mem_store){
+int total_count=(0x8f1+6933-0x2406);if((ZTE_WMS_MEMORY_SIM==mem_store)||(
+ZTE_WMS_MEMORY_MAX==mem_store)){if(ZUFI_FAIL==zUfiSms_GetTotalCount(
+ZTE_WMS_DB_SIM_TABLE,&total_count)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x67\x65\x74\x20\x74\x61\x62\x6c\x65\x20\x74\x6f\x74\x61\x6c\x20\x63\x6f\x75\x6e\x74\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x68\x65\x63\x6b\x4d\x65\x6d\x6f\x72\x79\x46\x75\x6c\x6c\x20\x67\x65\x74\x20\x73\x69\x6d\x20\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2e" "\n"
+,total_count);if(total_count>=(int)g_zUfiSms_StoreCapablity[
+WMS_STORAGE_TYPE_UIM_V01]){g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_UIM_V01]=TRUE;
+}else{g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_UIM_V01]=FALSE;}}if((
+ZTE_WMS_MEMORY_NV==mem_store)||(ZTE_WMS_MEMORY_MAX==mem_store)){if(ZUFI_FAIL==
+zUfiSms_GetTotalCount(ZTE_WMS_DB_NV_TABLE,&total_count)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x3a\x67\x65\x74\x20\x74\x61\x62\x6c\x65\x20\x74\x6f\x74\x61\x6c\x20\x63\x6f\x75\x6e\x74\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x68\x65\x63\x6b\x4d\x65\x6d\x6f\x72\x79\x46\x75\x6c\x6c\x20\x67\x65\x74\x20\x4d\x45\x20\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2e" "\n"
+,total_count);if(total_count>=(int)g_zUfiSms_StoreCapablity[
+WMS_STORAGE_TYPE_NV_V01]){g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]=TRUE;}
+else{g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]=FALSE;}}return ZUFI_SUCC;}
+int zUfiSms_SetStorePara(char*mem_store){if((0x495+3868-0x13b1)==strcmp(
+mem_store,"\x53\x4d")){g_zUfiSms_CurSmsPara.mem_store=(unsigned int)
+WMS_STORAGE_TYPE_UIM_V01;(void)sc_cfg_set(NV_SMS_LOCATION_SET,"\x30");}else if(
+(0x1810+1680-0x1ea0)==strcmp(mem_store,"\x4d\x45")){g_zUfiSms_CurSmsPara.
+mem_store=(unsigned int)WMS_STORAGE_TYPE_NV_V01;(void)sc_cfg_set(
+NV_SMS_LOCATION_SET,"\x31");}else if((0x434+2254-0xd02)==strcmp(mem_store,
+"\x53\x52")){g_zUfiSms_CurSmsPara.mem_store=(unsigned int)(0x180b+1106-0x1c5b);(
+void)sc_cfg_set(NV_SMS_LOCATION_SET,"\x32");}else{g_zUfiSms_CurSmsPara.mem_store
+=(unsigned int)WMS_STORAGE_TYPE_NONE_V01;(void)sc_cfg_set(NV_SMS_LOCATION_SET,
+"\x2d\x31");}if(ZUFI_FAIL==zUfiSms_SetDbParameters(&g_zUfiSms_CurSmsPara)){
+at_print(LOG_ERR,
+"\x63\x61\x6e\x20\x6e\x6f\x74\x20\x73\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x2e" "\n"
+);return ZUFI_FAIL;}return ZUFI_SUCC;}int zUfiSms_SetScaPara(char*sca){strncpy(
+g_zUfiSms_CurSmsPara.sca,sca,sizeof(g_zUfiSms_CurSmsPara.sca)-
+(0xa53+3152-0x16a2));if(ZUFI_FAIL==zUfiSms_SetDbParameters(&g_zUfiSms_CurSmsPara
+)){at_print(LOG_ERR,
+"\x63\x61\x6e\x20\x6e\x6f\x74\x20\x73\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x2e" "\n"
+);return ZUFI_FAIL;}return ZUFI_SUCC;}void zUfiSms_SetGlobalDcsLang(unsigned 
+char cDcs){if(cDcs==(0x3+2938-0xb7c)){g_zUfiSms_Dcs=DCS_ASC;g_zUfiSms_Language=
+NOT_DEFINE_LANGUAGE;}else if(cDcs==(0x8cf+7468-0x25f9)){g_zUfiSms_Dcs=DCS_USC;
+g_zUfiSms_Language=NOT_DEFINE_LANGUAGE;}else if(cDcs==(0x2d8+8657-0x24a6)){
+g_zUfiSms_Dcs=DCS_ASC;g_zUfiSms_Language=DCS_GSM7_SPANISH;}else if(cDcs==
+(0x1388+197-0x1448)){g_zUfiSms_Dcs=DCS_ASC;g_zUfiSms_Language=
+DCS_GSM7_PORTUGUESE;}else{g_zUfiSms_Dcs=DCS_ASC;g_zUfiSms_Language=
+DCS_GSM7_DEFAULT;}}int zUfiSms_FillGroupSms(T_zUfiSms_SendReq*ptSendMsg,
+T_zUfiSms_GroupInfo*ptGroupSms){int i;if(NULL==ptSendMsg||NULL==ptGroupSms||
+ZTE_WMS_SEND_NUM_MAX<ptSendMsg->receiver_count){return ZUFI_FAIL;}ptGroupSms->
+total_receiver=ptSendMsg->receiver_count;for(i=(0xbfd+928-0xf9d);i<ptGroupSms->
+total_receiver;i++){strncpy(ptGroupSms->receivers[i],ptSendMsg->dest_num[i],
+ZTE_WMS_ADDRESS_LEN_MAX);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x46\x69\x6c\x6c\x47\x72\x6f\x75\x70\x53\x6d\x73\x20\x72\x65\x63\x65\x69\x76\x65\x72\x73\x5b\x25\x64\x5d\x3d\x25\x73" "\n"
+,i,ptGroupSms->receivers[i]);}ptGroupSms->current_receiver=(0x43+1780-0x737);
+return ZUFI_SUCC;}int zUfiSms_FillConcatSms(T_zUfiSms_SendReq*pSendSrcMsg,
+T_zUfiSms_ConcatInfo*pDestConcatMsg){int iTotalLen=(0xf12+1020-0x130e);int 
+iUnitlen=(0x293+9207-0x268a);int iSegNo=(0x1b9f+969-0x1f68);unsigned char*
+pSmsConverted=NULL;unsigned char acConvertContent[
+ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX*ZTE_WMS_CONCAT_SMS_COUNT_MAX*
+(0x1612+1696-0x1cae)+(0x65+8665-0x223a)]={(0xa2+4202-0x110c)};unsigned char 
+acTmpContent[ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX*ZTE_WMS_CONCAT_SMS_COUNT_MAX*
+(0xcf7+2077-0x1510)+(0x3a2+6293-0x1c33)]={(0x171f+857-0x1a78)};int iTimeZone=
+(0x1b39+724-0x1e0d);int tmp_i=(0x778+4629-0x198d);if(NULL==pSendSrcMsg||NULL==
+pDestConcatMsg){return-(0x117f+4781-0x242b);}iTotalLen=pSendSrcMsg->msg_len;if(
+ZUFI_FAIL==zUfiSms_GetSmsContent(acTmpContent,sizeof(acTmpContent))){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x53\x6d\x73\x43\x6f\x6e\x74\x65\x6e\x74\x20\x46\x61\x69\x6c\x2e" "\n"
+);return-(0x9eb+1499-0xfc5);}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x53\x6d\x73\x43\x6f\x6e\x74\x65\x6e\x74\x3a\x25\x73\x2e" "\n"
+,acTmpContent);(void)String2Bytes(acTmpContent,acConvertContent,(int)strlen(
+acTmpContent));memset(acTmpContent,(0x2a8+835-0x5eb),sizeof(acTmpContent));if(
+DCS_USC==g_zUfiSms_Dcs){pSmsConverted=acConvertContent;}else{if(
+NOT_DEFINE_LANGUAGE==g_zUfiSms_Language){iTotalLen=
+zUfiSms_ConvertAsciiToGsmDefault(acConvertContent,acTmpContent,pSendSrcMsg->
+msg_len);}else if(DCS_GSM7_SPANISH==g_zUfiSms_Language){iTotalLen=
+zUfiSms_ConvertUcs2ToSpanish(acConvertContent,acTmpContent,pSendSrcMsg->msg_len)
+;}else if(DCS_GSM7_PORTUGUESE==g_zUfiSms_Language){iTotalLen=
+zUfiSms_ConvertUcs2ToPortuguese(acConvertContent,acTmpContent,pSendSrcMsg->
+msg_len);}else{iTotalLen=zUfiSms_ConvertUcs2ToGsmDefault(acConvertContent,
+acTmpContent,pSendSrcMsg->msg_len);}pSendSrcMsg->msg_len=iTotalLen;pSmsConverted
+=acTmpContent;}if(iTotalLen>(sizeof(acConvertContent)-(0x2b6+8739-0x24d8))){
+iTotalLen=sizeof(acConvertContent)-(0xf2a+647-0x11b0);}pDestConcatMsg->sms_len=
+iTotalLen;if((iTotalLen>ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX)||(g_zUfiSms_Language==
+DCS_PORTUGUESE&&iTotalLen>(0xbe8+5765-0x21d2))||((g_zUfiSms_Dcs==DCS_USC)&&
+iTotalLen>ZTE_WMS_SMS_MSG_CHAR_MAX)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x3d\x3d\x3d\x3d\x3d\x73\x65\x6e\x64\x20\x63\x6f\x6e\x74\x61\x63\x74\x20\x73\x6d\x73\x2e" "\n"
+);if(g_zUfiSms_Dcs==DCS_USC){iUnitlen=ZTE_WMS_SMS_CONCAT_ELEMNT_UCS_LEN*
+(0x1ff+5872-0x18ed);}else{if(g_zUfiSms_Language==NOT_DEFINE_LANGUAGE||
+g_zUfiSms_Language==DCS_GSM7_DEFAULT){iUnitlen=ZTE_WMS_SMS_CONCAT_ELEMNT_ASC_LEN
+;}else{iUnitlen=ZTE_WMS_SMS_CONCAT_ELEMNT_LANGUAGE_LEN;}}while(iTotalLen>
+(0x1ae6+2389-0x243b)&&iSegNo<ZTE_WMS_CONCAT_SMS_COUNT_MAX){memcpy(pDestConcatMsg
+->msg_contents[iSegNo],pSmsConverted,iUnitlen);iTotalLen-=iUnitlen;pSmsConverted
++=iUnitlen;iSegNo++;}pDestConcatMsg->total_msg=iSegNo;}else{iUnitlen=iTotalLen;
+pDestConcatMsg->total_msg=(0x446+7745-0x2286);memcpy(pDestConcatMsg->
+msg_contents[(0x1877+1845-0x1fac)],pSmsConverted,iTotalLen);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x3d\x3d\x3d\x3d\x3d\x73\x65\x6e\x64\x20\x6e\x6f\x72\x6d\x61\x6c\x20\x73\x6d\x73\x2e\x6c\x65\x6e\x3a\x25\x64\x2e\x63\x6f\x6e\x74\x65\x6e\x74\x3a\x25\x73\x2e" "\n"
+,iUnitlen,pDestConcatMsg->msg_contents[(0x1238+1816-0x1950)]);}
+g_zUfiSms_ConcatTotalNum=pDestConcatMsg->total_msg;pDestConcatMsg->
+current_sending=(0x18a5+3672-0x26fd);memcpy(&(pDestConcatMsg->date),&(
+pSendSrcMsg->date),sizeof(T_zUfiSms_Date));tmp_i=atoi(pDestConcatMsg->date.
+timezone);if(tmp_i<INT_MIN+(0x6d8+5810-0x1d89)||tmp_i>INT_MAX-
+(0x1935+426-0x1ade)){printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x70\x44\x65\x73\x74\x43\x6f\x6e\x63\x61\x74\x4d\x73\x67\x20\x74\x69\x6d\x65\x7a\x6f\x6e\x65\x3a\x25\x64\x2e" "\n"
+,tmp_i);return ZUFI_FAIL;}iTimeZone=tmp_i*(0xf73+1127-0x13d6);memset(
+pDestConcatMsg->date.timezone,(0x821+1718-0xed7),sizeof(pDestConcatMsg->date.
+timezone));if(iTimeZone>(0x95a+4216-0x19d2)){snprintf(pDestConcatMsg->date.
+timezone,sizeof(pDestConcatMsg->date.timezone),"\x2b\x25\x64",iTimeZone);}else{
+snprintf(pDestConcatMsg->date.timezone,sizeof(pDestConcatMsg->date.timezone),
+"\x25\x64",iTimeZone);}pSmsConverted=NULL;return iUnitlen;}void 
+zUfiSms_FillDateheader(T_zUfiSms_SubmitTpdu*ptSubmit,T_zUfiSms_ConcatInfo*
+ptConcatSms,T_zUfiSms_DbStoreData*ptDbSaveData){unsigned char iHeaderNum=
+(0xe98+1927-0x161f);iHeaderNum=ptSubmit->user_data.num_headers;ptSubmit->
+user_data_header_present=TRUE;if((0x2fa+4772-0x159e)==ptConcatSms->
+current_sending){g_zUfiSms_ConcatSmsReference++;(void)zUfiSms_SetConcatMaxRefer(
+g_zUfiSms_ConcatSmsReference);}ptSubmit->user_data.headers[iHeaderNum].header_id
+=WMS_UDH_CONCAT_8;ptSubmit->user_data.headers[iHeaderNum].u.concat_8.total_sm=
+ptConcatSms->total_msg;ptSubmit->user_data.headers[iHeaderNum].u.concat_8.
+seq_num=ptConcatSms->current_sending+(0xd25+1183-0x11c3);ptSubmit->user_data.
+headers[iHeaderNum].u.concat_8.msg_ref=g_zUfiSms_ConcatSmsReference%
+(0xba9+3165-0x1707);ptSubmit->user_data.num_headers++;ptDbSaveData->concat_sms=
+(0xbbd+5008-0x1f4c);ptDbSaveData->concat_info[(0x1331+1560-0x1949)]=
+g_zUfiSms_ConcatSmsReference;}int zUfiSms_MakeFinalCmgsBuf(){SMS_PARAM tSmsData;
+int iPduLength=(0xbbf+1639-0x1226);int nSmscLength=(0x1867+3565-0x2654);char 
+Tempstrr[(0x1a88+1527-0x207d)]={(0xfe9+3657-0x1e32)};char Temp_sms_vp[
+(0x926+4924-0x1c5a)]={(0x1e96+1802-0x25a0)};char tmpBuf1[(0x1ab7+1863-0x21fb)]={
+(0x1b9c+2078-0x23ba)};char tmpBuf2[(0x19a4+2671-0x240d)]={(0x456+4576-0x1636)};
+CHAR smsCenter[(0x623+8436-0x26e5)]={(0x1871+2186-0x20fb)};memset(&tSmsData,
+(0x438+4399-0x1567),sizeof(SMS_PARAM));memset(&g_zUfiSms_FinalCmgsBuf,
+(0x161b+1818-0x1d35),sizeof(T_zSms_SendSmsReq));if(CODE_GSM7==
+g_zUfiSms_SendingSms.TP_DCS){int i=(0x10e0+3475-0x1e73);for(;i<
+g_zUfiSms_SendingSms.TP_UDLength;i++){tSmsData.TP_UD[i]=g_zUfiSms_SendingSms.
+TP_UD[i];}tSmsData.TP_UDLength=g_zUfiSms_SendingSms.TP_UDLength;}else{snprintf(
+tSmsData.TP_UD,sizeof(tSmsData.TP_UD),"\x25\x73",g_zUfiSms_SendingSms.TP_UD);
+tSmsData.TP_UDLength=strlen(tSmsData.TP_UD);}sc_cfg_get(NV_SMS_CENTER_NUM,
+smsCenter,sizeof(smsCenter));snprintf(tSmsData.SCA,sizeof(tSmsData.SCA),
+"\x25\x73",smsCenter);snprintf(tSmsData.TPA,sizeof(tSmsData.TPA),"\x25\x73",
+g_zUfiSms_SendingSms.TPA);tSmsData.TP_DCS=g_zUfiSms_SendingSms.TP_DCS;sc_cfg_get
+(NV_REPORT_ENABLE,Tempstrr,sizeof(Tempstrr));if(((0xdd1+2444-0x175d)==strncmp(
+Tempstrr,"\x31",(0x16f4+2721-0x2194)))&&(g_zUfiSms_ConcatSms.current_sending==
+g_zUfiSms_ConcatSms.total_msg-(0x11e5+1031-0x15eb))){tSmsData.TP_SRR=
+(0x1238+597-0x148c);}else{tSmsData.TP_SRR=(0x2fd+6767-0x1d6c);}tSmsData.TP_UDHI=
+g_zUfiSms_SendingSms.TP_UDHI;tSmsData.TP_VP=(0xb41+4294-0x1b08);sc_cfg_get(
+NV_SMS_VP,Temp_sms_vp,sizeof(Temp_sms_vp));if((0x304+8858-0x259e)==strncmp(
+Temp_sms_vp,"\x6c\x6f\x6e\x67\x65\x73\x74",(0x1fd2+1519-0x25ba))){tSmsData.TP_VP
+=(0x1205+4361-0x220f);}else if((0x1e49+1888-0x25a9)==strncmp(Temp_sms_vp,
+"\x6f\x6e\x65\x5f\x64\x61\x79",(0x1b1+5187-0x15ed))){tSmsData.TP_VP=
+(0x191b+2426-0x21ee);}else if((0xb2b+6214-0x2371)==strncmp(Temp_sms_vp,
+"\x6f\x6e\x65\x77\x65\x65\x6b",(0x1532+1845-0x1c60))){tSmsData.TP_VP=
+(0xd8d+4747-0x1f6b);}else if((0x370+1356-0x8bc)==strncmp(Temp_sms_vp,
+"\x74\x77\x65\x6c\x76\x65\x68",(0x1b9b+991-0x1f73))){tSmsData.TP_VP=
+(0x9af+3209-0x15a9);}tSmsData.TP_PID=(0x174a+1574-0x1d70);
+#if (0x466+5982-0x1bc3)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x62\x65\x67\x69\x6e\x3a\x25\x73" "\n",
+g_zUfiSms_FinalCmgsBuf.pdu);
+#endif    
+iPduLength=EncodePdu_Submit(&tSmsData,g_zUfiSms_FinalCmgsBuf.pdu);
+#if (0x18ac+2157-0x2118)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4d\x61\x6b\x65\x46\x69\x6e\x61\x6c\x43\x6d\x67\x73\x42\x75\x66\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\x25\x73" "\n",
+g_zUfiSms_FinalCmgsBuf.pdu);
+#endif

+(void)String2Bytes(g_zUfiSms_FinalCmgsBuf.pdu,tmpBuf1,(0x158b+660-0x181d));
+Bytes2String(tmpBuf1,tmpBuf2,strlen(tmpBuf1));nSmscLength=atoi(tmpBuf2);if(
+nSmscLength<(0xaa1+331-0xbec)||nSmscLength>INT_MAX-(0x24+2803-0xb16)){at_print(
+LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x6e\x53\x6d\x73\x63\x4c\x65\x6e\x67\x74\x68\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,nSmscLength);nSmscLength=(0x1d7d+1265-0x226e);;}nSmscLength++;
+g_zUfiSms_FinalCmgsBuf.length=iPduLength/(0xcb+3018-0xc93)-nSmscLength;
+#if (0xcaf+5774-0x233c)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4d\x61\x6b\x65\x46\x69\x6e\x61\x6c\x43\x6d\x67\x73\x42\x75\x66\x20\x6d\x61\x6b\x65\x20\x65\x6e\x64\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\x25\x73" "\n"
+,g_zUfiSms_FinalCmgsBuf.length,g_zUfiSms_FinalCmgsBuf.pdu);
+#endif

+return ZUFI_SUCC;}int zUfiSms_FillSubmitTpdu(T_zUfiSms_ConcatInfo*ptConcatSms,
+T_zUfiSms_GroupInfo*ptGroupSms,int iSmsLen,T_zUfiSms_SubmitTpdu*ptSubmit,
+T_zUfiSms_DbStoreData*ptDbSaveData){if(NULL==ptSubmit||NULL==ptConcatSms||NULL==
+ptGroupSms||NULL==ptDbSaveData){return-(0x28f+8935-0x2575);}ptSubmit->
+reject_duplicates=FALSE;ptSubmit->reply_path_present=FALSE;ptSubmit->
+user_data_header_present=FALSE;ptSubmit->status_report_enabled=
+g_zUfiSms_CurSmsPara.status_report_on;if(((0x1559+2266-0x1e32)<ptConcatSms->
+total_msg)&&(ptConcatSms->current_sending+(0xa1d+5452-0x1f68)<ptConcatSms->
+total_msg)){ptSubmit->status_report_enabled=(0x1def+263-0x1ef6);}ptSubmit->
+message_reference=g_zUfiSms_MsgRefer;ptSubmit->pid=WMS_PID_DEFAULT;ptSubmit->dcs
+.msg_class=(wms_message_class_e_type)(0x44c+6782-0x1ec6);ptSubmit->dcs.
+is_compressed=(0x10b2+3609-0x1ecb);ptSubmit->dcs.alphabet=(g_zUfiSms_Dcs==
+DCS_ASC)?WMS_GW_ALPHABET_7_BIT_DEFAULT:WMS_GW_ALPHABET_UCS2;ptSubmit->validity.
+format=WMS_GW_VALIDITY_RELATIVE;zUfiSms_DecodeRelativeTime(g_zUfiSms_CurSmsPara.
+tp_validity_period,&ptSubmit->validity.u.time);ptSubmit->user_data.num_headers=
+(0x172f+3735-0x25c6);if(ptConcatSms->total_msg>(0x16f4+498-0x18e5)){
+zUfiSms_FillDateheader(ptSubmit,ptConcatSms,ptDbSaveData);ptDbSaveData->
+concat_info[(0x1506+379-0x167f)]=ptConcatSms->current_sending+
+(0x1d93+942-0x2140);ptDbSaveData->concat_info[(0x1ba0+2389-0x24f4)]=ptConcatSms
+->total_msg;}if(g_zUfiSms_Language==DCS_PORTUGUESE){UINT8 i=ptSubmit->user_data.
+num_headers;ptSubmit->user_data_header_present=TRUE;ptSubmit->user_data.headers[
+i].header_id=WMS_UDH_NAT_LANG_SS;ptSubmit->user_data.headers[ptSubmit->user_data
+.num_headers].u.nat_lang_ss.nat_lang_id=WMS_UDH_NAT_LANG_PORTUGUESE;ptSubmit->
+user_data.num_headers++;g_zUfiSms_IsLanguageShift=WMS_UDH_NAT_LANG_SS;}ptSubmit
+->user_data.sm_len=iSmsLen;memcpy(ptSubmit->user_data.sm_data,ptConcatSms->
+msg_contents[ptConcatSms->current_sending],iSmsLen);if(ptGroupSms->receivers[
+ptGroupSms->current_receiver][(0x107d+5003-0x2408)]==((char)(0x1c79+10-0x1c58)))
+{(void)zUfiSms_CharToInt(ptGroupSms->receivers[ptGroupSms->current_receiver]+
+(0xa25+4432-0x1b74),strlen(ptGroupSms->receivers[ptGroupSms->current_receiver])-
+(0x1cd6+2132-0x2529),ptSubmit->address.digits);ptSubmit->address.number_type=
+WMS_NUMBER_INTERNATIONAL;ptSubmit->address.number_of_digits=strlen(ptGroupSms->
+receivers[ptGroupSms->current_receiver])-(0x7e3+6178-0x2004);}else if(ptGroupSms
+->receivers[ptGroupSms->current_receiver][(0xeaa+3464-0x1c32)]==
+((char)(0xbfa+4928-0x1f0a))&&ptGroupSms->receivers[ptGroupSms->current_receiver]
+[(0x158+2372-0xa9b)]==((char)(0xd06+2174-0x1554))){(void)zUfiSms_CharToInt(
+ptGroupSms->receivers[ptGroupSms->current_receiver]+(0xac7+3792-0x1995),strlen(
+ptGroupSms->receivers[ptGroupSms->current_receiver])-(0x1132+955-0x14eb),
+ptSubmit->address.digits);ptSubmit->address.number_type=WMS_NUMBER_INTERNATIONAL
+;ptSubmit->address.number_of_digits=strlen(ptGroupSms->receivers[ptGroupSms->
+current_receiver])-(0xfd+3392-0xe3b);}else{(void)zUfiSms_CharToInt(ptGroupSms->
+receivers[ptGroupSms->current_receiver],strlen(ptGroupSms->receivers[ptGroupSms
+->current_receiver]),ptSubmit->address.digits);ptSubmit->address.number_type=
+WMS_NUMBER_UNKNOWN;ptSubmit->address.number_of_digits=strlen(ptGroupSms->
+receivers[ptGroupSms->current_receiver]);}ptSubmit->address.digit_mode=(
+wms_digit_mode_e_type)(0x20e2+793-0x23fb);ptSubmit->address.number_mode=(
+wms_number_mode_e_type)(0x427+3445-0x119c);ptSubmit->address.number_plan=
+WMS_NUMBER_PLAN_TELEPHONY;memset(&g_zUfiSms_SendingSms,(0xf74+393-0x10fd),sizeof
+(SMS_PARAM));snprintf(g_zUfiSms_SendingSms.TPA,sizeof(g_zUfiSms_SendingSms.TPA),
+"\x25\x73",ptGroupSms->receivers[ptGroupSms->current_receiver]);if(
+g_zUfiSms_Language!=NOT_DEFINE_LANGUAGE){g_zUfiSms_SendingSms.TP_DCS=CODE_GSM7;}
+else{if(g_zUfiSms_Dcs==DCS_USC){g_zUfiSms_SendingSms.TP_DCS=CODE_UCS2;}else{
+g_zUfiSms_SendingSms.TP_DCS=CODE_GSM8;}}if(g_zUfiSms_SendingSms.TP_DCS==
+CODE_GSM7){zUfiSms_FillGlobalTpudGsm7(ptSubmit,ptConcatSms,ptDbSaveData);}else{
+zUfiSms_FillGlobalTpudUcs2(ptSubmit,ptConcatSms,ptDbSaveData);}(void)
+zUfiSms_MakeFinalCmgsBuf();return ZUFI_SUCC;}void zUfiSms_FillSca(
+T_zUfiSms_ClientMsg*ptClientMsg){char sca[ZTE_WMS_SCA_LEN_MAX]={
+(0x1c5b+1573-0x2280)};int i=(0x1c49+1191-0x20f0);if(NULL==ptClientMsg){return;}
+memcpy((void*)sca,(void*)(g_zUfiSms_CurSmsPara.sca),sizeof(g_zUfiSms_CurSmsPara.
+sca));if(sca[(0x190f+152-0x19a7)]==((char)(0x1d13+834-0x202a))){ptClientMsg->u.
+gw_message.sc_address.number_type=WMS_NUMBER_INTERNATIONAL;}ptClientMsg->u.
+gw_message.sc_address.digit_mode=WMS_DIGIT_MODE_8_BIT;ptClientMsg->u.gw_message.
+sc_address.number_plan=WMS_NUMBER_PLAN_TELEPHONY;ptClientMsg->u.gw_message.
+sc_address.number_of_digits=strlen(sca);if(sca[(0x1448+4353-0x2549)]==
+((char)(0x30a+6635-0x1cca))){ptClientMsg->u.gw_message.sc_address.
+number_of_digits--;for(i=(0x3a1+7345-0x2052);i<ptClientMsg->u.gw_message.
+sc_address.number_of_digits;i++){sca[i]=sca[i+(0x891+7061-0x2425)];}}else if(sca
+[(0x87c+4486-0x1a02)]==((char)(0xcc0+4917-0x1fc5))&&sca[(0x9a4+2941-0x1520)]==
+((char)(0x96+6545-0x19f7))){ptClientMsg->u.gw_message.sc_address.
+number_of_digits-=(0x5bf+2285-0xeaa);for(i=(0x12d3+4814-0x25a1);i<ptClientMsg->u
+.gw_message.sc_address.number_of_digits;i++){sca[i]=sca[i+(0x197+4623-0x13a4)];}
+}(void)zUfiSms_CharToInt(sca,ptClientMsg->u.gw_message.sc_address.
+number_of_digits,ptClientMsg->u.gw_message.sc_address.digits);}void 
+zUfiSms_FillDbSaveData(T_zUfiSms_ClientMsg*ptClientMsg,T_zUfiSms_ClientTsData*
+ptClientData,T_zUfiSms_ConcatInfo*ptConcatSms,T_zUfiSms_GroupInfo*ptGroupSms,int
+ iSmsLen,T_zUfiSms_DbStoreData*ptDbSaveData){if(NULL==ptClientMsg||NULL==
+ptClientData||NULL==ptConcatSms||NULL==ptGroupSms||NULL==ptDbSaveData){at_print(
+LOG_ERR,"\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73" "\n");return;
+}ptDbSaveData->mem_store=ptClientMsg->msg_hdr.mem_store;ptDbSaveData->index=
+ptClientMsg->msg_hdr.index;ptDbSaveData->mode=ptClientMsg->msg_hdr.message_mode;
+ptDbSaveData->tag=ptClientMsg->msg_hdr.tag;memset(ptDbSaveData->number,
+(0xd4+9505-0x25f5),ZTE_WMS_ADDRESS_LEN_MAX+(0x6ec+2812-0x11e7));memcpy(
+ptDbSaveData->number,ptGroupSms->receivers[ptGroupSms->current_receiver],strlen(
+ptGroupSms->receivers[ptGroupSms->current_receiver]));ptDbSaveData->tp_dcs=
+DCS_USC;ptDbSaveData->tp_pid=ptClientData->u.gw_pp.u.submit.pid;ptDbSaveData->
+msg_ref=ptClientData->u.gw_pp.u.submit.message_reference;memset(ptDbSaveData->
+sms_content,(0x81+8715-0x228c),sizeof(ptDbSaveData->sms_content));if(
+g_zUfiSms_Dcs==DCS_USC){ptDbSaveData->alphabet=WMS_GW_ALPHABET_UCS2;}else if(
+g_zUfiSms_Dcs==DCS_ASC){ptDbSaveData->alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}(
+void)zUfiSms_DispatchWtoi(ptConcatSms->msg_contents[ptConcatSms->current_sending
+],iSmsLen,(UINT8*)ptDbSaveData->sms_content);memcpy(&(ptDbSaveData->julian_date)
+,&(ptConcatSms->date),sizeof(T_zUfiSms_Date));memcpy(&g_zUfiSms_DbStoreData[
+ptConcatSms->current_sending],ptDbSaveData,sizeof(zte_wms_db_sms_data_s_type));}
+void zUfiSms_SetPduData(T_zUfiSms_ClientMsg*ptClientMsg,T_zUfiSms_DbStoreData*
+ptDbSaveData){T_zUfiSms_ClientTsData tClientTsData;ptClientMsg->msg_hdr.
+mem_store=WMS_MEMORY_STORE_NV_GW;ptClientMsg->msg_hdr.tag=WMS_TAG_MO_NOT_SENT;
+ptClientMsg->msg_hdr.message_mode=WMS_MESSAGE_MODE_GW;ptClientMsg->u.gw_message.
+is_broadcast=FALSE;memset((void*)&tClientTsData,(0x6c2+2753-0x1183),sizeof(
+wms_client_ts_data_s_type));tClientTsData.format=WMS_FORMAT_GW_PP;tClientTsData.
+u.gw_pp.tpdu_type=WMS_TPDU_SUBMIT;(void)zUfiSms_FillSubmitTpdu(&
+g_zUfiSms_ConcatSms,&g_zUfiSms_GroupSms,g_zUfiSms_UnitLen,&tClientTsData.u.gw_pp
+.u.submit,ptDbSaveData);(void)wms_ts_encode(&tClientTsData,&ptClientMsg->u.
+gw_message.raw_ts_data);zUfiSms_FillSca(ptClientMsg);zUfiSms_FillDbSaveData(
+ptClientMsg,&tClientTsData,&g_zUfiSms_ConcatSms,&g_zUfiSms_GroupSms,
+g_zUfiSms_UnitLen,ptDbSaveData);}int zUfiSms_StoreNormalSmsToDb(
+T_zUfiSms_DbStoreData*ptDbSaveData,const char*pMemStore,long iSmsId){int result=
+ZUFI_SUCC;char*pContent=NULL;int iTotalCount=(0x15fb+1357-0x1b48);pContent=(char
+*)malloc((0x952+3356-0x166a)*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX);if(pContent
+==NULL){return ZUFI_FAIL;}memset(pContent,(0xb4b+6933-0x2660),(0x533+406-0x6c5)*
+ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX);if(WMS_GW_ALPHABET_7_BIT_DEFAULT==
+ptDbSaveData->alphabet){static char data[(0xa4b+4459-0x1bb2)*
+ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX+(0xc8d+5657-0x22a5)]={(0x1a8+3416-0xf00)};memset
+(data,(0xe2+7013-0x1c47),(0xcb2+4953-0x2007)*ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX+
+(0xc95+969-0x105d));(void)zUfiSms_DecodeContent((char*)ptDbSaveData->sms_content
+,strlen(ptDbSaveData->sms_content),FALSE,data);strncpy(pContent,data,
+(0x13ac+1492-0x197c)*ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX-(0x2d5+3103-0xef3));}
+else{strncpy(pContent,ptDbSaveData->sms_content,(0x17d9+3386-0x250f)*
+ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX-(0xcbb+3592-0x1ac2));}ptDbSaveData->tp_dcs
+=(unsigned char)(0x1122+2975-0x1cbf);if(-(0x529+4546-0x16ea)==iSmsId){if(
+ZUFI_FAIL==zUfiSms_GetTotalCount(pMemStore,&iTotalCount)){free(pContent);
+pContent=NULL;return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x74\x6f\x72\x65\x4e\x6f\x72\x6d\x61\x6c\x53\x6d\x73\x54\x6f\x44\x62\x20\x69\x54\x6f\x74\x61\x6c\x43\x6f\x75\x6e\x74\x3d\x25\x64" "\n"
+,iTotalCount);if(iTotalCount>=g_zUfiSms_StoreCapablity[(strcmp(pMemStore,
+"\x6e\x76")?ZTE_WMS_MEMORY_SIM:ZTE_WMS_MEMORY_NV)]){free(pContent);pContent=NULL
+;return-(0x722+5773-0x1dae);}if(ZUFI_FAIL==zUfiSms_InsertNormalSmsToDb(
+ptDbSaveData,pMemStore,pContent)){result=ZUFI_FAIL;}}else{if(ZUFI_FAIL==
+zUfiSms_UpdateNormalSmsToDb(ptDbSaveData,pMemStore,pContent,iSmsId)){result=
+ZUFI_FAIL;}}free(pContent);pContent=NULL;return result;}static int 
+zUfiSms_ConcatDataFree(T_zUfiSms_DbStoreData*ptDbSaveData,int count,char**
+out_result){int i=(0x994+2797-0x1481);for(i=(0x1c74+662-0x1f0a);i<count;i++){if(
+ptDbSaveData->concat_info[(0x1997+1096-0x1ddd)]==i+(0x3c3+968-0x78a)){free(
+out_result[i]);out_result[i]=NULL;break;}}return(0x1391+4256-0x2431);}int 
+zUfiSms_AddNewSmsToConcatData(T_zUfiSms_DbStoreData*ptDbSaveData,char*
+pOldContent,char*pFormatNewContent,char*pRealNewContent,T_zUfiSms_DbStoreStr*pac
+,int*pConcatTotalNum,int len){int count=(0x18c7+156-0x1963);char**out_result=
+NULL;char cSegChar=((char)(0xf0d+4348-0x1fce));int i=(0x46d+3464-0x11f5);int 
+iTotalSegNum=(0x1c48+1202-0x20fa);char acContentSeg[(0x5e2+6359-0x1eb7)*
+ZTE_WMS_SMS_MSG_CONTENT_STORE_LEN_MAX*ZTE_WMS_SMS_COUNT_MAX]={
+(0x2323+831-0x2662)};char*pCurConPos=acContentSeg;boolean isEsc=FALSE;if(NULL==
+pOldContent){return-(0x1940+1627-0x1f9a);}count=zUfiSms_SplitString(pOldContent,
+&out_result,cSegChar);for(i=(0x2ad+9231-0x26bc);i<count;i++){if(ptDbSaveData->
+concat_info[(0x13c8+1847-0x1afd)]==i+(0x10a+3773-0xfc6)){out_result[i]=(char*)
+malloc(sizeof(ptDbSaveData->sms_content));memset(out_result[i],
+(0x1508+1202-0x19ba),sizeof(ptDbSaveData->sms_content));if(
+WMS_GW_ALPHABET_7_BIT_DEFAULT==ptDbSaveData->alphabet){isEsc=
+zUfiSms_DecodeContent(ptDbSaveData->sms_content,strlen(ptDbSaveData->sms_content
+),isEsc,out_result[i]);}else{strncpy(out_result[i],ptDbSaveData->sms_content,
+sizeof(ptDbSaveData->sms_content)-(0x54+6592-0x1a13));}break;}}for(i=
+(0xc9a+54-0xcd0);i<count;i++){snprintf(acContentSeg+strlen(acContentSeg),sizeof(
+acContentSeg)-strlen(acContentSeg),"\x25\x73",out_result[i]);strcat(
+pFormatNewContent,out_result[i]);if(i!=count-(0x10fa+1754-0x17d3)){strcat(
+pFormatNewContent,"\x3b");}}strncpy(pRealNewContent,acContentSeg,len);
+zUfiSms_ConcatDataFree(ptDbSaveData,count,out_result);free(out_result);
+out_result=NULL;count=zUfiSms_SplitString(pac->IndStr,&out_result,cSegChar);for(
+i=(0xff1+3429-0x1d56);i<count;i++){if(ptDbSaveData->concat_info[
+(0xd50+1157-0x11d3)]==i+(0x1d8b+1317-0x22af)){out_result[i]=(char*)malloc(
+SHORT_INT_LEN);memset(out_result[i],(0x1612+2377-0x1f5b),SHORT_INT_LEN);snprintf
+(out_result[i],SHORT_INT_LEN,"\x25\x64",ptDbSaveData->index);break;}}for(i=
+(0xde2+306-0xf14);i<count;i++){snprintf(pac->FormatInd+strlen(pac->FormatInd),
+sizeof(pac->FormatInd)-strlen(pac->FormatInd),"\x25\x73",out_result[i]);if(i!=
+count-(0x3c2+8148-0x2395)){snprintf(pac->FormatInd+strlen(pac->FormatInd),sizeof
+(pac->FormatInd)-strlen(pac->FormatInd),"\x3b");}}zUfiSms_ConcatDataFree(
+ptDbSaveData,count,out_result);free(out_result);out_result=NULL;count=
+zUfiSms_SplitString(pac->Seg_Seq,&out_result,cSegChar);for(i=(0x977+1448-0xf1f);
+i<count;i++){if(ptDbSaveData->concat_info[(0x43f+6240-0x1c9d)]==i+
+(0x1c04+1719-0x22ba)){out_result[i]=(char*)malloc(SHORT_INT_LEN);memset(
+out_result[i],(0xb77+1609-0x11c0),SHORT_INT_LEN);snprintf(out_result[i],
+SHORT_INT_LEN,"\x25\x64",ptDbSaveData->concat_info[(0x5b6+7568-0x2344)]);break;}
+}for(i=(0xe68+6078-0x2626);i<count;i++){snprintf(pac->FormatSeq+strlen(pac->
+FormatSeq),sizeof(pac->FormatSeq)-strlen(pac->FormatSeq),"\x25\x73",out_result[i
+]);if(i!=count-(0x187+4210-0x11f8)){snprintf(pac->FormatSeq+strlen(pac->
+FormatSeq),sizeof(pac->FormatSeq)-strlen(pac->FormatSeq),"\x3b");}if(
+(0x19fb+3237-0x26a0)!=strcmp(out_result[i],"")){iTotalSegNum++;}}*
+pConcatTotalNum=iTotalSegNum;zUfiSms_ConcatDataFree(ptDbSaveData,count,
+out_result);free(out_result);out_result=NULL;return(0x685+4469-0x17fa);}int 
+zUfiSms_UpdateConcatSms(T_zUfiSms_DbStoreData*ptDbSaveData,const char*pStorePos,
+long iSmsId){T_zUfiSms_DbStoreStr ac={(0x957+127-0x9d6)};char*pOldContent=NULL;
+char*pFormatNewContent=NULL;char*pRealNewContent=NULL;int iTotalNum=
+(0x5c6+3733-0x145b);int result=ZUFI_SUCC;int spaceLen=(0xcc9+4404-0x1df9)*
+ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX*ZTE_WMS_CONCAT_SMS_COUNT_MAX+(0xb42+5122-0x1f40)
+;pOldContent=(char*)malloc(spaceLen);pFormatNewContent=(char*)malloc(spaceLen);
+pRealNewContent=(char*)malloc(spaceLen);if(pOldContent==NULL||pFormatNewContent
+==NULL||pRealNewContent==NULL){if(pOldContent)free(pOldContent);if(
+pFormatNewContent)free(pFormatNewContent);if(pRealNewContent)free(
+pRealNewContent);return ZUFI_FAIL;}memset(pRealNewContent,(0xe58+3472-0x1be8),
+spaceLen);memset(pOldContent,(0x15d5+71-0x161c),spaceLen);memset(
+pFormatNewContent,(0x5cd+485-0x7b2),spaceLen);(void)zUfiSms_GetConcatInfo(
+pStorePos,iSmsId,&ac,pOldContent,spaceLen);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x20\x2d\x30\x20\x49\x6e\x64\x53\x74\x72\x3a\x25\x73\x2c\x53\x65\x67\x5f\x53\x65\x71\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x49\x6e\x64\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x53\x65\x71\x3a\x25\x73" "\n"
+,ac.IndStr,ac.Seg_Seq,ac.FormatInd,ac.FormatSeq);if(-(0x7ad+4908-0x1ad8)==
+zUfiSms_AddNewSmsToConcatData(ptDbSaveData,pOldContent,pFormatNewContent,
+pRealNewContent,&ac,&iTotalNum,spaceLen)){result=ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x20\x30\x20\x49\x6e\x64\x53\x74\x72\x3a\x25\x73\x2c\x53\x65\x67\x5f\x53\x65\x71\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x49\x6e\x64\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x53\x65\x71\x3a\x25\x73" "\n"
+,ac.IndStr,ac.Seg_Seq,ac.FormatInd,ac.FormatSeq);ptDbSaveData->tp_dcs=
+(0x1b6+5651-0x17c7);if(ZUFI_FAIL==zUfiSms_UpdateConcatSmsToDb(ptDbSaveData,
+pStorePos,pFormatNewContent,pRealNewContent,&ac,iTotalNum,iSmsId)){result=
+ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x74\x65\x65\x74\x20\x31\x20\x49\x6e\x64\x53\x74\x72\x3a\x25\x73\x2c\x53\x65\x67\x5f\x53\x65\x71\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x49\x6e\x64\x3a\x25\x73\x2c\x46\x6f\x72\x6d\x61\x74\x53\x65\x71\x3a\x25\x73" "\n"
+,ac.IndStr,ac.Seg_Seq,ac.FormatInd,ac.FormatSeq);free(pRealNewContent);free(
+pOldContent);free(pFormatNewContent);pRealNewContent=NULL;pOldContent=NULL;
+pFormatNewContent=NULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x55\x70\x64\x61\x74\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x20\x73\x75\x63\x63\x65\x73\x73\x2e" "\n"
+);return result;}int zUfiSms_InsertConcatSms(T_zUfiSms_DbStoreData*ptDbSaveData,
+const char*pStorePos){T_zUfiSms_DbStoreStr ac={(0x18c2+2366-0x2200)};int 
+iSms_TotalCount=(0xb58+5987-0x22bb);int i=(0x16f4+826-0x1a2e);char acTmpContent[
+(0x1a1+5747-0x1714)];int iConcatNum=(0xc8+4018-0x107a);char*pFormatConcat=NULL;
+char*pContent=NULL;int spaceLen=(0x13cf+2302-0x1cc9)*
+ZTE_WMS_SMS_MSG_CONTENT_LEN_MAX*ZTE_WMS_CONCAT_SMS_COUNT_MAX+(0x271+6308-0x1b11)
+;if(NULL==ptDbSaveData||NULL==pStorePos){return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x65\x6e\x74\x65\x72\x20\x49\x6e\x73\x65\x72\x74\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x2e" "\n"
+);memset(acTmpContent,(0x5a5+384-0x725),sizeof(acTmpContent));iSms_TotalCount=
+ptDbSaveData->concat_info[(0xf6+1846-0x82b)];for(i=(0x893+2703-0x1321);i<
+iSms_TotalCount;i++){strcat(ac.IndStr,"\x3b");strcat(ac.Seg_Seq,"\x3b");strcat(
+acTmpContent,"\x3b");}pFormatConcat=(char*)malloc(spaceLen);if(NULL==
+pFormatConcat){return ZUFI_FAIL;}memset(pFormatConcat,(0x3f7+7884-0x22c3),
+spaceLen);pContent=(char*)malloc(spaceLen);if(pContent==NULL){free(pFormatConcat
+);return ZUFI_FAIL;}memset(pContent,(0xa55+3255-0x170c),spaceLen);if(-
+(0x210+6127-0x19fe)==zUfiSms_AddNewSmsToConcatData(ptDbSaveData,acTmpContent,
+pFormatConcat,pContent,&ac,&iConcatNum,spaceLen)){free(pFormatConcat);free(
+pContent);pFormatConcat=NULL;pContent=NULL;return ZUFI_FAIL;}ptDbSaveData->
+tp_dcs=(0x4d5+2165-0xd48);if(ZUFI_FAIL==zUfiSms_InsertConcatSmsToDb(ptDbSaveData
+,pStorePos,pFormatConcat,pContent,&ac,iConcatNum)){free(pFormatConcat);free(
+pContent);pFormatConcat=NULL;pContent=NULL;return ZUFI_FAIL;}free(pFormatConcat)
+;free(pContent);pFormatConcat=NULL;pContent=NULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x49\x6e\x73\x65\x72\x74\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x20\x73\x75\x63\x63\x65\x73\x73\x2e" "\n"
+);return ZUFI_SUCC;}int zUfiSms_StoreConcatSmsToDb(T_zUfiSms_DbStoreData*
+ptDbSaveData,char*pMemStore){long iSmsId=(0x7bb+1866-0xf05);int total_count=
+(0x657+7694-0x2465);if(NULL==ptDbSaveData||NULL==pMemStore){return ZUFI_FAIL;}
+iSmsId=zUfiSms_SearchConcatSmsInDb(ptDbSaveData,pMemStore);if(-
+(0x922+7283-0x2594)!=iSmsId){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x74\x6f\x72\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x20\x45\x6e\x74\x65\x72\x20\x55\x70\x64\x61\x74\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x20\x53\x6d\x73\x49\x64\x3a\x25\x64\x2e" "\n"
+,iSmsId);return zUfiSms_UpdateConcatSms(ptDbSaveData,pMemStore,iSmsId);}else{if(
+ZUFI_FAIL==zUfiSms_GetTotalCount(pMemStore,&total_count)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x74\x6f\x72\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x20\x47\x65\x74\x54\x6f\x74\x61\x6c\x43\x6f\x75\x6e\x74\x20\x46\x61\x69\x6c\x65\x64\x2e" "\n"
+);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x74\x6f\x72\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x20\x70\x4d\x65\x6d\x53\x74\x6f\x72\x65\x3d\x25\x73\x2c\x74\x6f\x74\x61\x6c\x5f\x63\x6f\x75\x6e\x74\x3d\x25\x64\x2e" "\n"
+,pMemStore,total_count);if(total_count>=g_zUfiSms_StoreCapablity[(strcmp(
+pMemStore,"\x6e\x76")?ZTE_WMS_MEMORY_SIM:ZTE_WMS_MEMORY_NV)]){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x74\x6f\x72\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x54\x6f\x44\x62\x20\x53\x6d\x73\x20\x6d\x65\x6d\x6f\x72\x79\x20\x69\x73\x20\x46\x75\x6c\x6c\x2e" "\n"
+);return ZUFI_FAIL;}return zUfiSms_InsertConcatSms(ptDbSaveData,pMemStore);}}int
+ zUfiSms_WriteSmsToDb(T_zUfiSms_DbStoreData*ptDbSaveData,zUfiSms_StoreType 
+iMemStore,long iSmsId){char acDbMemStore[(0x15f9+4025-0x25a8)];int iTotalCount=
+(0x39c+4556-0x1568);int id=(0x117c+2909-0x1cd9);UINT8 needCheckMemory=
+(0x5ea+8477-0x2706);if(NULL==ptDbSaveData){return ZUFI_FAIL;}memset(acDbMemStore
+,(0x1785+3189-0x23fa),sizeof(acDbMemStore));if(WMS_STORAGE_TYPE_UIM_V01==
+iMemStore){strncpy(acDbMemStore,ZTE_WMS_DB_SIM_TABLE,sizeof(acDbMemStore)-
+(0x16d1+2555-0x20cb));}else{strncpy(acDbMemStore,ZTE_WMS_DB_NV_TABLE,sizeof(
+acDbMemStore)-(0x1c9d+1103-0x20eb));}if((0x2fc+8231-0x2322)==ptDbSaveData->
+concat_sms){id=zUfiSms_SearchConcatSmsInDb(ptDbSaveData,&acDbMemStore);if(-
+(0x9b9+2925-0x1525)!=id){needCheckMemory=(0x382+950-0x738);}}if(needCheckMemory
+==(0xfa0+5824-0x265f)){if(ZUFI_FAIL==zUfiSms_GetTotalCount(acDbMemStore,&
+iTotalCount)){return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x53\x6d\x73\x54\x6f\x44\x62\x20\x69\x54\x6f\x74\x61\x6c\x43\x6f\x75\x6e\x74\x3d\x25\x64\x28\x6e\x65\x65\x64\x43\x68\x65\x63\x6b\x4d\x65\x6d\x6f\x72\x79\x3d\x3d\x31\x29" "\n"
+,iTotalCount);if(iTotalCount>=g_zUfiSms_StoreCapablity[(strcmp(acDbMemStore,
+"\x6e\x76")?ZTE_WMS_MEMORY_SIM:ZTE_WMS_MEMORY_NV)]){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x53\x6d\x73\x54\x6f\x44\x62\x20\x6d\x65\x6d\x6f\x72\x79\x20\x66\x75\x6c\x6c\x2c\x20\x65\x72\x72\x6f\x72" "\n"
+);return ZTE_WMS_NV_MEMORY_FULL;}}if(ptDbSaveData->concat_info[
+(0x1ea2+1217-0x2361)]==(0xfd3+2585-0x19ec)||ptDbSaveData->concat_info[
+(0x14ad+1517-0x1a98)]>ptDbSaveData->concat_info[(0x8b8+3693-0x1724)]){
+ptDbSaveData->concat_sms=(0xb61+3391-0x18a0);}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x53\x6d\x73\x54\x6f\x44\x62\x20\x54\x6f\x74\x61\x6c\x43\x6f\x75\x6e\x74\x3a\x25\x64\x2e\x63\x6f\x6e\x63\x61\x74\x5f\x73\x6d\x73\x3a\x25\x64\x2e\x63\x6f\x6e\x63\x61\x74\x5f\x69\x6e\x66\x6f\x5b\x31\x5d\x3a\x25\x64" "\n"
+,iTotalCount,ptDbSaveData->concat_sms,ptDbSaveData->concat_info[
+(0x133a+4931-0x267c)]);if((0x34d+8425-0x2435)==ptDbSaveData->concat_sms){if(
+ZTE_WMS_CONCAT_SMS_COUNT_MAX<ptDbSaveData->concat_info[(0x1c8c+629-0x1f00)]){
+return ZUFI_FAIL;}else{return zUfiSms_StoreConcatSmsToDb(ptDbSaveData,
+acDbMemStore);}}else{return zUfiSms_StoreNormalSmsToDb(ptDbSaveData,acDbMemStore
+,iSmsId);}}T_zUfiSms_CmdStatus zUfiSms_SendOutSms(T_zUfiSms_DbStoreData*
+ptDbSaveData,int cid){int atRes=(0x41d+2904-0xf75);if(NULL==ptDbSaveData){return
+ WMS_CMD_FAILED;}if(!g_zUfiSms_IsConcatSendSuc){ptDbSaveData->tag=
+WMS_TAG_TYPE_MO_NOT_SENT_V01;if(ZUFI_SUCC==zUfiSms_WriteSmsToDb(ptDbSaveData,
+WMS_STORAGE_TYPE_NV_V01,-(0xdd5+1020-0x11d0))){g_zUfiSms_MsgRefer++;ptDbSaveData
+->msg_ref=g_zUfiSms_MsgRefer;(void)zUfiSms_SetMaxReference(g_zUfiSms_MsgRefer);}
+}else{CHAR sendfailRetry[(0x9e5+7064-0x254b)]={(0x12b6+1323-0x17e1)};sc_cfg_get(
+NV_SENDFAIL_RETRY,sendfailRetry,sizeof(sendfailRetry));if((0x7fb+2841-0x1314)==
+strcmp("\x31",sendfailRetry)){g_zUfiSms_SendFailedRetry=(0x6c6+7716-0x24e7);}
+atRes=zSms_SendCmgsReq();if(atRes!=ZSMS_RESULT_OK){zSms_RecvCmgsErr();}else{
+zSms_RecvCmgsOk();}}return WMS_CMD_SUCCESS;}int zUfiSms_SendConcatSms(int cid){
+int atRes=(0x1c+5107-0x140f);T_zUfiSms_ClientMsg tClientMsg;
+T_zUfiSms_DbStoreData tDbSaveData;int result=ZUFI_FAIL;if(g_zUfiSms_ConcatSms.
+current_sending>=g_zUfiSms_ConcatSms.total_msg){return ZUFI_FAIL;}memset((void*)
+&tClientMsg,(0x106f+1551-0x167e),sizeof(T_zUfiSms_ClientMsg));memset((void*)&
+tDbSaveData,(0xf36+4598-0x212c),sizeof(tDbSaveData));zUfiSms_SetPduData(&
+tClientMsg,&tDbSaveData);if(!g_zUfiSms_IsConcatSendSuc){tDbSaveData.tag=
+WMS_TAG_TYPE_MO_NOT_SENT_V01;(void)zUfiSms_WriteSmsToDb(&tDbSaveData,
+WMS_STORAGE_TYPE_NV_V01,-(0xead+1230-0x137a));g_zUfiSms_SendFailedCount++;}else{
+CHAR sendfailRetry[(0x1427+2453-0x1d8a)]={(0xc1a+4608-0x1e1a)};sc_cfg_get(
+NV_SENDFAIL_RETRY,sendfailRetry,sizeof(sendfailRetry));if((0xbb8+1746-0x128a)==
+strcmp("\x31",sendfailRetry)){g_zUfiSms_SendFailedRetry=(0xf83+1596-0x15bc);}
+atRes=zSms_SendCmgsReq();if(atRes!=ZSMS_RESULT_OK){zSms_RecvCmgsErr();}else{
+zSms_RecvCmgsOk();}}g_zUfiSms_ConcatSms.current_sending++;if(g_zUfiSms_ConcatSms
+.current_sending<g_zUfiSms_ConcatSms.total_msg){if(g_zUfiSms_ConcatSms.sms_len<
+g_zUfiSms_UnitLen*(g_zUfiSms_ConcatSms.current_sending+(0x1e7d+1119-0x22db))){
+g_zUfiSms_UnitLen=g_zUfiSms_ConcatSms.sms_len-g_zUfiSms_UnitLen*
+g_zUfiSms_ConcatSms.current_sending;}}if(g_zUfiSms_ConcatSms.current_sending==
+g_zUfiSms_ConcatSms.total_msg&&!g_zUfiSms_IsConcatSendSuc){T_zUfiSms_StatusInfo 
+tSendStatus;memset((void*)&tSendStatus,(0x25d+236-0x349),sizeof(
+T_zUfiSms_StatusInfo));tSendStatus.err_code=ZTE_SMS_CMS_NONE;tSendStatus.
+send_failed_count=g_zUfiSms_SendFailedCount;tSendStatus.delete_failed_count=
+(0x1159+3525-0x1f1e);tSendStatus.cmd_status=WMS_CMD_FAILED;tSendStatus.cmd=
+WMS_SMS_CMD_MSG_SEND;(void)zUfiSms_SetCmdStatus(&tSendStatus);sc_cfg_set(
+NV_SMS_SEND_RESULT,"\x66\x61\x69\x6c");sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");
+return ZUFI_FAIL;}if(!g_zUfiSms_IsConcatSendSuc){zUfiSms_SendConcatSms(cid);}
+return result;}int zSvr_sendCmgs(VOID){int atRes=(0xe3f+502-0x1035);int i=
+(0x4c1+3424-0x1221);atRes=zSms_SendCmgsReq();if(atRes!=ZSMS_RESULT_OK){CHAR 
+sendfailRetry[(0x125b+614-0x148f)]={(0x105c+2225-0x190d)};sc_cfg_get(
+NV_SENDFAIL_RETRY,sendfailRetry,sizeof(sendfailRetry));if((0x108b+80-0x10db)==
+strcmp("\x31",sendfailRetry)){for(i=(0x410+4613-0x1615);i<SMS_RETRY_COUNT;i++){
+atRes=zSms_SendCmgsReq();if(atRes==ZSMS_RESULT_OK){break;}}}}return atRes;}
+T_zUfiSms_CmdStatus zUfiSms_SendSms(VOID){T_zUfiSms_ClientMsg tClientMsg;
+T_zUfiSms_DbStoreData tDbSaveData;int res=(0xce9+6611-0x26bc);if(-
+(0x19a5+2116-0x21e8)==g_zUfiSms_UnitLen){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x3a\x20\x4e\x6f\x20\x63\x6f\x6e\x74\x65\x6e\x74\x21\x2e" "\n"
+);return WMS_CMD_FAILED;}while(g_zUfiSms_ConcatSms.current_sending<
+g_zUfiSms_ConcatSms.total_msg){memset((void*)&tClientMsg,(0x1068+5469-0x25c5),
+sizeof(T_zUfiSms_ClientMsg));memset((void*)&tDbSaveData,(0x867+3581-0x1664),
+sizeof(tDbSaveData));zUfiSms_SetPduData(&tClientMsg,&tDbSaveData);if(!
+g_zUfiSms_IsConcatSendSuc){tDbSaveData.tag=WMS_TAG_TYPE_MO_NOT_SENT_V01;(void)
+zUfiSms_WriteSmsToDb(&tDbSaveData,WMS_STORAGE_TYPE_NV_V01,-(0xcb+1337-0x603));
+g_zUfiSms_SendFailedCount++;}else{res=zSvr_sendCmgs();if(res!=ZSMS_RESULT_OK){
+zSms_RecvCmgsErr();}else{zSms_RecvCmgsOk();}}g_zUfiSms_ConcatSms.current_sending
+++;if(g_zUfiSms_ConcatSms.current_sending<g_zUfiSms_ConcatSms.total_msg){if(
+g_zUfiSms_ConcatSms.sms_len<g_zUfiSms_UnitLen*(g_zUfiSms_ConcatSms.
+current_sending+(0x674+1263-0xb62))){g_zUfiSms_UnitLen=g_zUfiSms_ConcatSms.
+sms_len-g_zUfiSms_UnitLen*g_zUfiSms_ConcatSms.current_sending;}}if(
+g_zUfiSms_ConcatSms.current_sending==g_zUfiSms_ConcatSms.total_msg&&!
+g_zUfiSms_IsConcatSendSuc){T_zUfiSms_StatusInfo tSendStatus;memset((void*)&
+tSendStatus,(0x337+6752-0x1d97),sizeof(T_zUfiSms_StatusInfo));tSendStatus.
+err_code=ZTE_SMS_CMS_NONE;tSendStatus.send_failed_count=
+g_zUfiSms_SendFailedCount;tSendStatus.delete_failed_count=(0x138d+2128-0x1bdd);
+tSendStatus.cmd_status=WMS_CMD_FAILED;tSendStatus.cmd=WMS_SMS_CMD_MSG_SEND;(void
+)zUfiSms_SetCmdStatus(&tSendStatus);sc_cfg_set(NV_SMS_SEND_RESULT,
+"\x66\x61\x69\x6c");sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");}}
+#if (0xa79+4613-0x1c7e)	

+if(g_zUfiSms_ConcatSms.total_msg>(0x9b2+5601-0x1f92)){printf(
+"\x3d\x3d\x3d\x3d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x2e" "\n"
+);zUfiSms_SendConcatSms(cid);}else{memset((void*)&tClientMsg,
+(0x1379+3734-0x220f),sizeof(T_zUfiSms_ClientMsg));memset((void*)&tDbSaveData,
+(0x134a+1191-0x17f1),sizeof(tDbSaveData));zUfiSms_SetPduData(&tClientMsg,&
+tDbSaveData);printf(
+"\x3d\x3d\x3d\x3d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x6e\x6f\x72\x61\x6d\x6c\x53\x6d\x73\x2e" "\n"
+);if(WMS_CMD_FAILED==zUfiSms_SendOutSms(&tDbSaveData,cid)){printf(
+"\x21\x21\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x4f\x75\x74\x53\x6d\x73\x20\x46\x61\x69\x6c\x2e" "\n"
+);g_zUfiSms_SendFailedCount++;return WMS_CMD_FAILED;}}
+#endif

+return WMS_CMD_SUCCESS;}int zUfiSms_FormatDeliverTimestamp(T_zUfiSms_Date tData,
+T_zUfiSms_TimeStamp*ptTimestamp){unsigned char tTimeZone[(0x52a+7371-0x21f0)]={
+(0x17d4+1967-0x1f83)};int tmp_i=(0xe56+4197-0x1ebb);memset(ptTimestamp,
+(0xb7d+2081-0x139e),sizeof(T_zUfiSms_TimeStamp));if(strlen(tData.year)==
+(0x14f8+309-0x162c)){ptTimestamp->year=zUfiSms_atohex(((char)(0x4ea+640-0x73a)))
+*(0x44d+1833-0xb66)+zUfiSms_atohex(tData.year[(0xc83+3888-0x1bb3)]);}else if(
+strlen(tData.year)==(0x44f+2172-0xcc9)){ptTimestamp->year=zUfiSms_atohex(tData.
+year[(0x669+1227-0xb34)])*(0x1532+3884-0x244e)+zUfiSms_atohex(tData.year[
+(0x1617+3303-0x22fd)]);}else if(strlen(tData.year)==(0x92a+3976-0x18ae)){
+ptTimestamp->year=zUfiSms_atohex(tData.year[(0x808+4634-0x1a20)])*
+(0x218+7376-0x1ed8)+zUfiSms_atohex(tData.year[(0x1559+2181-0x1ddb)]);}else{
+printf("\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x79\x65\x61\x72\x2e");return ZUFI_FAIL;
+}if(strlen(tData.month)==(0x543+8193-0x2543)){ptTimestamp->month=zUfiSms_atohex(
+((char)(0x5a3+4926-0x18b1)))*(0x1d43+1475-0x22f6)+zUfiSms_atohex(tData.month[
+(0x3c7+1290-0x8d1)]);}else if(strlen(tData.month)==(0x107+7252-0x1d59)){
+ptTimestamp->month=zUfiSms_atohex(tData.month[(0x1a28+2412-0x2394)])*
+(0x1e7+2413-0xb44)+zUfiSms_atohex(tData.month[(0x14d4+4466-0x2645)]);}else{
+printf("\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x64\x61\x79\x2e");}if(strlen(tData.day)
+==(0x7ea+6993-0x233a)){ptTimestamp->day=zUfiSms_atohex(
+((char)(0x619+7926-0x24df)))*(0xfb8+2551-0x199f)+zUfiSms_atohex(tData.day[
+(0x1166+3416-0x1ebe)]);}else if(strlen(tData.day)==(0x1803+2906-0x235b)){
+ptTimestamp->day=zUfiSms_atohex(tData.day[(0x5d2+5877-0x1cc7)])*
+(0x62f+4569-0x17f8)+zUfiSms_atohex(tData.day[(0x1714+1354-0x1c5d)]);}else{printf
+("\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x64\x61\x79\x2e");}if(strlen(tData.hour)==
+(0x28a+7527-0x1ff0)){ptTimestamp->hour=zUfiSms_atohex(
+((char)(0x87b+4310-0x1921)))*(0x1c70+2419-0x25d3)+zUfiSms_atohex(tData.hour[
+(0x1755+3355-0x2470)]);}else if(strlen(tData.hour)==(0x1249+153-0x12e0)){
+ptTimestamp->hour=zUfiSms_atohex(tData.hour[(0x380+3702-0x11f6)])*
+(0x3c5+2914-0xf17)+zUfiSms_atohex(tData.hour[(0x157c+110-0x15e9)]);}else{printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x68\x6f\x75\x72\x2e");}if(strlen(tData.min)==
+(0x911+3148-0x155c)){ptTimestamp->minute=zUfiSms_atohex(
+((char)(0x2c3+1719-0x94a)))*(0x1027+2199-0x18ae)+zUfiSms_atohex(tData.min[
+(0x279+2108-0xab5)]);}else if(strlen(tData.min)==(0x14ba+2209-0x1d59)){
+ptTimestamp->minute=zUfiSms_atohex(tData.min[(0x3b+4002-0xfdd)])*
+(0x1b26+2759-0x25dd)+zUfiSms_atohex(tData.min[(0xc81+3229-0x191d)]);}else{printf
+("\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x6d\x69\x6e\x75\x74\x65\x2e");}if(strlen(
+tData.sec)==(0x29f+3295-0xf7d)){ptTimestamp->second=zUfiSms_atohex(
+((char)(0xe0+7237-0x1cf5)))*(0x1570+2786-0x2042)+zUfiSms_atohex(tData.sec[
+(0x19f+1968-0x94f)]);}else if(strlen(tData.sec)==(0xf15+189-0xfd0)){ptTimestamp
+->second=zUfiSms_atohex(tData.sec[(0x817+6616-0x21ef)])*(0x5f2+3419-0x133d)+
+zUfiSms_atohex(tData.sec[(0x630+419-0x7d2)]);}else{printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x73\x65\x63\x6f\x6e\x64\x2e");}tmp_i=atoi(
+tData.timezone);if(tmp_i<INT_MIN+(0xef1+3529-0x1cb9)||tmp_i>INT_MAX-
+(0x3a3+214-0x478)){printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x74\x44\x61\x74\x61\x20\x74\x69\x6d\x65\x7a\x6f\x6e\x65\x3a\x25\x64\x2e" "\n"
+,tmp_i);return ZUFI_FAIL;}memset(tTimeZone,(0x3c1+7800-0x2239),sizeof(tTimeZone)
+);snprintf(tTimeZone,sizeof(tTimeZone),"\x25\x64",tmp_i*(0x305+1517-0x8ee));if(
+tData.timezone[(0x27+1131-0x492)]==((char)(0x1d72+1538-0x2347))){if(strlen(
+tTimeZone)==(0x137d+2779-0x1e56)){ptTimestamp->timezone=zUfiSms_atohex(
+((char)(0x1485+4559-0x2624)))*(0x990+6137-0x2179)+zUfiSms_atohex(tTimeZone[
+(0x12f0+1063-0x1716)]);}else if(strlen(tTimeZone)==(0xc82+4209-0x1cf0)){
+ptTimestamp->timezone=zUfiSms_atohex(tTimeZone[(0x252+4596-0x1445)])*
+(0x80c+2723-0x12a5)+zUfiSms_atohex(tTimeZone[(0xba6+4588-0x1d90)]);}else{printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x2d\x74\x69\x6d\x65\x7a\x6f\x6e\x65\x2e");}
+ptTimestamp->timezone=(0x865+4557-0x1a32)-ptTimestamp->timezone;}else{if(strlen(
+tTimeZone)==(0x1728+1936-0x1eb7)){ptTimestamp->timezone=zUfiSms_atohex(
+((char)(0x11cd+5102-0x258b)))*(0x1d94+198-0x1e4a)+zUfiSms_atohex(tTimeZone[
+(0xdca+1746-0x149c)]);}else if(strlen(tTimeZone)==(0x317+5341-0x17f2)){
+ptTimestamp->timezone=zUfiSms_atohex(tTimeZone[(0x762+4929-0x1aa3)])*
+(0x44+2917-0xb9f)+zUfiSms_atohex(tTimeZone[(0x6b6+2819-0x11b8)]);}else{printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x2b\x74\x69\x6d\x65\x7a\x6f\x6e\x65\x2e");}}
+return ZUFI_SUCC;}void zUfiSms_FillDeliver(T_zUfiSms_DeliverPdu*deliver,
+T_zUfiSms_ConcatInfo*concat_sms,T_zUfiSms_DbStoreData*ptDbSaveData){static 
+UINT16 msg_ref=(0x643+33-0x664);deliver->user_data_header_present=TRUE;if(
+(0x15d6+3599-0x23e5)==concat_sms->current_sending){g_zUfiSms_ConcatSmsReference
+++;(void)zUfiSms_SetConcatMaxRefer(g_zUfiSms_ConcatSmsReference);}deliver->
+user_data_header_present=TRUE;deliver->user_data.num_headers=(0x190d+457-0x1ad5)
+;deliver->user_data.headers[(0x8b4+5618-0x1ea6)].header_id=WMS_UDH_CONCAT_8;
+deliver->user_data.headers[(0x1b70+2687-0x25ef)].u.concat_8.msg_ref=msg_ref;
+deliver->user_data.headers[(0xb37+4696-0x1d8f)].u.concat_8.total_sm=concat_sms->
+total_msg;deliver->user_data.headers[(0xcd7+4840-0x1fbf)].u.concat_8.seq_num=
+concat_sms->current_sending+(0x733+2250-0xffc);ptDbSaveData->concat_sms=
+(0x33+5541-0x15d7);ptDbSaveData->concat_info[(0x283+5516-0x180f)]=msg_ref;}void 
+zUfiSms_FillDeliverPdu(T_zUfiSms_DeliverPdu*ptDeliver,T_zUfiSms_ConcatInfo*
+concat_sms,T_zUfiSms_GroupInfo*group_sms,int iSmsLen,T_zUfiSms_DbStoreData*
+ptDbSaveData){if(NULL==concat_sms||NULL==group_sms){return;}ptDeliver->more=
+FALSE;ptDeliver->reply_path_present=FALSE;ptDeliver->status_report_enabled=
+g_zUfiSms_CurSmsPara.status_report_on;ptDeliver->pid=WMS_PID_DEFAULT;ptDeliver->
+dcs.msg_class=WMS_MESSAGE_CLASS_NONE;ptDeliver->dcs.is_compressed=FALSE;if(
+g_zUfiSms_Dcs==DCS_ASC){ptDeliver->dcs.alphabet=WMS_GW_ALPHABET_7_BIT_DEFAULT;}
+else{ptDeliver->dcs.alphabet=WMS_GW_ALPHABET_UCS2;}if(concat_sms->total_msg>
+(0x153b+3932-0x2496)){zUfiSms_FillDeliver(ptDeliver,concat_sms,ptDbSaveData);
+ptDbSaveData->concat_sms=(0x17b9+2794-0x22a2);ptDbSaveData->concat_info[
+(0x1ef+632-0x465)]=concat_sms->current_sending+(0x109+4908-0x1434);ptDbSaveData
+->concat_info[(0x14ef+3943-0x2455)]=concat_sms->total_msg;ptDbSaveData->
+concat_info[(0x9f2+565-0xc27)]=ptDeliver->user_data.headers[(0x92a+3982-0x18b8)]
+.u.concat_8.msg_ref;}else{ptDeliver->user_data_header_present=FALSE;ptDeliver->
+user_data.num_headers=(0x9e6+5832-0x20ae);}ptDeliver->user_data.sm_len=iSmsLen;
+memcpy(ptDeliver->user_data.sm_data,concat_sms->msg_contents[concat_sms->
+current_sending],iSmsLen);if(group_sms->receivers[group_sms->current_receiver][
+(0x112a+1611-0x1775)]==((char)(0x364+3697-0x11aa))){(void)zUfiSms_CharToInt(
+group_sms->receivers[group_sms->current_receiver]+(0xb00+7050-0x2689),strlen(
+group_sms->receivers[group_sms->current_receiver])-(0xd59+3186-0x19ca),ptDeliver
+->address.digits);ptDeliver->address.number_type=WMS_NUMBER_INTERNATIONAL;
+ptDeliver->address.number_of_digits=(UINT8)strlen(group_sms->receivers[group_sms
+->current_receiver])-(0xe95+1529-0x148d);}else{(void)zUfiSms_CharToInt(group_sms
+->receivers[group_sms->current_receiver],strlen(group_sms->receivers[group_sms->
+current_receiver]),ptDeliver->address.digits);ptDeliver->address.number_type=
+WMS_NUMBER_UNKNOWN;ptDeliver->address.number_of_digits=(UINT8)strlen(group_sms->
+receivers[group_sms->current_receiver]);}ptDeliver->address.digit_mode=
+WMS_DIGIT_MODE_4_BIT;ptDeliver->address.number_mode=
+WMS_NUMBER_MODE_NONE_DATA_NETWORK;ptDeliver->address.number_plan=
+WMS_NUMBER_PLAN_TELEPHONY;}T_zUfiSms_CmdStatus zUfiSms_SaveConcatSms(
+T_zUfiSms_SaveReq*ptSaveSms,T_zUfiSms_ConcatInfo*ptConcatSms,T_zUfiSms_GroupInfo
+*ptGroupSms,T_zUfiSms_DbStoreData*ptDbSaveData,int iSmsLen){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x61\x76\x65\x43\x6f\x6e\x63\x61\x74\x53\x6d\x73\x20\x6d\x65\x6d\x5f\x73\x74\x6f\x72\x65\x3d\x25\x64\x28\x4e\x56\x3d\x3d\x30\x31\x29" "\n"
+,ptSaveSms->mem_store);if(ptSaveSms->mem_store==WMS_STORAGE_TYPE_NV_V01){if(
+ZUFI_FAIL==zUfiSms_WriteSmsToDb(ptDbSaveData,WMS_STORAGE_TYPE_NV_V01,-
+(0x339+5000-0x16c0))){at_print(LOG_ERR,
+"\x77\x72\x69\x74\x65\x20\x73\x6d\x73\x20\x74\x6f\x20\x6e\x76\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return WMS_CMD_FAILED;}}else{return WMS_CMD_FAILED;}g_zUfiSms_MsgRefer++;
+ptDbSaveData->msg_ref=g_zUfiSms_MsgRefer;(void)zUfiSms_SetMaxReference(
+g_zUfiSms_MsgRefer);return WMS_CMD_SUCCESS;}T_zUfiSms_CmdStatus 
+zUfiSms_SaveNormalSms(T_zUfiSms_SaveReq*ptSaveSms,T_zUfiSms_DbStoreData*
+ptDbSaveData){g_zUfiSms_MsgRefer++;ptDbSaveData->msg_ref=g_zUfiSms_MsgRefer;if(
+ptSaveSms->mem_store==WMS_STORAGE_TYPE_NV_V01){if(ZUFI_SUCC==
+zUfiSms_WriteSmsToDb(ptDbSaveData,WMS_STORAGE_TYPE_NV_V01,ptSaveSms->id)){(void)
+zUfiSms_SetMaxReference(g_zUfiSms_MsgRefer);return WMS_CMD_SUCCESS;}else{printf(
+"\x77\x72\x69\x74\x65\x20\x73\x6d\x73\x20\x74\x6f\x20\x6e\x76\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return WMS_CMD_FAILED;}}return WMS_CMD_SUCCESS;}T_zUfiSms_CmdStatus 
+zUfiSms_SaveSmsToDb(T_zUfiSms_SaveReq*ptSaveSms,T_zUfiSms_ConcatInfo*ptConcatSms
+,T_zUfiSms_GroupInfo*ptGroupSms,int iSmsLength){T_zUfiSms_ClientTsData 
+tClientTsData;T_zUfiSms_ClientMsg tClientMsg;T_zUfiSms_DbStoreData tDbSaveData;
+T_zUfiSms_CmdStatus result=WMS_CMD_SUCCESS;int current_sending=
+(0x152f+3721-0x23b8);if(NULL==ptSaveSms||NULL==ptConcatSms||NULL==ptGroupSms||(-
+(0x11f+9179-0x24f9)==iSmsLength)){return WMS_CMD_FAILED;}for(ptConcatSms->
+current_sending=(0x114d+3410-0x1e9f);ptConcatSms->current_sending<ptConcatSms->
+total_msg;ptConcatSms->current_sending++){memset((void*)&tClientMsg,
+(0xb60+775-0xe67),sizeof(T_zUfiSms_ClientMsg));memset((void*)&tClientTsData,
+(0xe14+264-0xf1c),sizeof(T_zUfiSms_ClientTsData));memset((void*)&tDbSaveData,
+(0x19b9+1952-0x2159),sizeof(T_zUfiSms_DbStoreData));tClientMsg.msg_hdr.mem_store
+=(ptSaveSms->mem_store==WMS_STORAGE_TYPE_UIM_V01)?WMS_STORAGE_TYPE_UIM_V01:
+WMS_STORAGE_TYPE_NV_V01;tClientMsg.msg_hdr.tag=(T_zUfiSms_SmsTag)ptSaveSms->tags
+;tClientMsg.msg_hdr.message_mode=WMS_MESSAGE_MODE_GW;tClientMsg.u.gw_message.
+is_broadcast=FALSE;tClientTsData.format=WMS_FORMAT_GW_PP;switch(ptSaveSms->tags)
+{case WMS_TAG_TYPE_MO_SENT_V01:case WMS_TAG_TYPE_MO_NOT_SENT_V01:case
+(0xce8+4999-0x206b):{tClientTsData.u.gw_pp.tpdu_type=WMS_TPDU_SUBMIT;(void)
+zUfiSms_FillSubmitTpdu(ptConcatSms,ptGroupSms,iSmsLength,&tClientTsData.u.gw_pp.
+u.submit,&tDbSaveData);break;}case WMS_TAG_TYPE_MT_READ_V01:case 
+WMS_TAG_TYPE_MT_NOT_READ_V01:{tClientTsData.u.gw_pp.tpdu_type=WMS_TPDU_DELIVER;(
+void)zUfiSms_FormatDeliverTimestamp(ptSaveSms->date,&(tClientTsData.u.gw_pp.u.
+deliver.timestamp));zUfiSms_FillDeliverPdu(&tClientTsData.u.gw_pp.u.deliver,
+ptConcatSms,ptGroupSms,iSmsLength,&tDbSaveData);break;}default:{printf(
+"\x75\x6e\x6b\x6e\x6f\x77\x6e\x20\x74\x61\x67\x73\x2e");break;}}(void)
+wms_ts_encode(&tClientTsData,&tClientMsg.u.gw_message.raw_ts_data);
+zUfiSms_FillSca(&tClientMsg);zUfiSms_FillDbSaveData(&tClientMsg,&tClientTsData,
+ptConcatSms,ptGroupSms,iSmsLength,&tDbSaveData);strncpy(tDbSaveData.
+draft_group_id,ptSaveSms->draft_group_id,sizeof(tDbSaveData.draft_group_id)-
+(0xc50+1306-0x1169));if(TRUE==g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_NV]){result=
+WMS_CMD_FAILED;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x61\x76\x65\x53\x6d\x73\x54\x6f\x44\x62\x20\x4e\x56\x20\x6d\x65\x6d\x6f\x72\x79\x20\x69\x73\x20\x66\x75\x6c\x6c\x2c\x73\x61\x76\x65\x20\x65\x72\x72\x6f\x72" "\n"
+);}else{if(tDbSaveData.concat_sms==(0x2a5+5428-0x17d8)){result=
+zUfiSms_SaveConcatSms(ptSaveSms,ptConcatSms,ptGroupSms,&tDbSaveData,iSmsLength);
+current_sending=ptConcatSms->current_sending+(0x5f4+6198-0x1e29);if(ptConcatSms
+->sms_len<iSmsLength*(current_sending+(0xbdc+5238-0x2051))){iSmsLength=
+ptConcatSms->sms_len-iSmsLength*current_sending;}}else{result=
+zUfiSms_SaveNormalSms(ptSaveSms,&tDbSaveData);}}}return result;}int 
+zUfiSms_DeleteSmsInSim(){char str_index[(0x2035+426-0x215f)]={
+(0x31c+5579-0x18e7)};int index=(0x1419+4821-0x26ee);int is_cc=
+(0x1a79+2203-0x2314);int iSmsId=(0x37a+709-0x63f);T_zUfiSms_ModifyTag 
+tDeleteInfo={(0x5eb+4919-0x1922)};char StrValue[(0xcd6+6678-0x26e2)]={
+(0x107+44-0x133)};memset(&tDeleteInfo,(0x13d8+677-0x167d),sizeof(
+T_zUfiSms_ModifyTag));iSmsId=g_zUfiSms_DelMsg.sim_id[g_zUfiSms_DelMsg.sim_index]
+;if(-(0x207+5767-0x188d)==(is_cc=zUfiSms_IsConcatSms(iSmsId))){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x49\x6e\x53\x69\x6d\x20\x63\x68\x65\x63\x6b\x20\x63\x6f\x6e\x63\x61\x74\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x49\x6e\x53\x69\x6d\x20\x69\x73\x5f\x63\x63\x3a\x25\x64\x2c\x20\x69\x64\x3d\x25\x64" "\n"
+,is_cc,iSmsId);if((0x266+9256-0x268d)==is_cc){if(ZUFI_FAIL==zUfiSms_GetSmsIndex(
+iSmsId,&tDeleteInfo,is_cc)){return ZUFI_FAIL;}g_zUfiSms_DelMsg.sim_index++;
+g_zUfiSms_DelMsg.sim_index_count--;while(tDeleteInfo.num_of_indices>
+(0x35c+4166-0x13a2)){index=tDeleteInfo.indices[tDeleteInfo.id_index];
+g_deleteIndex.index[g_deleteIndex.total]=index;g_deleteIndex.total++;tDeleteInfo
+.id_index++;tDeleteInfo.num_of_indices--;}}else{memset(str_index,
+(0x1d2a+272-0x1e3a),sizeof(str_index));if(ZUFI_FAIL==zUfiSms_GetStorePosById(
+"\x69\x6e\x64",str_index,sizeof(str_index),iSmsId)){at_print(LOG_ERR,
+"\x67\x65\x74\x20\x69\x6e\x64\x65\x78\x20\x66\x72\x6f\x6d\x20\x64\x62\x20\x66\x61\x69\x6c\x64\x2e"
+);return ZUFI_FAIL;}index=atoi(str_index);g_deleteIndex.index[g_deleteIndex.
+total]=index;g_deleteIndex.total++;g_zUfiSms_DelMsg.sim_index++;g_zUfiSms_DelMsg
+.sim_index_count--;}(void)zUfiSms_DeleteSmsInDb();return ZUFI_SUCC;}
+T_zUfiSms_CmdStatus zUfiSms_DeleteSimSms(VOID){int atRes=(0x12e0+3404-0x202c);
+char StrValue[(0x1481+3306-0x2161)]={(0x23c1+523-0x25cc)};zUfiSms_SetSmsLocation
+(SMS_LOCATION_SIM);memset(&g_deleteIndex,(0x75f+763-0xa5a),sizeof(
+T_zUfiSms_DelIndexInfo));while(g_zUfiSms_DelMsg.sim_index_count>
+(0x12d5+4598-0x24cb)){if(ZUFI_FAIL==zUfiSms_DeleteSmsInSim()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x69\x6d\x53\x6d\x73\x20\x64\x65\x6c\x65\x74\x65\x20\x61\x6c\x6c\x3a\x25\x64\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64" "\n"
+,WMS_STORAGE_TYPE_UIM_V01);return WMS_CMD_FAILED;}}while(g_deleteIndex.cur_index
+<g_deleteIndex.total){atRes=zSms_SendCmgdReq(g_deleteIndex.index[g_deleteIndex.
+cur_index]);if(atRes==ZSMS_RESULT_OK){zSms_RecvCmgdOk();}else{zSms_RecvCmgdErr()
+;}g_deleteIndex.cur_index++;}zSms_RecvCmgdFinish();printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x69\x6d\x53\x6d\x73\x20\x73\x75\x63\x63\x65\x73\x73" "\n"
+);return WMS_CMD_SUCCESS;}void zUfiSms_GetReportStatus(char*pdu_tmp,int*stat){
+unsigned char tmp;unsigned char first_octet;if(pdu_tmp==NULL){return;}(void)
+String2Bytes(pdu_tmp,&tmp,(0x269+5940-0x199b));if(tmp==(0x1330+3629-0x215d)){
+pdu_tmp+=(0x30b+8806-0x256f);}else{tmp=(tmp+(0x1ac5+349-0x1c21))*
+(0x191b+26-0x1933);pdu_tmp+=tmp;}(void)String2Bytes(pdu_tmp,&tmp,
+(0x955+4770-0x1bf5));first_octet=tmp;if(first_octet&(0x178+2987-0xd21)){*stat=
+(0x348+5299-0x17f6);}}T_zUfiSms_TpduType zUfiSms_GetTpduType(UINT8*pData){
+T_zUfiSms_TpduType iTpduType;UINT8 mti=(0xae1+213-0xbb6);mti=(T_zUfiSms_TpduType
+)(pData[(0x1fc9+235-0x20b4)]&(0x2048+574-0x2283));switch(mti){case
+(0xadf+710-0xda5):iTpduType=WMS_TPDU_DELIVER;break;case(0x199+4560-0x1368):
+iTpduType=WMS_TPDU_SUBMIT;break;case(0x2022+1299-0x2533):iTpduType=
+WMS_TPDU_STATUS_REPORT;break;default:iTpduType=WMS_TPDU_MAX;break;}return 
+iTpduType;}static void zUfiSms_FormatDeliverNumber(wms_address_s_type tAddress,
+unsigned char*pNumber){UINT8 number_type=(0xf07+2906-0x1a61);memset(pNumber,
+(0x24fa+217-0x25d3),ZTE_WMS_ADDRESS_LEN_MAX+(0x49+408-0x1e0));if(tAddress.
+number_type==WMS_NUMBER_INTERNATIONAL){pNumber[(0x702+4605-0x18ff)]=
+((char)(0xce5+3472-0x1a4a));pNumber++;}if(tAddress.digit_mode!=
+WMS_DIGIT_MODE_8_BIT){(void)zUfiSms_SmsiAddrToStr(tAddress,(byte*)pNumber,&
+number_type);}else{memcpy(pNumber,tAddress.digits,tAddress.number_of_digits*
+sizeof(tAddress.digits[(0x1bdb+1316-0x20ff)]));}}byte*zUfiSms_UtilTimeStamp(
+T_zUfiSms_TimeStamp zte_wms_time,byte*res_ptr,T_zUfiSms_Date*date){UINT8 tmp;if(
+NULL==date){return NULL;}*res_ptr++=((char)(0x1222+4362-0x230a));tmp=
+zte_wms_time.year;res_ptr=zUfiSms_SmsiUtilitoaFill((tmp&(0x1088+5490-0x25eb))+((
+tmp>>(0x58a+5300-0x1a3a))*(0xc63+5214-0x20b7)),res_ptr);zUfiSms_SprintfTime(date
+->year,sizeof(date->year),zte_wms_time.year);*res_ptr++=
+((char)(0x1a0d+215-0x1ab5));tmp=zte_wms_time.month;res_ptr=
+zUfiSms_SmsiUtilitoaFill((tmp&(0x13fb+1301-0x1901))+((tmp>>(0x80a+4702-0x1a64))*
+(0x252d+175-0x25d2)),res_ptr);zUfiSms_SprintfTime(date->month,sizeof(date->month
+),zte_wms_time.month);*res_ptr++=((char)(0x145b+2108-0x1c68));tmp=zte_wms_time.
+day;res_ptr=zUfiSms_SmsiUtilitoaFill((tmp&(0x420+6778-0x1e8b))+((tmp>>
+(0x1cb+2991-0xd76))*(0x7c2+3918-0x1706)),res_ptr);zUfiSms_SprintfTime(date->day,
+sizeof(date->day),zte_wms_time.day);*res_ptr++=((char)(0x10ba+3786-0x1f58));tmp=
+zte_wms_time.hour;res_ptr=zUfiSms_SmsiUtilitoaFill((tmp&(0x185d+3401-0x2597))+((
+tmp>>(0x3af+2056-0xbb3))*(0x6a4+4767-0x1939)),res_ptr);zUfiSms_SprintfTime(date
+->hour,sizeof(date->hour),zte_wms_time.hour);*res_ptr++=
+((char)(0x1aa9+479-0x1c4e));tmp=zte_wms_time.minute;res_ptr=
+zUfiSms_SmsiUtilitoaFill((tmp&(0x1ab+4929-0x14dd))+((tmp>>(0xc2c+5074-0x1ffa))*
+(0x1abf+2686-0x2533)),res_ptr);zUfiSms_SprintfTime(date->min,sizeof(date->min),
+zte_wms_time.minute);*res_ptr++=((char)(0x6c1+1078-0xabd));tmp=zte_wms_time.
+second;res_ptr=zUfiSms_SmsiUtilitoaFill((tmp&(0xba3+2556-0x1590))+((tmp>>
+(0x99+3061-0xc8a))*(0x4f9+5092-0x18d3)),res_ptr);zUfiSms_SprintfTime(date->sec,
+sizeof(date->sec),zte_wms_time.second);if(zte_wms_time.timezone<
+(0x11f5+4233-0x227e)){*res_ptr++=((char)(0x16c4+932-0x1a3b));tmp=(UINT8)(
+zte_wms_time.timezone*(-(0x4ca+5653-0x1ade)));snprintf(date->timezone,sizeof(
+date->timezone),"\x2d\x25\x64",-(0x126f+3420-0x1fca)*zte_wms_time.timezone);}
+else{*res_ptr++=((char)(0x11cb+2385-0x1af1));tmp=(UINT8)zte_wms_time.timezone;
+snprintf(date->timezone,sizeof(date->timezone),"\x2b\x25\x64",zte_wms_time.
+timezone);}res_ptr=zUfiSms_SmsiUtilitoaFill(tmp,res_ptr);*res_ptr++=
+((char)(0xa3d+1073-0xe4c));return res_ptr;}T_zUfiSms_CmdStatus 
+zUfiSms_HandleReport(unsigned char*ptPduData){T_zUfiSms_RawTsData tRawTsData;
+T_zUfiSms_ClientTsData tClientTsData;int iReportStatus=(0x16c1+321-0x1802);
+unsigned char acDeliverNumber[ZTE_WMS_ADDRESS_LEN_MAX+(0x526+7328-0x21c5)];
+unsigned char tTpScts[ZTE_WMS_TP_SCTS_LEN_MAX+(0xde2+2810-0x18db)];
+T_zUfiSms_Date tSmsDate;char acRecFlag[(0x65b+6909-0x2153)]={(0x502+5973-0x1c57)
+};int iRpCount=(0x1227+1012-0x161b);char tmp[(0x1ea4+1645-0x2507)];int tmp_i=
+(0x1bb+6575-0x1b6a);unsigned int pos=(0xf+7433-0x1d18);if(NULL==ptPduData){
+return WMS_CMD_FAILED;}memset(acDeliverNumber,(0xdd+9732-0x26e1),sizeof(
+acDeliverNumber));memset(&tSmsDate,(0x4b5+7476-0x21e9),sizeof(T_zUfiSms_Date));
+memset(tTpScts,(0x4fd+3793-0x13ce),sizeof(tTpScts));memset(&tRawTsData,
+(0xb81+75-0xbcc),sizeof(T_zUfiSms_RawTsData));memset(&tClientTsData,
+(0x1670+186-0x172a),sizeof(T_zUfiSms_ClientTsData));snprintf(tmp,sizeof(tmp),
+"\x25\x58",ptPduData[(0x18b+9367-0x2622)]);tmp_i=atoi(tmp);if(tmp_i<
+(0x985+1892-0x10e9)||tmp_i>INT_MAX-(0x10dc+915-0x146e)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x70\x74\x50\x64\x75\x44\x61\x74\x61\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return WMS_CMD_FAILED;}pos=tmp_i+(0xb07+3974-0x1a8c);if(pos>=
+ZSMS_PDU_SIZE){return WMS_CMD_FAILED;}memcpy((void*)tRawTsData.data,(void*)(
+ptPduData+pos),sizeof(tRawTsData.data));tRawTsData.tpdu_type=zUfiSms_GetTpduType
+(ptPduData+pos);tRawTsData.format=WMS_FORMAT_GW_PP;(void)wms_ts_decode(&
+tRawTsData,&tClientTsData);if(WMS_TPDU_STATUS_REPORT!=tClientTsData.u.gw_pp.
+tpdu_type){at_print(LOG_ERR,
+"\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x67\x77\x2f\x77\x63\x64\x6d\x61\x20\x73\x6d\x73\x20\x72\x65\x70\x6f\x72\x74\x20\x73\x74\x61\x74\x75\x73\x2e"
+);return WMS_CMD_FAILED;}switch(tClientTsData.u.gw_pp.u.status_report.tp_status)
+{case WMS_TP_STATUS_RECEIVED_OK:case WMS_TP_STATUS_UNABLE_TO_CONFIRM_DELIVERY:
+case WMS_TP_STATUS_REPLACED:{iReportStatus=(0x72a+3551-0x1508);break;}case 
+WMS_TP_STATUS_TRYING_CONGESTION:case WMS_TP_STATUS_TRYING_SME_BUSY:case 
+WMS_TP_STATUS_TRYING_NO_RESPONSE_FROM_SME:case 
+WMS_TP_STATUS_TRYING_SERVICE_REJECTED:case 
+WMS_TP_STATUS_TRYING_QOS_NOT_AVAILABLE:case WMS_TP_STATUS_TRYING_SME_ERROR:{
+iReportStatus=(0xefa+5615-0x24e6);break;}default:{iReportStatus=
+(0x1ab6+1558-0x20ca);break;}}zUfiSms_FormatDeliverNumber(tClientTsData.u.gw_pp.u
+.status_report.address,acDeliverNumber);(void)zUfiSms_UtilTimeStamp(
+tClientTsData.u.gw_pp.u.status_report.timestamp,tTpScts,&tSmsDate);if(ZUFI_FAIL
+==zUfiSms_InsertReportStatusToDb(acDeliverNumber,&tSmsDate,iReportStatus)){
+at_print(LOG_ERR,
+"\x75\x70\x64\x61\x74\x65\x20\x73\x6d\x73\x20\x72\x65\x70\x6f\x72\x74\x20\x73\x74\x61\x74\x75\x73\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return WMS_CMD_FAILED;}memset(acRecFlag,(0x273+8432-0x2363),sizeof(acRecFlag))
+;sc_cfg_get(ZTE_WMS_NVCONFIG_SMS_REPORT,acRecFlag,sizeof(acRecFlag));iRpCount=
+atoi(acRecFlag);if(iRpCount<(0x1055+362-0x11bf)||iRpCount>INT_MAX-
+(0x284+8652-0x244f)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x69\x52\x70\x43\x6f\x75\x6e\x74\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,iRpCount);return WMS_CMD_FAILED;}memset(acRecFlag,(0xa96+3503-0x1845),sizeof(
+acRecFlag));snprintf(acRecFlag,sizeof(acRecFlag),"\x25\x64",iRpCount+
+(0xbe8+2774-0x16bd));sc_cfg_set(ZTE_WMS_NVCONFIG_SMS_REPORT,acRecFlag);return 
+WMS_CMD_SUCCESS;}void zUfiSms_DelModemSms(int in_index){
+#if (0xe6f+3647-0x1cae) 
+char StrValue[(0x2db+3448-0x1049)]={(0x762+4851-0x1a55)};printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x4d\x6f\x64\x65\x6d\x53\x6d\x73\x20\x66\x75\x6e\x20\x75\x73\x65\x64\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21\x21" "\n"
+);snat_print(LOG_DEBUGStrValue,sizeof(StrValue),"\x25\x64",in_index);
+zSvr_InnerSendMsg(ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,
+MSG_CMD_AT_DEL_SIM_SMS,strlen(StrValue),StrValue);
+#endif

+int atRes=(0x10c2+3159-0x1d19);atRes=zSms_SendCmgdReq(in_index);if(atRes==
+ZSMS_RESULT_OK){zSms_RecvCmgdOk();}else{zSms_RecvCmgdErr();}zSms_RecvCmgdFinish(
+);}VOID zUfiSms_getModifyInfo(T_zUfiSms_ModifyFlag*ptModifyBuff){int i=
+(0x1691+1045-0x1aa6);memset(&g_zUfiSms_modifyMsg,(0x476+8539-0x25d1),sizeof(
+T_zUfiSms_ModifySms));for(i=(0x1e7a+1898-0x25e4);i<ptModifyBuff->total_id;i++){
+g_zUfiSms_modifyMsg.sim_id[g_zUfiSms_modifyMsg.sim_count]=ptModifyBuff->id[i];
+g_zUfiSms_modifyMsg.sim_count++;g_zUfiSms_modifyMsg.sim_index_count++;}}int 
+zUfiSms_GetUnreadSmsIndexInSim(){char str_index[(0x8e7+1240-0xd3f)]={
+(0xbf6+76-0xc42)};int index=(0x18bf+171-0x196a);int is_cc=(0x1b8a+388-0x1d0e);
+int iSmsId=(0x111+2828-0xc1d);T_zUfiSms_ModifyTag tModifyInfo={
+(0xb9c+2209-0x143d)};char StrValue[(0x778+3689-0x15d7)]={(0x132+5724-0x178e)};
+memset(&tModifyInfo,(0xc94+1534-0x1292),sizeof(T_zUfiSms_ModifyTag));iSmsId=
+g_zUfiSms_modifyMsg.sim_id[g_zUfiSms_modifyMsg.sim_index];if(-
+(0x2037+223-0x2115)==(is_cc=zUfiSms_IsConcatSms(iSmsId))){at_print(LOG_ERR,
+"\x63\x68\x65\x63\x6b\x20\x63\x6f\x6e\x63\x61\x74\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return ZUFI_FAIL;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x55\x6e\x72\x65\x61\x64\x53\x6d\x73\x49\x6e\x64\x65\x78\x49\x6e\x53\x69\x6d\x20\x69\x73\x5f\x63\x63\x3a\x25\x64"
+,is_cc);if((0x5ca+2918-0x112f)==is_cc){if(ZUFI_FAIL==zUfiSms_GetSmsIndex(iSmsId,
+&tModifyInfo,is_cc)){return ZUFI_FAIL;}g_zUfiSms_modifyMsg.sim_index++;
+g_zUfiSms_modifyMsg.sim_index_count--;while(tModifyInfo.num_of_indices>
+(0x3c6+400-0x556)){index=tModifyInfo.indices[tModifyInfo.id_index];g_modifyIndex
+.index[g_modifyIndex.total]=index;g_modifyIndex.total++;tModifyInfo.id_index++;
+tModifyInfo.num_of_indices--;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x55\x6e\x72\x65\x61\x64\x53\x6d\x73\x49\x6e\x64\x65\x78\x49\x6e\x53\x69\x6d\x20\x5b\x31\x20\x3d\x3d\x20\x69\x73\x5f\x63\x63\x5d\x20\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64\x2c\x20\x74\x6f\x74\x61\x6c\x3d\x25\x64" "\n"
+,index,g_modifyIndex.total);}}else{memset(str_index,(0x85d+4334-0x194b),sizeof(
+str_index));if(ZUFI_FAIL==zUfiSms_GetStorePosById("\x69\x6e\x64",str_index,
+sizeof(str_index),iSmsId)){at_print(LOG_ERR,
+"\x67\x65\x74\x20\x69\x6e\x64\x65\x78\x20\x66\x72\x6f\x6d\x20\x64\x62\x20\x66\x61\x69\x6c\x64\x2e"
+);return ZUFI_FAIL;}index=atoi(str_index);g_modifyIndex.index[g_modifyIndex.
+total]=index;g_modifyIndex.total++;g_zUfiSms_modifyMsg.sim_index++;
+g_zUfiSms_modifyMsg.sim_index_count--;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x47\x65\x74\x55\x6e\x72\x65\x61\x64\x53\x6d\x73\x49\x6e\x64\x65\x78\x49\x6e\x53\x69\x6d\x20\x5b\x31\x20\x21\x3d\x20\x69\x73\x5f\x63\x63\x5d\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64\x2c\x20\x74\x6f\x74\x61\x6c\x3d\x25\x64" "\n"
+,index,g_modifyIndex.total);}return ZUFI_SUCC;}void zUfiSms_ModifyModemSms(
+T_zUfiSms_ModifyFlag*ptModifyBuff){int atRes=(0x462+5968-0x1bb2);char StrValue[
+(0xebc+2211-0x1755)]={(0x37b+991-0x75a)};printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4d\x6f\x64\x69\x66\x79\x4d\x6f\x64\x65\x6d\x53\x6d\x73\x20\x70\x74\x4d\x6f\x64\x69\x66\x79\x42\x75\x66\x66\x2d\x3e\x74\x79\x70\x65\x20\x3d\x20\x25\x64\x21" "\n"
+,ptModifyBuff->type);{zUfiSms_getModifyInfo(ptModifyBuff);memset(&g_modifyIndex,
+(0xcba+4081-0x1cab),sizeof(T_zUfiSms_ModifyIndexInfo));printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4d\x6f\x64\x69\x66\x79\x4d\x6f\x64\x65\x6d\x53\x6d\x73\x20\x70\x74\x4d\x6f\x64\x69\x66\x79\x42\x75\x66\x66\x2d\x3e\x74\x6f\x74\x61\x6c\x5f\x69\x64\x20\x3d\x20\x25\x64\x21" "\n"
+,ptModifyBuff->total_id);while(g_zUfiSms_modifyMsg.sim_index_count>
+(0x96b+2530-0x134d)){if(ZUFI_FAIL==zUfiSms_GetUnreadSmsIndexInSim()){at_print(
+LOG_ERR,
+"\x64\x65\x6c\x65\x74\x65\x20\x61\x6c\x6c\x3a\x25\x64\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64" "\n"
+,WMS_STORAGE_TYPE_UIM_V01);return;}}while(g_modifyIndex.cur_index<g_modifyIndex.
+total){snprintf(StrValue,sizeof(StrValue),"\x25\x64",g_modifyIndex.index[
+g_modifyIndex.cur_index]);atRes=zSms_SendCmgrReq(g_modifyIndex.index[
+g_modifyIndex.cur_index]);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x4d\x6f\x64\x69\x66\x79\x4d\x6f\x64\x65\x6d\x53\x6d\x73\x20\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x73\x20" "\n"
+,StrValue);g_modifyIndex.cur_index++;}}}static int zUfiSms_FormatGwDbData(
+T_zUfiSms_ClientTsData*ts_data_ptr,T_zUfiSms_DbStoreData*db_data){int result=
+ZUFI_SUCC;if((NULL==ts_data_ptr)||(NULL==db_data)){at_print(LOG_ERR,
+"\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74\x73\x2e");return ZUFI_FAIL
+;}if(WMS_FORMAT_GW_PP==ts_data_ptr->format){switch(ts_data_ptr->u.gw_pp.
+tpdu_type){case WMS_TPDU_DELIVER:{result=zUfiSms_FormatDeliverDbdata(ts_data_ptr
+,db_data);break;}case WMS_TPDU_SUBMIT:{result=zUfiSms_FormatSubmitDbdata(
+ts_data_ptr,db_data);break;}default:{break;}}}return result;}int 
+zUfiSms_DecodeSmsData(T_zUfiSms_DbStoreData*pDb_Data,int msg_index,
+zUfiSms_StoreType iStorePos,T_SmsStatus bSms_Status,wms_message_format_enum_v01 
+format,long iPdu_Len,unsigned char*pPdu_Received){T_zUfiSms_RawTsData raw_ts;
+T_zUfiSms_ClientTsData ts_data_ptr;char tmp[(0x12ff+2514-0x1cc7)];int tmp_i=
+(0x300+2111-0xb3f);unsigned int pos=(0xc1b+4401-0x1d4c);int result=ZUFI_SUCC;if(
+NULL==pDb_Data){return ZUFI_FAIL;}pDb_Data->mem_store=(unsigned long)iStorePos;
+pDb_Data->index=(unsigned short)msg_index;if(RECEIVED_UNREAD==bSms_Status){
+pDb_Data->tag=WMS_TAG_TYPE_MT_NOT_READ_V01;}else if(RECEIVED_READ==bSms_Status){
+pDb_Data->tag=WMS_TAG_TYPE_MT_READ_V01;}else if(STORED_UNSEND==bSms_Status){
+pDb_Data->tag=WMS_TAG_TYPE_MO_NOT_SENT_V01;}else{pDb_Data->tag=
+WMS_TAG_TYPE_MO_SENT_V01;}pDb_Data->mode=(unsigned short)format;memset(&raw_ts,
+(0xcb4+1651-0x1327),sizeof(T_zUfiSms_RawTsData));memset(&ts_data_ptr,
+(0x1ad6+1239-0x1fad),sizeof(wms_client_ts_data_s_type));memset(tmp,
+(0x1979+269-0x1a86),sizeof(tmp));snprintf(tmp,sizeof(tmp),"\x25\x64",
+pPdu_Received[(0xc9a+5425-0x21cb)]);tmp_i=atoi(tmp);if(tmp_i<(0x3a9+1773-0xa96)
+||tmp_i>INT_MAX-(0x57+9379-0x24f9)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x70\x50\x64\x75\x5f\x52\x65\x63\x65\x69\x76\x65\x64\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);return ZUFI_FAIL;}pos=tmp_i+(0x10e8+3542-0x1ebd);if(pos>=iPdu_Len){
+return ZUFI_FAIL;}raw_ts.len=iPdu_Len-pos;memcpy((void*)raw_ts.data,(void*)(
+pPdu_Received+pos),WMS_MAX_LEN);raw_ts.tpdu_type=zUfiSms_GetTpduType(
+pPdu_Received+pos);raw_ts.format=(WMS_MESSAGE_FORMAT_CDMA_V01==format)?
+WMS_FORMAT_CDMA:WMS_FORMAT_GW_PP;(void)wms_ts_decode(&raw_ts,&ts_data_ptr);
+switch(format){case WMS_MESSAGE_FORMAT_CDMA_V01:{result=ZUFI_SUCC;break;}case 
+WMS_MESSAGE_FORMAT_GW_PP_V01:{result=zUfiSms_FormatGwDbData(&ts_data_ptr,
+pDb_Data);break;}case WMS_MESSAGE_FORMAT_GW_BC_V01:case 
+WMS_MESSAGE_FORMAT_MWI_V01:{result=ZUFI_FAIL;break;}default:{result=ZUFI_FAIL;
+break;}}return result;}T_zUfiSms_CmdStatus IsSmsLoadSuccess(void){char IsInit[
+(0x14d3+206-0x157d)]={(0x4e0+3661-0x132d)};sc_cfg_get(NV_SMS_LOAD_RESULT,IsInit,
+sizeof(IsInit));if((0x16fb+3018-0x22c5)==strcmp("\x6f\x6b",IsInit)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x20\x4c\x6f\x61\x64\x20\x73\x75\x63\x63\x65\x73\x73\x21" "\n"
+);return WMS_CMD_SUCCESS;}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x6d\x73\x20\x4c\x6f\x61\x64\x20\x77\x72\x6f\x6e\x67\x20\x21" "\n"
+);return WMS_CMD_FAILED;}}
+#if (0x69a+254-0x798)

+int zUfiSms_FormatSms(CHAR*pSmsRawContent,int contentSize,T_zUfiSms_SmsItem*
+ptSmsPara,int iCmdId){char*P1=strchr(pSmsRawContent,((char)(0x9cb+5752-0x2017)))
+;if(NULL==P1){return ZUFI_FAIL;}char*P2=strchr((char*)(P1+(0x64+5378-0x1565)),
+((char)(0x1345+2488-0x1cd1)));if(NULL==P2){return ZUFI_FAIL;}char*P3=strchr((
+char*)(P2+(0x255+1696-0x8f4)),((char)(0x1f6+9303-0x2621)));atBase_PreProcRes(
+pSmsRawContent,contentSize);if((0xcd2+3764-0x1b85)==iCmdId){if(P3==P2+
+(0x2eb+7481-0x2023)){sscanf(pSmsRawContent,
+"\x25\x64\x20\x25\x64\x20\x25\x64\x20",&ptSmsPara->index,&ptSmsPara->stat,&
+ptSmsPara->length);}else{sscanf(pSmsRawContent,
+"\x25\x64\x20\x25\x64\x20\x25\x33\x32\x73\x20\x25\x64\x20",&ptSmsPara->index,&
+ptSmsPara->stat,ptSmsPara->alpha,&ptSmsPara->length);}}else if(
+(0xb29+6589-0x24e4)==iCmdId){if(P2==P1+(0xc3d+5642-0x2246)){sscanf(
+pSmsRawContent,"\x25\x64\x20\x25\x64\x20",&ptSmsPara->stat,&ptSmsPara->length);}
+else{sscanf(pSmsRawContent,"\x25\x64\x20\x25\x33\x32\x73\x20\x25\x64\x20",&
+ptSmsPara->stat,ptSmsPara->alpha,&ptSmsPara->length);}}atBase_RestoreString(
+ptSmsPara->alpha);atBase_RestoreString(ptSmsPara->pdu);return ZUFI_SUCC;}
+#endif

+void zUfiSms_CmglRespProc(T_zSms_SmsInd*pSmsItem){T_zUfiSms_CmdStatus result=
+WMS_CMD_PROCESSING;T_zUfiSms_DbStoreData db_data={(0x3fc+3047-0xfe3)};
+zUfiSms_StoreType mem_store=WMS_STORAGE_TYPE_UIM_V01;unsigned char pdu_tmp[
+ZSMS_PDU_SIZE]={(0xbf2+4430-0x1d40)};int total_count=(0x1411+2897-0x1f62);int 
+sim_capability=(0x5ed+7937-0x24ee);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x6c\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x21" "\n"
+,pSmsItem->index,pSmsItem->stat,pSmsItem->length);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x70\x64\x75\x20\x64\x61\x74\x61\x5f\x6c\x65\x6e\x3a\x25\x64\x2c\x20\x73\x74\x72\x3a\x25\x73\x21" "\n"
+,strlen(pSmsItem->pdu),pSmsItem->pdu);memset(&db_data,(0x3a1+8598-0x2537),sizeof
+(db_data));memset(pdu_tmp,(0x681+6211-0x1ec4),sizeof(pdu_tmp));(void)
+String2Bytes(pSmsItem->pdu,pdu_tmp,(int)strlen(pSmsItem->pdu));
+#if (0xbcb+3564-0x19b6)
+zUfiSms_GetReportStatus(pSmsItem->pdu,&pSmsItem->stat);if((0x5e6+4278-0x1697)==
+pSmsItem->stat){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x70\x53\x6d\x73\x49\x74\x65\x6d\x2d\x3e\x73\x74\x61\x74\x20\x3d\x3d\x20\x35" "\n"
+);(void)zUfiSms_HandleReport(pdu_tmp);zUfiSms_DelModemSms(pSmsItem->index);
+return;}
+#endif

+#if (0xbeb+4770-0x1e8c)
+printf("\x2a\x2a\x2a\x2a\x75\x6e\x64\x65\x63\x6f\x64\x65\x3a\x25\x73" "\n",
+pdu_tmp);
+#endif

+(void)zUfiSms_DecodeSmsData(&db_data,pSmsItem->index,mem_store,(T_SmsStatus)
+pSmsItem->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,pSmsItem->length,pdu_tmp);
+#if (0x6cf+2478-0x107c)
+printf("\x2a\x2a\x2a\x2a\x64\x65\x63\x6f\x64\x65\x65\x64\x3a\x25\x73" "\n",
+db_data.sms_content);
+#endif

+(void)zUfiSms_WriteSmsToDb(&db_data,mem_store,-(0x1541+597-0x1795));{}
+#if (0x1cf+6224-0x1a1e)
+if(SMS_LOCATION_SIM==g_zUfiSms_CurLocation){CHAR simCapability[
+(0x11ff+2334-0x1aeb)]={(0x1fca+1760-0x26aa)};sc_cfg_get(
+ZTE_WMS_NVCONFIG_SIM_CAPABILITY,simCapability,sizeof(simCapability));
+sim_capability=atoi(simCapability);(void)zUfiSms_GetTotalCount(
+ZTE_WMS_DB_SIM_TABLE,&total_count);if(total_count==sim_capability){
+zUfiSms_DelModemSms(pSmsItem->index);}}
+#endif

+}void zUfiSms_InitDb(void){if(ZUFI_FAIL==zUfiSms_CheckStoreDir()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x68\x65\x63\x6b\x73\x74\x6f\x72\x65\x44\x69\x72\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);return;}
+#ifdef WEBS_SECURITY

+if(access(ZTE_WMS_DB_PATH,F_OK)!=(0x12c4+2546-0x1cb6)){if((access(
+ZTE_WMS_TMP1_PATH,F_OK)==(0x752+73-0x79b))&&(access(ZTE_WMS_SEC_PATH,F_OK)!=
+(0x3cc+663-0x663))){if(rename(ZTE_WMS_TMP1_PATH,ZTE_WMS_SEC_PATH)!=
+(0xc3d+1785-0x1336)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x57\x4d\x53\x5f\x54\x4d\x50\x31\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);}}if((access(ZTE_WMS_TMP0_PATH,F_OK)==(0x15d6+2600-0x1ffe))&&(access(
+ZTE_WMS_SEC_PATH,F_OK)!=(0x1bb9+1817-0x22d2))){if(rename(ZTE_WMS_TMP0_PATH,
+ZTE_WMS_SEC_PATH)!=(0x239+1258-0x723)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x57\x4d\x53\x5f\x54\x4d\x50\x30\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c\x65\x64\x2e" "\n"
+);}}if(access(ZTE_WMS_SEC_PATH,F_OK)==(0x17e8+3681-0x2649)){char rnum_buf[
+(0x16f0+2391-0x202f)]={(0x1006+510-0x1204)};char cmd[(0x431+8361-0x245a)]={
+(0x3f8+990-0x7d6)};sc_cfg_get("\x72\x6e\x75\x6d\x5f\x61\x74",rnum_buf,sizeof(
+rnum_buf));snprintf(cmd,sizeof(cmd),
+"\x2f\x62\x69\x6e\x2f\x6f\x70\x65\x6e\x73\x73\x6c\x20\x65\x6e\x63\x20\x2d\x64\x20\x2d\x61\x65\x73\x32\x35\x36\x20\x2d\x73\x61\x6c\x74\x20\x2d\x69\x6e\x20\x25\x73\x20\x2d\x6f\x75\x74\x20\x25\x73\x20\x2d\x70\x61\x73\x73\x20\x70\x61\x73\x73\x3a\x25\x73"
+,ZTE_WMS_SEC_PATH,ZTE_WMS_DB_PATH,rnum_buf);zxic_system(cmd);}}
+#endif		

+if(ZUFI_FAIL==zUfiSms_CheckSmsDb()){zUfiSms_GetDefaultCfgPara();}if(ZUFI_SUCC!=
+zUfiSms_CreateAllTable()){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x72\x65\x61\x74\x65\x41\x6c\x6c\x54\x61\x62\x6c\x65\x20\x66\x61\x69\x6c\x65\x64" "\n"
+);return;}if(ZUFI_SUCC!=zUfiSms_LoadSmsPara()){zUfiSms_GetDefaultPara();}(void)
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_SendSmsStatusInfo(
+MSG_SMS_DEFAULT);g_zUfiSms_MsgRefer=zUfiSms_GetSmsMaxReferInDb();
+g_zUfiSms_ConcatSmsReference=zUfiSms_GetConcatMaxReferInDb();}void 
+zUfiSms_CfgSmsNvInit(void){char tmp[(0x432+4121-0x1441)]={(0x91d+5032-0x1cc5)};
+sc_cfg_set(NV_SMS_STORE,"");sc_cfg_set(NV_SMS_LOAD_RESULT,"");sc_cfg_set(
+ZTE_WMS_NVCONFIG_RECEVIED,"");sc_cfg_set(NV_SMS_CENTER_NUM,"");snprintf(tmp,
+sizeof(tmp),"\x25\x64",ZTE_WMS_DB_MSG_COUNT_MAX);sc_cfg_set(
+ZTE_WMS_NVCONFIG_NV_CAPABILITY,tmp);}VOID zUfiSms_InitCmdStatus(
+T_zUfiSms_StatusInfo*pStatusInfo,T_zUfiSms_CmdType iCmdId){memset((void*)
+pStatusInfo,(0x9a9+3749-0x184e),sizeof(T_zUfiSms_StatusInfo));pStatusInfo->cmd=
+iCmdId;pStatusInfo->cmd_status=WMS_CMD_PROCESSING;pStatusInfo->err_code=
+ZTE_SMS_CMS_NONE;pStatusInfo->send_failed_count=(0xc31+2285-0x151e);pStatusInfo
+->delete_failed_count=(0x91a+1306-0xe34);(void)zUfiSms_SetCmdStatus(pStatusInfo)
+;}void zUfiSms_CfgInit(void){char tmp[(0x1401+2391-0x1d4e)]={(0x723+6394-0x201d)
+};sc_cfg_set(NV_SMS_STATE,"");sc_cfg_set(ZTE_WMS_NVCONFIG_RECEVIED,"");
+sc_cfg_set(NV_SMS_LOAD_RESULT,"");sc_cfg_set(NV_SMS_RECV_RESULT,"");snprintf(tmp
+,sizeof(tmp),"\x25\x64",ZTE_WMS_DB_MSG_COUNT_MAX);sc_cfg_set(
+ZTE_WMS_NVCONFIG_NV_CAPABILITY,tmp);sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CAPABILITY,
+"");sc_cfg_set(ZTE_WMS_NVCONFIG_SMS_REPORT,"");sc_cfg_set(NV_SMS_DB_CHANGE,
+"\x31");sc_cfg_set(NV_SMS_CENTER_NUM,"");}int zUfiSms_IsUnreadSms(
+T_zUfiSms_MemoryType mem_store){int total_count=(0x391+3671-0x11e8);char buf[
+(0x8ca+4894-0x1bd4)]={(0x1872+159-0x1911)};if(ZUFI_FAIL==zUfiSms_GetTagCountInDb
+(mem_store,WMS_TAG_TYPE_MT_NOT_READ_V01,&total_count)){return FALSE;}sprintf(buf
+,"\x25\x64",total_count);sc_cfg_set(
+"\x73\x6d\x73\x5f\x75\x6e\x72\x65\x61\x64\x5f\x63\x6f\x75\x6e\x74",buf);if(
+(0x543+4755-0x17d6)==total_count){return FALSE;}else{return TRUE;}}VOID 
+zUfiSms_SendSmsStatusInfo(wms_message_status_info sms_op){
+T_zUfi_SmsStatusInfoInd ind={(0x922+5766-0x1fa8)};CHAR temp[(0x12d4+2443-0x1c2d)
+]={(0x4c8+3118-0x10f6)};if(sms_op==MSG_SMS_NEW){ind.sms_new_ind=
+(0x1369+2825-0x1e71);}if(sms_op==MSG_SMS_READING){ind.sms_is_reading=
+(0xb14+5546-0x20bd);}if(zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){ind.
+sms_unread_ind=(0x11f+4894-0x143c);}else{ind.sms_unread_ind=(0xa20+2822-0x1526);
+}sc_cfg_get("\x73\x6d\x73\x5f\x75\x6e\x72\x65\x61\x64\x5f\x63\x6f\x75\x6e\x74",
+temp,sizeof(temp));ind.sms_unread_count=atoi(temp);if((g_zUfiSms_MemFullFlag[
+WMS_STORAGE_TYPE_NV_V01]==TRUE)||(g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_UIM_V01
+]==TRUE)){ind.sms_memory_full_ind=(0x1408+1015-0x17fe);}else{ind.
+sms_memory_full_ind=(0x351+1790-0xa4f);}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x53\x74\x61\x74\x75\x73\x49\x6e\x66\x6f\x20\x75\x6e\x72\x65\x61\x64\x20\x3d\x20\x25\x64\x2c\x20\x66\x75\x6c\x6c\x3d\x25\x64\x2c\x20\x6e\x65\x77\x3d\x25\x64\x2c\x20\x72\x65\x61\x64\x69\x6e\x67\x3d\x25\x64" "\n"
+,ind.sms_unread_ind,ind.sms_memory_full_ind,ind.sms_new_ind,ind.sms_is_reading);
+ipc_send_message(MODULE_ID_SMS,MODULE_ID_MMI,MSG_CMD_SMS_STATUS_INFO_IND,sizeof(
+T_zUfi_SmsStatusInfoInd),&ind,(0x205d+940-0x2409));if(ind.sms_memory_full_ind==
+(0x7d0+3876-0x16f3)){sc_cfg_set(NV_SMS_INIT_STATUS,
+"\x73\x6d\x73\x5f\x6d\x65\x6d\x6f\x72\x79\x5f\x66\x75\x6c\x6c");}else if(ind.
+sms_unread_ind==(0x836+3292-0x1511)){sc_cfg_set(NV_SMS_INIT_STATUS,
+"\x73\x6d\x73\x5f\x75\x6e\x72\x65\x61\x64");}else{sc_cfg_set(NV_SMS_INIT_STATUS,
+"\x73\x6d\x73\x5f\x6e\x6f\x72\x6d\x61\x6c");}return;}VOID BakNotificationSms(
+char*pushSms,int pushSmsLen){FILE*fp=NULL;int len;fp=fopen(
+"\x2f\x75\x73\x72\x2f\x64\x6d\x2f\x66\x6f\x74\x61\x5f\x70\x75\x73\x68\x5f\x6d\x73\x67\x2e\x64\x61\x74\x61"
+,"\x77\x2b");if(fp==NULL){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x42\x61\x6b\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x53\x6d\x73\x20\x66\x6f\x70\x65\x6e\x20\x65\x72\x72\x6f\x72" "\n"
+);at_print(LOG_ERR,
+"\x66\x6f\x70\x65\x6e\x28\x20\x2f\x75\x73\x72\x2f\x64\x6d\x2f\x66\x6f\x74\x61\x5f\x70\x75\x73\x68\x5f\x6d\x73\x67\x2e\x64\x61\x74\x61\x20\x2c\x20\x27\x77\x2b\x27\x29\x20\x65\x72\x72\x6f\x72\x21"
+);return;}len=fwrite(pushSms,(0x4d2+4637-0x16ee),pushSmsLen,fp);if(len==
+pushSmsLen){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x42\x61\x6b\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x53\x6d\x73\x20\x77\x72\x69\x74\x65\x20\x74\x6f\x20\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x62\x61\x6b\x20\x66\x69\x6c\x65\x20\x4f\x4b\x2c\x20\x6c\x65\x6e\x3d\x25\x64\x20" "\n"
+,len);printf(
+"\x77\x72\x69\x74\x65\x20\x74\x6f\x20\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x62\x61\x6b\x20\x66\x69\x6c\x65\x20\x4f\x4b\x2c\x20\x6c\x65\x6e\x3d\x25\x64\x21"
+,len);fclose(fp);return;}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x42\x61\x6b\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x53\x6d\x73\x20\x77\x72\x69\x74\x65\x20\x74\x6f\x20\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x62\x61\x6b\x20\x66\x69\x6c\x65\x20\x66\x61\x69\x6c\x64\x2c\x20\x6c\x65\x6e\x3d\x25\x64\x20" "\n"
+,len);printf(
+"\x77\x72\x69\x74\x65\x20\x74\x6f\x20\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e\x62\x61\x6b\x20\x66\x69\x6c\x65\x20\x66\x61\x69\x6c\x64\x2c\x20\x6c\x65\x6e\x3d\x25\x64\x21"
+,len);fclose(fp);return;}}
diff --git a/ap/app/zte_comm/sms/src/sms_main.c b/ap/app/zte_comm/sms/src/sms_main.c
new file mode 100755
index 0000000..cc3588e
--- /dev/null
+++ b/ap/app/zte_comm/sms/src/sms_main.c
@@ -0,0 +1,394 @@
+
+#include <errno.h>

+#include <sys/msg.h>

+#include <semaphore.h>

+#include <limits.h>

+#include <pthread.h>

+#include "sms_code.h"

+typedef VOID(*pAtWeb_SmsMsgProc)(UINT8*pDatabuf);typedef struct{UINT32 msg_id;
+VOID(*func_ptr)(UINT8*pDatabuf);BOOL need_block;}T_zSmsHandleTable;VOID 
+atWeb_SendSms(UINT8*pDatabuf);VOID atWeb_DelSmsByIndex(UINT8*pDatabuf);VOID 
+atWeb_DelSmsByType(UINT8*pDatabuf);VOID atWeb_ReadSms(UINT8*pDatabuf);VOID 
+atWeb_SaveSms(UINT8*pDatabuf);VOID atWeb_SetSms(UINT8*pDatabuf);VOID 
+atWeb_OutdateSmsCheck(UINT8*pDatabuf);int zSms_SendZmgrReq(int index);extern 
+UINT8 g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_MAX];extern T_zSms_SendSmsReq 
+g_zUfiSms_FinalCmgsBuf;extern int g_zUfiSms_CurConcatSegNo;extern 
+T_zUfiSms_DbStoreData g_zUfiSms_DbStoreData[ZTE_WMS_CONCAT_SMS_COUNT_MAX];extern
+ int g_zUfiSms_SendFailedCount;extern int g_zUfiSms_ConcatTotalNum;extern UINT8 
+g_zUfiSms_IsConcatSendSuc;int iSmsIndex=(0x491+3896-0x13c9);int g_zSms_MsqId=-
+(0x24+7436-0x1d2f);int g_zSms_LocalMsqId=-(0x222+3114-0xe4b);sem_t g_sms_sem_id;
+T_zSms_optRsp g_smsOptRsp={(0xaf9+2542-0x14e7)};static const T_zSmsHandleTable 
+SmsHandleWebTab[]={{MSG_CMD_SEND_SMS,atWeb_SendSms,TRUE},{
+MSG_CMD_DEL_SMS_BY_INDEX,atWeb_DelSmsByIndex,TRUE},{MSG_CMD_SMS_MODIFY_TAG,
+atWeb_ReadSms,TRUE},{MSG_CMD_DRAFTS_SAVE,atWeb_SaveSms,FALSE},{
+MSG_CMD_SMS_LOCATION_SET,atWeb_SetSms,TRUE},{MSG_CMD_SMS_OUTDATE_CHECK,
+atWeb_OutdateSmsCheck,TRUE},{(0xc1c+3312-0x190c),NULL,FALSE}};VOID atWeb_SendSms
+(UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;T_zUfiSms_StatusInfo tStatus={
+(0x38c+4353-0x148d)};assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)
+pDatabuf;zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_SEND);(void)
+zUfiSms_SendRawSms((T_zUfiSms_SendReq*)ptMessage->msg_data);}VOID 
+atWeb_DelSmsByIndex(UINT8*pDatabuf){T_zUfiSms_DelReq tDelReq={
+(0x1467+3798-0x233d)};T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING;
+T_zUfiSms_StatusInfo tStatus={(0x5d2+3619-0x13f5)};assert(pDatabuf!=NULL);printf
+("[SMS] atWeb_DelSmsByIndex recv msg\n");memcpy(&tDelReq,pDatabuf,sizeof(
+T_zUfiSms_DelReq));zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_DELETE);result
+=zUfiSms_DeleteSms(&tDelReq);tStatus.cmd_status=result;(void)
+zUfiSms_SetCmdStatus(&tStatus);zUfiMmi_SendSmsStatus();}VOID atWeb_DelSmsByType(
+UINT8*pDatabuf){
+#if (0x344+368-0x4b4)

+WEB_DEL_SMS_BY_TYPE*req=NULL;req=(WEB_DEL_SMS_BY_TYPE*)pDatabuf;assert(req!=NULL
+);if(req->eLocation!=ZSMS_LOCATION_SIM){ZTE_LOG(LOG_ERR,
+"\x7a\x53\x6d\x73\x5f\x50\x72\x65\x70\x44\x65\x6c\x42\x79\x54\x79\x70\x65\x20\x70\x61\x72\x61\x20\x4e\x55\x4c\x4c\x2e" "\n"
+);return;}zSms_ChangeMainState(ZSMS_STATE_DELING);ZTE_LOG(LOG_DEBUG,
+"\x7a\x53\x6d\x73\x5f\x50\x72\x65\x70\x44\x65\x6c\x42\x79\x54\x79\x70\x65\x20\x70\x73\x74\x52\x65\x71\x2d\x3e\x65\x42\x6f\x78\x4e\x61\x6d\x65\x3d\x25\x64" "\n"
+,req->eBoxName);SMS_DeleteRecordFromXML(SMS_LOCATION_SIM,(0x1a7+5576-0x176f),req
+->eBoxName);if(req->eBoxName==SMS_INBOX){sms_LoadSmsFromSim();}
+#endif

+}VOID atWeb_ReadSms(UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;
+T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={
+(0x20b+4601-0x1404)};assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)
+pDatabuf;zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_MSG_MODIFY_TAG);result=
+zUfiSms_ModifySmsTag((T_zUfiSms_ModifyFlag*)ptMessage->msg_data);tStatus.
+cmd_status=result;(void)zUfiSms_SetCmdStatus(&tStatus);}VOID atWeb_SaveSms(UINT8
+*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;T_zUfiSms_CmdStatus result=
+WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={(0x98f+1762-0x1071)};assert(
+pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)pDatabuf;zUfiSms_InitCmdStatus(&
+tStatus,WMS_SMS_CMD_MSG_WRITE);result=zUfiSms_WriteRawSms((T_zUfiSms_SaveReq*)
+ptMessage->msg_data);if(g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_NV]){tStatus.
+err_code=ZTE_SMS_CMS_MEM_FULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x57\x65\x62\x5f\x53\x61\x76\x65\x53\x6d\x73\x20\x6d\x65\x6d\x20\x66\x75\x6c\x6c" "\n"
+);}tStatus.cmd_status=result;(void)zUfiSms_SetCmdStatus(&tStatus);
+zUfiSms_ChangeMainState(SMS_STATE_SAVING);sc_cfg_set(NV_SMS_SAVE_RESULT,
+"\x6f\x6b");}VOID atWeb_SetSms(UINT8*pDatabuf){T_zGoaheadMsgBuf*ptMessage=NULL;
+T_zUfiSms_CmdStatus result=WMS_CMD_PROCESSING;T_zUfiSms_StatusInfo tStatus={
+(0x16eb+1028-0x1aef)};printf(
+"\x49\x4e\x54\x4f\x20\x61\x74\x57\x65\x62\x5f\x53\x65\x74\x53\x6d\x73\x2e" "\n")
+;assert(pDatabuf!=NULL);ptMessage=(T_zGoaheadMsgBuf*)pDatabuf;
+zUfiSms_InitCmdStatus(&tStatus,WMS_SMS_CMD_CFG_SET_PARAMETERS);result=
+zUfiSms_SetSmsPara((T_zUfiSms_ParaInfo*)ptMessage->msg_data);tStatus.cmd_status=
+result;(void)zUfiSms_SetCmdStatus(&tStatus);}VOID atWeb_OutdateSmsCheck(UINT8*
+pDatabuf){T_zUfiSms_DelReq tSmsDel={(0x7f0+7623-0x25b7)};
+zUfiSms_CheckDbOutdateSms(ZTE_WMS_DB_NV_TABLE,&tSmsDel);printf(
+"\x2d\x2d\x2d\x2d\x6f\x75\x74\x20\x63\x6f\x75\x6e\x20\x6e\x76\x74\x3a\x20\x25\x64\x2d\x2d\x2d\x2d" "\n"
+,tSmsDel.all_or_count);if(tSmsDel.all_or_count>(0x12b+6943-0x1c4a)){
+atWeb_DelSmsByIndex(&tSmsDel);}memset(&tSmsDel,(0x709+941-0xab6),sizeof(
+T_zUfiSms_DelReq));zUfiSms_CheckDbOutdateSms(ZTE_WMS_DB_SIM_TABLE,&tSmsDel);
+printf(
+"\x2d\x2d\x2d\x2d\x6f\x75\x74\x20\x63\x6f\x75\x6e\x74\x20\x73\x69\x6d\x3a\x20\x25\x64\x2d\x2d\x2d\x2d" "\n"
+,tSmsDel.all_or_count);if(tSmsDel.all_or_count>(0x4c+4306-0x111e)){
+atWeb_DelSmsByIndex(&tSmsDel);}}VOID zSms_HandleWebMsg(MSG_BUF*ptMsgBuf){UINT32 
+i=(0x162d+3387-0x2368);assert(ptMsgBuf!=NULL);printf(
+"\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x66\x72\x6f\x6d\x20\x77\x65\x62\x73\x65\x72\x76\x65\x72\x3a\x25\x64" "\n"
+,ptMsgBuf->usMsgCmd);while((0x1f32+747-0x221d)!=SmsHandleWebTab[i].msg_id){if(
+ptMsgBuf->usMsgCmd==SmsHandleWebTab[i].msg_id){if(SmsHandleWebTab[i].need_block
+&&ptMsgBuf->src_id!=MODULE_ID_SMS){ipc_send_message(MODULE_ID_SMS,
+MODULE_ID_SMS_LOCAL,ptMsgBuf->usMsgCmd,ptMsgBuf->usDataLen,(unsigned char*)
+ptMsgBuf->aucDataBuf,(0x1a87+1294-0x1f95));}else if(NULL!=SmsHandleWebTab[i].
+func_ptr){SmsHandleWebTab[i].func_ptr(ptMsgBuf->aucDataBuf);}break;}i++;}}SINT32
+ zSms_SendMsg(USHORT Msg_cmd,USHORT us_DataLen,UCHAR*pData){printf(
+"\x73\x6d\x73\x20\x73\x65\x6e\x64\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n"
+,Msg_cmd);ipc_send_message(MODULE_ID_SMS,MODULE_ID_AT_CTL,Msg_cmd,us_DataLen,(
+unsigned char*)pData,(0x1303+5102-0x26f1));return(0x1d49+1315-0x226c);}SINT32 
+zSms_SendCmgsReq(VOID){T_zSms_SendSmsReq sendSmsInfo={(0xd73+3579-0x1b6e)};
+memset(&sendSmsInfo,(0x4e6+7181-0x20f3),sizeof(T_zSms_SendSmsReq));sendSmsInfo.
+length=g_zUfiSms_FinalCmgsBuf.length;if(strlen(g_zUfiSms_FinalCmgsBuf.pdu)<
+ZSMS_PDU_SIZE-(0x12cb+5109-0x26bf)){memcpy(sendSmsInfo.pdu,
+g_zUfiSms_FinalCmgsBuf.pdu,strlen(g_zUfiSms_FinalCmgsBuf.pdu));}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
+,g_zUfiSms_FinalCmgsBuf.pdu);memcpy(sendSmsInfo.pdu,g_zUfiSms_FinalCmgsBuf.pdu,
+ZSMS_PDU_SIZE-(0x263+6187-0x1a8c));}*(sendSmsInfo.pdu+strlen(
+g_zUfiSms_FinalCmgsBuf.pdu))=ZSMS_CTRL_Z_CHAR;
+#if (0x13a4+3823-0x2292)
+printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x73\x65\x6e\x64\x20\x64\x61\x74\x61" "\n"
+);printf("\n" "\x5b\x53\x4d\x53\x5d\x25\x73" "\n",sendSmsInfo.pdu);
+#endif

+zSms_SendMsg(MSG_CMD_SENDSMS_REQ,sizeof(T_zSms_SendSmsReq),&sendSmsInfo);
+sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0x58f+8057-0x2507)){return 
+ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmgsOk(VOID){
+printf(
+"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x73\x75\x63\x63\x65\x73\x73\x2e\x20" "\n"
+);g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
+ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_DbStoreData[
+g_zUfiSms_CurConcatSegNo-(0x199d+794-0x1cb6)].tag=WMS_TAG_TYPE_MO_SENT_V01;
+zUfiSms_CmgsRespProc();}VOID zSms_RecvCmgsErr(VOID){printf(
+"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x66\x61\x69\x6c\x2e\x20" "\n");
+g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
+ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_SendFailedCount++;printf(
+"\x73\x65\x6e\x64\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64\x2c\x73\x6f\x20\x77\x72\x69\x74\x65\x20\x73\x6d\x73\x20\x74\x6f\x20\x64\x72\x61\x66\x74\x62\x6f\x78\x2e" "\n"
+);g_zUfiSms_DbStoreData[g_zUfiSms_CurConcatSegNo-(0xb23+6995-0x2675)].tag=
+WMS_TAG_TYPE_MO_NOT_SENT_V01;if(g_zUfiSms_ConcatTotalNum>(0xda1+4409-0x1ed9)){
+g_zUfiSms_IsConcatSendSuc=FALSE;}zUfiSms_CmgsRespProc();}SINT32 zSms_SendCmgdReq
+(UINT8 index){T_zSms_DelSmsReq delSmsReq={(0x150d+548-0x1731)};delSmsReq.index=
+index;zSms_SendMsg(MSG_CMD_DELSMS_REQ,sizeof(T_zSms_DelSmsReq),&delSmsReq);
+sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0xb8d+6650-0x2586)){return 
+ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmgdOk(VOID){CHAR 
+strUsed[(0x1f6+4782-0x149a)]={(0x7c7+1653-0xe3c)};int used=(0x1d52+1382-0x22b8);
+int tmp_i=(0x41c+8940-0x2708);sc_cfg_set(NV_SMS_DEL_RESULT,"\x6f\x6b");printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x4f\x4b\x2e\x20" "\n"
+);sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));tmp_i=atoi(
+strUsed);if(tmp_i<(0xd2+2286-0x9c0)||tmp_i>INT_MAX-(0x58f+4477-0x170b)){at_print
+(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x55\x53\x45\x44\x20\x74\x6d\x70\x5f\x69\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,tmp_i);tmp_i=(0x1e87+2085-0x26ac);}used=tmp_i-(0x1509+833-0x1849);if(used<
+(0x815+3685-0x167a)){used=(0x76a+2959-0x12f9);}memset(&strUsed,
+(0x28c+9143-0x2643),(0x131c+4422-0x2458));snprintf(strUsed,sizeof(strUsed),
+"\x25\x64",used);sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed);}VOID 
+zSms_RecvCmgdErr(VOID){sc_cfg_set(NV_SMS_DEL_RESULT,"\x66\x61\x69\x6c");printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x66\x61\x69\x6c\x2e\x20" "\n"
+);}VOID zSms_RecvCmgdFinish(VOID){char StrValue[(0x1645+741-0x1920)]={
+(0x120+8615-0x22c7)};CHAR strTotal[(0x362+1659-0x9d3)]={(0x6c6+2727-0x116d)};
+CHAR strUsed[(0x147a+1195-0x191b)]={(0xc7+4977-0x1438)};int total=
+(0x11c8+5139-0x25db);int used=(0x310+4312-0x13e8);int remain=(0x332+1387-0x89d);
+sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi(
+strUsed);if(used<(0xb24+881-0xe95)||used>INT_MAX-(0x7a8+958-0xb65)){at_print(
+LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x55\x53\x45\x44\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,used);used=(0x18d4+2299-0x21cf);}sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL,
+strTotal,sizeof(strTotal));total=atoi(strTotal);if(total<(0xd04+5453-0x2251)||
+total>INT_MAX-(0x41d+6249-0x1c85)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x57\x4d\x53\x5f\x4e\x56\x43\x4f\x4e\x46\x49\x47\x5f\x53\x49\x4d\x5f\x43\x41\x52\x44\x5f\x54\x4f\x54\x41\x4c\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,total);total=(0x848+4425-0x1991);}remain=total-used;if(remain<
+(0x11cf+4952-0x2527)){remain=(0x765+669-0xa02);}memset(&StrValue,
+(0x2307+585-0x2550),(0x1bf7+666-0x1e87));snprintf(StrValue,sizeof(StrValue),
+"\x25\x64",remain);sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,StrValue);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x69\x6d\x53\x6d\x73\x20\x75\x73\x65\x64\x3d\x25\x64\x2c\x72\x65\x6d\x61\x69\x6e\x3d\x25\x64\x2c\x74\x6f\x74\x61\x6c\x3d\x25\x64" "\n"
+,used,remain,total);zUfiSms_ChangeMainState(SMS_STATE_DELED);sc_cfg_set(
+NV_SMS_DB_CHANGE,"\x31");}int zSms_SendZmenaReq(SINT32 avail){T_zSms_StroageReq 
+storageReq={(0xddb+1645-0x1448)};storageReq.type=avail;zSms_SendMsg(
+MSG_CMD_STORAGE_CAP_REQ,sizeof(T_zSms_StroageReq),&storageReq);sem_wait(&
+g_sms_sem_id);if(g_smsOptRsp.result==(0xe8c+3887-0x1dba)){return ZSMS_RESULT_OK;
+}else{return ZSMS_RESULT_ERROR;}}int zSms_SendCmgrReq(UINT8 index){
+T_zSms_ModifyTagReq modTagReq={(0x1290+3141-0x1ed5)};modTagReq.index=index;
+zSms_SendMsg(MSG_CMD_MODIFY_TAG_REQ,sizeof(T_zSms_ModifyTagReq),&modTagReq);
+sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0x6c5+6712-0x20fc)){return 
+ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}int zSms_SetCscaReq(PSTR sca){
+T_zSms_SetScaReq setscareq;strncpy(setscareq.sca,sca,sizeof(setscareq.sca)-
+(0x323+2292-0xc16));zSms_SendMsg(MSG_CMD_SCA_SET_REQ,sizeof(T_zSms_SetScaReq),&
+setscareq);sem_wait(&g_sms_sem_id);if(g_smsOptRsp.result==(0xd3d+5876-0x2430)){
+return ZSMS_RESULT_OK;}else{return ZSMS_RESULT_ERROR;}}int zSms_SendCnmiReq(PSTR
+ pAtCmdPara){T_zSms_NotifySetReq notifySetReq={(0x2145+404-0x22d9)};if(
+(0x13fd+1059-0x1820)==strcmp(pAtCmdPara,"\x73\x69\x6d")){notifySetReq.mt=
+(0x23a2+328-0x24e9);}else{notifySetReq.mt=(0x17d6+3494-0x257a);}zSms_SendMsg(
+MSG_CMD_NOTIFY_SET_REQ,sizeof(T_zSms_NotifySetReq),&notifySetReq);sem_wait(&
+g_sms_sem_id);if(g_smsOptRsp.result==(0x1b5+8977-0x24c5)){return ZSMS_RESULT_OK;
+}else{return ZSMS_RESULT_ERROR;}}VOID zSms_RecvCmtInd(UINT8*pDatabuf){CHAR 
+needSMS[(0x908+1777-0xfc7)]={(0x10f0+4378-0x220a)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x8fb+3132-0x1537)==strcmp(
+needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}T_zSms_SmsInd tCmtRsp={(0x358+8885-0x260d)};memcpy(&tCmtRsp,(
+T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));zUfiSms_CmtRespProc(&tCmtRsp);
+zUfiMmi_SendSmsStatus();sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}VOID 
+zSms_RecvCmtiInd(UINT8*pDatabuf){char sms_Main_state[(0x2dc+7721-0x20e7)]={
+(0xe84+5410-0x23a6)};T_zSms_SmsIndexInd*smsIdxInd=(T_zSms_SmsIndexInd*)pDatabuf;
+CHAR needSMS[(0xd7a+4550-0x1f0e)]={(0xa76+7146-0x2660)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x867+2088-0x108f)==strcmp(
+needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));if(
+strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
+(0x18b7+1300-0x1dcb)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
+);return;}if((0xe4c+637-0x10c9)==strncmp("\x53\x4d",smsIdxInd->storetype,
+(0xe8b+2252-0x1755))){zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);
+zUfiSms_ChangeMainState(SMS_STATE_RECVING);zSms_SendZmgrReq(smsIdxInd->index);}
+else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
+);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}VOID zSms_RecvCdsInd(UINT8*pDatabuf){CHAR 
+needSMS[(0x9bf+2246-0x1253)]={(0x2285+389-0x240a)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x19f0+2873-0x2529)==strcmp(
+needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}T_zSms_SmsInd tCmtRsp={(0x80b+2814-0x1309)};memcpy(&tCmtRsp,(
+T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));zUfiSms_CdsRespProc(&tCmtRsp);
+zUfiMmi_SendSmsStatus();sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}VOID 
+zSms_RecvCdsiInd(UINT8*pDatabuf){char sms_Main_state[(0x1c9d+521-0x1e88)]={
+(0xbba+2772-0x168e)};T_zSms_SmsIndexInd*smsIdxInd=(T_zSms_SmsIndexInd*)pDatabuf;
+CHAR needSMS[(0xab+3971-0xffc)]={(0x5ca+286-0x6e8)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0xdf4+4121-0x1e0d)==strcmp(
+needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));if(
+strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
+(0x983+3381-0x16b8)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
+);return;}if((0x1d39+1720-0x23f1)==strncmp("\x53\x4d",smsIdxInd->storetype,
+(0x1cf+301-0x2fa))){zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);
+zUfiSms_ChangeMainState(SMS_STATE_RECVING);zSms_SendZmgrReq(smsIdxInd->index);}
+else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
+);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}int zSms_SendCnmaReq(int ack_mode){
+T_zSms_SmsAckReq ackReq={(0x1094+1044-0x14a8)};CHAR ackPduStr[
+(0x1a11+1201-0x1e90)]={(0x162b+3850-0x2535)};ackReq.ackmode=ack_mode;if(ack_mode
+==(0x9fa+5551-0x1fa7)){zUfiSms_EncodePdu_DeliverReport(ackPduStr,
+(0x143f+3491-0x210f));memcpy(ackReq.pdu,ackPduStr,strlen(ackPduStr));
+#if (0x63f+934-0x9e5)

+if(strlen(ackPduStr)<ZSMS_PDU_SIZE-(0x8d4+2780-0x13af)){memcpy(ackReq.pdu,
+ackPduStr,strlen(ackPduStr));}else{at_print(LOG_DEBUG
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
+,ackPduStr);memcpy(ackReq.pdu,ackPduStr,ZSMS_PDU_SIZE-(0x1102+4875-0x240b));}
+#endif     

+*(ackReq.pdu+strlen(ackPduStr))=ZSMS_CTRL_Z_CHAR;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x2e\x20\x70\x64\x75\x3d\x20\x25\x73" "\n"
+,ackReq.pdu);ackReq.length=strlen(ackPduStr)/(0xae5+3505-0x1894);}zSms_SendMsg(
+MSG_CMD_SMSACK_REQ,sizeof(T_zSms_SmsAckReq),&ackReq);sem_wait(&g_sms_sem_id);if(
+g_smsOptRsp.result==(0x525+2491-0xedf)){return ZSMS_RESULT_OK;}else{return 
+ZSMS_RESULT_ERROR;}}int zSms_SendZmgrReq(int index){T_zSms_ReadSmsReq readSmsReq
+={(0x142d+4208-0x249d)};iSmsIndex=index;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x5a\x6d\x67\x72\x52\x65\x71\x20\x47\x65\x74\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2e" "\n"
+,iSmsIndex);readSmsReq.index=index;zSms_SendMsg(MSG_CMD_READSMS_REQ,sizeof(
+T_zSms_ReadSmsReq),&readSmsReq);return(0x13c+5559-0x16f3);}VOID zSms_RecvZmgrRsp
+(UINT8*pDatabuf){T_zSms_SmsInd tCmgrRsp={(0x13af+2920-0x1f17)};memcpy(&tCmgrRsp,
+(T_zSms_SmsInd*)pDatabuf,sizeof(T_zSms_SmsInd));tCmgrRsp.index=iSmsIndex;
+zUfiSms_ZmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();}VOID zSms_RecvZmgrOk(
+UINT8*pDatabuf){T_zSms_optRsp smsOptRsp={(0x1d65+454-0x1f2b)};memcpy(&smsOptRsp,
+(T_zSms_optRsp*)pDatabuf,sizeof(T_zSms_optRsp));if(smsOptRsp.result==
+(0xb9c+875-0xf06)){sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x45\x72\x72\x20\x20\x53\x4d\x53\x20\x7a\x6d\x67\x72\x20\x69\x73\x20\x66\x61\x69\x6c" "\n"
+);sc_cfg_set(NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(
+SMS_STATE_RECVED);}}VOID zSms_RecvZpbicInd(UINT8*pDatabuf){T_zAt_ZpbicRes*ptPara
+=ZUFI_NULL;if(pDatabuf==NULL){return;}ptPara=(T_zAt_ZpbicRes*)(pDatabuf);if((
+(0x7c3+7342-0x2470)==ptPara->result)&&((0x96a+5767-0x1ff1)==ptPara->opertype)){
+CHAR needSms[(0x11a4+4522-0x231c)]={(0x1dd+7039-0x1d5c)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSms,sizeof(needSms));if((0x553+860-0x8af)!=strcmp(
+needSms,"\x6e\x6f")){zSvr_Zpbic_Sms_Init();}}}VOID zSms_RecvCpmsInd(UINT8*
+pDatabuf){T_zSms_CpmsInd*cpmsInd=(T_zSms_CpmsInd*)pDatabuf;CHAR strBuf[
+(0x34f+7123-0x1f18)]={(0xdba+6094-0x2588)};int remainSpace=(0x70f+6278-0x1f95);
+snprintf(strBuf,sizeof(strBuf),"\x25\x64",cpmsInd->total);sc_cfg_set(
+ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL,strBuf);sc_cfg_set(
+ZTE_WMS_NVCONFIG_SIM_CAPABILITY,strBuf);memset(&strBuf,(0x1a1+1197-0x64e),
+(0x5cc+6259-0x1e35));snprintf(strBuf,sizeof(strBuf),"\x25\x64",cpmsInd->used);
+sc_cfg_set(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strBuf);remainSpace=cpmsInd->total-
+cpmsInd->used;memset(&strBuf,(0xaef+5647-0x20fe),(0x659+776-0x957));snprintf(
+strBuf,sizeof(strBuf),"\x25\x64",remainSpace);sc_cfg_set(
+ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,strBuf);sc_cfg_set(NV_SMS_STORE,"\x6f\x6b");}
+#define AT_CMD_MAX (0xfab+1648-0x15db)

+#define ZAT_TAB_REPLACE                     ((unsigned char )(\
+(0x1c9c+2460-0x253c)))    

+#define ZAT_NULL_FILL                       ((unsigned char )((0x122+2248-0x8ed)\
+))    

+#define ZAT_SPACE_REPLACE                   ((unsigned char )(\
+(0x1731+2168-0x1eab)))    

+#define ZAT_LF_REPLACE                      ((unsigned char )(\
+(0x62a+4773-0x17d4)))    

+#define ZAT_CR_REPLACE                      ((unsigned char )(\
+(0x553+8614-0x25ff)))    

+static void atBase_PreProcRes(char*pParaLine,int paraSize){signed long flg=
+(0xe43+5379-0x2346);unsigned long i=(0x622+4342-0x1718);unsigned long length=
+(0x1157+3151-0x1da6);char*pSource=pParaLine;char*pDest=NULL;char*pStrDestMalloc=
+(char*)malloc(AT_CMD_MAX);if(NULL==pStrDestMalloc){return;}memset(pStrDestMalloc
+,(0x892+6111-0x2071),AT_CMD_MAX);assert(pParaLine!=NULL);pDest=pStrDestMalloc;
+length=strlen(pParaLine);if((length==(0xb37+871-0xe9e))||(length>=AT_CMD_MAX)){
+free(pStrDestMalloc);return;}for(i=(0x9d5+7250-0x2627);(i<length)&&(pDest-
+pStrDestMalloc<AT_CMD_MAX);i++){if(((char)(0x110b+2214-0x198f))==*pSource){flg=(
+(0x16dd+1489-0x1cae)==flg)?(0x287+3229-0xf23):(0x1392+528-0x15a2);if(
+((char)(0xdd3+3510-0x1b67))==*(pSource+(0x1225+942-0x15d2))){*pDest++=(char)
+ZAT_NULL_FILL;}}else if((((char)(0x851+1619-0xe78))==*pSource)&&(
+(0x1758+1232-0x1c28)==flg)){*pDest++=((char)(0xe7b+379-0xfd6));if(
+((char)(0x12ad+5113-0x267a))==*(pSource+(0xdd1+2970-0x196a))){*pDest++=
+((char)(0x3e2+3098-0xfc3));}else if('\0'==*(pSource+(0x1a69+519-0x1c6f))){*pDest
+++=(char)ZAT_NULL_FILL;}}else{if((((char)(0x1b94+2916-0x26d8))==*pSource)&&(
+(0x5c6+1446-0xb6b)==flg)){*pDest++=(char)ZAT_SPACE_REPLACE;}else if(('\t'==*
+pSource)&&((0x55a+8478-0x2677)==flg)){*pDest++=(char)ZAT_TAB_REPLACE;}else if((
+'\n'==*pSource)&&((0x245+4523-0x13ef)==flg)){*pDest++=(char)ZAT_LF_REPLACE;}else
+ if(('\r'==*pSource)&&((0x75b+3123-0x138d)==flg)){*pDest++=(char)ZAT_CR_REPLACE;
+}else{*pDest++=*pSource;}}pSource++;}memset(pParaLine,(0x383+404-0x517),paraSize
+);strncpy(pParaLine,pStrDestMalloc,paraSize-(0x4f1+6200-0x1d28));free(
+pStrDestMalloc);}VOID zSms_RecvCscaInd(UINT8*pDatabuf){T_zSms_CscaInd cscaInd={
+(0x385+1585-0x9b6)};
+#if (0xb62+5910-0x2277)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x7a\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x73\x63\x61\x49\x6e\x64\x20\x64\x61\x74\x61\x62\x75\x66\x3a\x25\x73" "\n"
+,pDatabuf);
+#endif

+atBase_PreProcRes(pDatabuf,strlen(pDatabuf));sscanf(pDatabuf,
+"\x25\x32\x31\x73\x20\x25\x32\x31\x73",cscaInd.sca,cscaInd.tosca);
+#if (0x121+6723-0x1b63)
+printf(
+"\x5b\x53\x4d\x53\x63\x6f\x72\x65\x6d\x5d\x7a\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x73\x63\x61\x49\x6e\x64\x20\x73\x63\x61\x3a\x25\x73\x2c\x20\x74\x6f\x73\x63\x61\x25\x73" "\n"
+,cscaInd.sca,cscaInd.tosca);
+#endif

+sc_cfg_set(NV_SMS_CENTER_NUM,cscaInd.sca);zUfiSms_SetScaPara(cscaInd.sca);}VOID 
+zSms_RecvZmglInd(UINT8*pDatabuf){zUfiSms_CmglRespProc((T_zSms_SmsInd*)pDatabuf);
+}int zSms_SendSmsInitReq(VOID){zSms_SendMsg(MSG_CMD_SMSINIT_REQ,
+(0x1748+156-0x17e4),NULL);return(0x626+1706-0xcd0);}VOID zSms_initAtOk(VOID){
+T_zUfiSms_StatusInfo tStatus={(0x10b+411-0x2a6)};sc_cfg_set(NV_SMS_STORE,
+"\x6f\x6b");sc_cfg_set(NV_SMS_LOAD_RESULT,"\x6f\x6b");tStatus.cmd_status=
+WMS_CMD_SUCCESS;tStatus.cmd=WMS_SMS_CMD_INIT;(void)zUfiSms_SetCmdStatus(&tStatus
+);zUfiSms_ChangeMainState(SMS_STATE_LOADED);}VOID zSms_initAtErr(VOID){
+T_zUfiSms_StatusInfo tStatus={(0x584+6585-0x1f3d)};sc_cfg_set(NV_SMS_LOAD_RESULT
+,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_LOADED);tStatus.
+cmd_status=WMS_CMD_FAILED;tStatus.cmd=WMS_SMS_CMD_INIT;(void)
+zUfiSms_SetCmdStatus(&tStatus);}VOID zSms_RecvSmsInitRst(UINT8*pDatabuf){memcpy(
+&g_smsOptRsp,pDatabuf,sizeof(T_zSms_optRsp));if(g_smsOptRsp.result==
+(0x1bc5+748-0x1eb0)){zSms_initAtOk();}else{zSms_initAtErr();}}UINT8 
+zSms_SmsMsgCreat(VOID){g_zSms_MsqId=msgget(MODULE_ID_SMS,IPC_CREAT|
+(0xc74+1274-0xfee));if(g_zSms_MsqId==-(0xc6b+3916-0x1bb6)){return ZUFI_FAIL;}
+g_zSms_LocalMsqId=msgget(MODULE_ID_SMS_LOCAL,IPC_CREAT|(0x7fc+5701-0x1cc1));if(
+g_zSms_LocalMsqId==-(0x1c9b+65-0x1cdb)){return ZUFI_FAIL;}sem_init(&g_sms_sem_id
+,(0x1922+1102-0x1d70),(0x1af6+2504-0x24be));return ZUFI_SUCC;}void 
+zSms_HandleAtctlLocalMsg(MSG_BUF*ptMsgBuf){assert(ptMsgBuf!=NULL);printf(
+"\x73\x6d\x73\x20\x6c\x6f\x63\x61\x6c\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n"
+,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_ZPBIC_IND:
+zSms_RecvZpbicInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_ZMGL_IND:
+zSms_RecvZmglInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_NEWSMS_STATUS_IND:
+zSms_RecvCdsInd(ptMsgBuf->aucDataBuf);break;case MSG_CMD_NEWSMS_IND:
+zSms_RecvCmtInd(ptMsgBuf->aucDataBuf);default:break;}}VOID zSms_HandleAtctlMsg(
+MSG_BUF*ptMsgBuf){assert(ptMsgBuf!=NULL);printf(
+"\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n"
+,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_SENDSMS_RSP:case 
+MSG_CMD_DELSMS_RSP:case MSG_CMD_STORAGE_CAP_RSP:case MSG_CMD_MODIFY_TAG_RSP:case
+ MSG_CMD_NOTIFY_SET_RSP:case MSG_CMD_SCA_SET_RSP:case MSG_CMD_SMSACK_RSP:{memcpy
+(&g_smsOptRsp,ptMsgBuf->aucDataBuf,sizeof(T_zSms_optRsp));sem_post(&g_sms_sem_id
+);}break;case MSG_CMD_CPMS_IND:zSms_RecvCpmsInd(ptMsgBuf->aucDataBuf);break;case
+ MSG_CMD_CSCA_IND:zSms_RecvCscaInd(ptMsgBuf->aucDataBuf);break;case 
+MSG_CMD_ZMGR_IND:zSms_RecvZmgrRsp(ptMsgBuf->aucDataBuf);break;case 
+MSG_CMD_READSMS_RSP:zSms_RecvZmgrOk(ptMsgBuf->aucDataBuf);break;case 
+MSG_CMD_SMSINIT_RSP:zSms_RecvSmsInitRst(ptMsgBuf->aucDataBuf);break;case 
+MSG_CMD_NEWSMS_INDEX_IND:zSms_RecvCmtiInd(ptMsgBuf->aucDataBuf);break;case 
+MSG_CMD_NEWSMS_STATUS_INDEX_IND:zSms_RecvCdsiInd(ptMsgBuf->aucDataBuf);break;
+case MSG_CMD_NEWSMS_IND:case MSG_CMD_ZPBIC_IND:case MSG_CMD_ZMGL_IND:case 
+MSG_CMD_NEWSMS_STATUS_IND:ipc_send_message(MODULE_ID_SMS,MODULE_ID_SMS_LOCAL,
+ptMsgBuf->usMsgCmd,ptMsgBuf->usDataLen,(unsigned char*)ptMsgBuf->aucDataBuf,
+(0x25a+7929-0x2153));break;default:break;}}VOID zSms_HandleResetToFactory(){CHAR
+ clearSms[(0x1871+2544-0x222f)]={(0x759+1666-0xddb)};sc_cfg_get(
+NV_CLEAR_SMS_WHEN_RESTORE,clearSms,sizeof(clearSms));printf(
+"\x61\x74\x57\x65\x62\x5f\x52\x65\x73\x74\x6f\x72\x65\x46\x61\x63\x74\x6f\x72\x79\x53\x65\x74\x74\x69\x6e\x67\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n"
+);printf(
+"\x63\x6c\x65\x61\x72\x5f\x73\x6d\x73\x5f\x77\x68\x65\x6e\x5f\x72\x65\x73\x74\x6f\x72\x65\x3d\x25\x73\x20" "\n"
+,clearSms);if(strcmp(clearSms,"\x79\x65\x73")==(0x327+5545-0x18d0)){printf(
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n"
+);zUfiSms_DropAllTable();}else{printf(
+"\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x72\x6f\x70\x41\x6c\x6c\x54\x61\x62\x6c\x65\x45\x78\x63\x65\x70\x74\x53\x6d\x73\x20\x65\x6e\x74\x65\x72\x65\x64\x21\x20" "\n"
+);zUfiSms_DropAllTableExceptSms();}ipc_send_message(MODULE_ID_SMS,
+MODULE_ID_MAIN_CTRL,MSG_CMD_RESET_RSP,(0x1461+3029-0x2036),NULL,
+(0x163+6829-0x1c10));}void zSms_HandleMainCtrlMsg(MSG_BUF*ptMsgBuf){assert(
+ptMsgBuf!=NULL);printf(
+"\x73\x6d\x73\x20\x72\x65\x63\x76\x20\x6d\x61\x69\x6e\x20\x63\x74\x72\x6c\x20\x6d\x73\x67\x20\x63\x6d\x64\x3a\x25\x64" "\n"
+,ptMsgBuf->usMsgCmd);switch(ptMsgBuf->usMsgCmd){case MSG_CMD_RESET_NOTIFY:
+zSms_HandleResetToFactory(ptMsgBuf->aucDataBuf);break;default:break;}}void 
+sms_msg_thread_proc(void*arg){int iRet=(0xb60+1700-0x1204);MSG_BUF stMsg={
+(0x3d4+8753-0x2605)};int msgSize=sizeof(MSG_BUF)-sizeof(long);int queueId=*((int
+*)arg);prctl(PR_SET_NAME,"\x73\x6d\x73\x5f\x6c\x6f\x63\x61\x6c",
+(0x12c9+582-0x150f),(0x91b+1988-0x10df),(0xf74+4524-0x2120));while(
+(0xb22+3411-0x1874)){iRet=(0x59b+2292-0xe8f);memset(&stMsg,(0x529+2870-0x105f),
+sizeof(MSG_BUF));iRet=msgrcv(queueId,&stMsg,msgSize,(0xe87+2449-0x1818),
+(0x19f0+3295-0x26cf));if(iRet>=(0x22a1+326-0x23e7)){switch(stMsg.src_id){case 
+MODULE_ID_WEB_CGI:{zSms_HandleWebMsg(&stMsg);break;}case MODULE_ID_AT_CTL:{
+zSms_HandleAtctlMsg(&stMsg);break;}case MODULE_ID_SMS:{zSms_HandleWebMsg(&stMsg)
+;zSms_HandleAtctlLocalMsg(&stMsg);break;}case MODULE_ID_MAIN_CTRL:{
+zSms_HandleMainCtrlMsg(&stMsg);break;}default:{break;}}}else{at_print(AT_DEBUG,
+"\x65\x72\x72\x6e\x6f\x20\x3d\x20\x25\x64\x2c\x20\x65\x72\x72\x6d\x73\x67\x20\x3d\x20\x25\x73" "\n"
+,errno,strerror(errno));}}}int sms_main(int argc,char*argv[]){pthread_t 
+recv_thread_tid=(0x546+178-0x5f8);MSG_BUF msgBuf={(0x85a+5342-0x1d38)};CHAR 
+needSMS[(0x16ea+2122-0x1f02)]={(0xea3+1178-0x133d)};prctl(PR_SET_NAME,
+"\x73\x6d\x73\x5f\x6d\x61\x69\x6e",(0x14fd+359-0x1664),(0xcb6+5473-0x2217),
+(0x322+7676-0x211e));loglevel_init();sc_cfg_get(NV_NEED_SUPPORT_SMS,needSMS,
+sizeof(needSMS));if((0x453+7708-0x226f)!=strcmp(needSMS,"\x6e\x6f")){
+zUfiSms_InitDb();zUfiSms_CfgSmsNvInit();zUfiMmi_SendSmsStatus();zSms_SmsMsgCreat
+();}else{return-(0x189f+1040-0x1cae);}printf(
+"\x73\x6d\x73\x20\x61\x70\x70\x20\x69\x6e\x69\x74\x20\x66\x69\x6e\x69\x73\x68\x65\x64\x2c\x20\x77\x69\x6c\x6c\x20\x74\x6f\x20\x72\x65\x63\x65\x69\x76\x65\x20\x6d\x73\x67\x2c\x20\x6d\x73\x67\x69\x64\x3a\x25\x64" "\n"
+,g_zSms_MsqId);if(pthread_create(&recv_thread_tid,NULL,sms_msg_thread_proc,(void
+*)(&g_zSms_LocalMsqId))==-(0x4f5+7384-0x21cc)){assert((0x270+7721-0x2099));}
+sms_msg_thread_proc(&g_zSms_MsqId);return(0x8bc+7114-0x2486);}
diff --git a/ap/app/zte_comm/sms/src/sms_proc.c b/ap/app/zte_comm/sms/src/sms_proc.c
new file mode 100755
index 0000000..fe2cb6f
--- /dev/null
+++ b/ap/app/zte_comm/sms/src/sms_proc.c
@@ -0,0 +1,662 @@
+
+#include <limits.h>

+#include "sms_code.h"

+#include <sys/msg.h>

+T_zUfiSms_ConcatInfo g_zUfiSms_ConcatSms;T_zUfiSms_GroupInfo g_zUfiSms_GroupSms;
+T_zUfiSms_DbStoreData g_zUfiSms_DbStoreData[ZTE_WMS_CONCAT_SMS_COUNT_MAX];UINT8 
+g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_MAX]={FALSE,FALSE};T_zUfiSms_DelSms 
+g_zUfiSms_DelMsg;T_zUfiSms_DelIndexInfo g_deleteIndex={(0x11ab+5072-0x257b)};
+T_zUfiSms_ModifySms g_zUfiSms_modifyMsg={(0x13a1+2914-0x1f03)};
+T_zUfiSms_ModifyIndexInfo g_modifyIndex={(0xb83+6302-0x2421)};int 
+g_zUfiSms_UnitLen=(0x1755+2050-0x1f57);int g_zUfiSms_ConcatTotalNum=
+(0x114+3667-0xf67);int g_zUfiSms_CurConcatSegNo=(0x1494+4280-0x254c);UINT8 
+g_zUfiSms_IsConcatSendSuc=TRUE;int g_zUfiSms_SendFailedCount=(0xdb0+4655-0x1fdf)
+;int g_zUfiSms_MsgRefer=(0xbe1+1037-0xfee);int g_zUfiSms_SendFailedRetry=
+(0x2dc+5290-0x1786);char g_Zmena_value[(0xf5a+1876-0x16ac)]={(0xc87+4385-0x1da8)
+};int g_displaymode=(0xf63+981-0x1338);extern SMS_LOCATION g_zUfiSms_CurLocation
+;extern T_zUfiSms_CmdStatus zUfiSms_HandleReport(unsigned char*ptPduData);extern
+ void zUfiSms_GetReportStatus(char*pdu_tmp,int*stat);extern VOID 
+zUfiSms_ResendAtCmdZmena(int cid);extern int zUfiSms_DecodeSmsData(
+T_zUfiSms_DbStoreData*pDb_Data,int msg_index,zUfiSms_StoreType iStorePos,
+T_SmsStatus bSms_Status,wms_message_format_enum_v01 format,long iPdu_Len,
+unsigned char*pPdu_Received);typedef struct{long mtype;char mtext[
+(0xc44+918-0xfce)];}FOTA_MSG_BUF;
+#define WEBUI_NOTIFY_PUSH_MSG_  (0x3e4+5049-0x179a)

+typedef struct{unsigned int isread_record;unsigned int inbox_full;}
+T_zUfiMmi_SmsRecord;void zUfiMmi_SendSmsStatus(void){int iSmsNum=
+(0x43d+5275-0x18d8);T_zUfiMmi_SmsRecord tRecord={(0x1e7+8202-0x21f1)};CHAR 
+smsNum[(0xe6+3806-0xf92)]={(0x1de5+2272-0x26c5)};sc_cfg_get(NV_SMS_IN_NUM,smsNum
+,sizeof(smsNum));iSmsNum=atoi(smsNum);tRecord.isread_record=zUfiSms_IsUnreadSms(
+ZTE_WMS_MEMORY_MAX);if(iSmsNum>=ZSMS_NUM_MAX_CPE){tRecord.inbox_full=
+(0x101b+2079-0x1839);}else{tRecord.inbox_full=(0xb43+1124-0xfa7);}}VOID 
+zUfiSms_Init(VOID){zUfiSms_CfgInit();zUfiSms_ChangeMainState(SMS_STATE_INITING);
+}VOID zSvr_Zpbic_Sms_Init(VOID){int atRes=(0x1425+3977-0x23ae);
+T_zUfiSms_StatusInfo tStatus={(0xb58+2689-0x15d9)};CHAR outDate[
+(0xe37+6067-0x25b8)]={(0x638+2049-0xe39)};zUfiSms_Init();zUfiSms_InitCmdStatus(&
+tStatus,WMS_SMS_CMD_INIT);zSms_SendSmsInitReq();at_print(LOG_DEBUG,
+"corem zSvr_Zpbic_Sms_Init has send init req\n");zSms_SendZmenaReq(
+(0x8fc+7037-0x2479));at_print(LOG_DEBUG,
+"\x63\x6f\x72\x65\x6d\x20\x7a\x53\x76\x72\x5f\x5a\x70\x62\x69\x63\x5f\x53\x6d\x73\x5f\x49\x6e\x69\x74\x20\x68\x61\x73\x20\x73\x65\x6e\x64\x20\x7a\x6d\x65\x6e\x61\x20\x72\x65\x71" "\n"
+);sc_cfg_get(NV_OUTDATE_DELETE,outDate,sizeof(outDate));at_print(LOG_DEBUG,
+"\x63\x6f\x72\x65\x6d\x20\x7a\x53\x76\x72\x5f\x5a\x70\x62\x69\x63\x5f\x53\x6d\x73\x5f\x49\x6e\x69\x74\x20\x6f\x75\x74\x64\x61\x74\x65\x20\x63\x68\x65\x63\x6b\x20\x25\x73" "\n"
+,outDate);if((0x488+714-0x752)==strcmp(outDate,"\x31")){atWeb_OutdateSmsCheck(
+ZUFI_NULL);}}VOID zUfiSms_DeleteAllSimSms(VOID){zUfiSms_DeleteAllSimSmsInDb();}
+#if (0xd69+3281-0x1a3a)

+VOID zUfiSms_ResendAtCmdZmena(int cid){CHAR netType[(0x14b4+2675-0x1ef5)]={
+(0x7b2+2096-0xfe2)};sc_cfg_get(NV_NETWORK_TYPE,netType,sizeof(netType));if(!
+g_Zmena_rsp&&((0x1515+3-0x1518)!=strcmp(
+"\x4e\x6f\x20\x53\x65\x72\x76\x69\x63\x65",netType)&&(0x1019+5417-0x2542)!=
+strcmp("\x4c\x69\x6d\x69\x74\x65\x64\x20\x53\x65\x72\x76\x69\x63\x65",netType)))
+{atUnsoli_Report_Zmena(NULL,cid);}}
+#endif

+void zUfiSms_Ack_new_msg(BOOL needAck){
+#if (0x13f7+3455-0x2176)

+CHAR ackPduStr[(0x15e0+691-0x1703)]={(0x1c4+8832-0x2444)};SMS_PARAM reportParam=
+{(0x1aac+1494-0x2082)};int total_length=(0x6dc+147-0x76f);UINT8 TP_FCS=
+(0x2f5+8132-0x22b9);CHAR strValue[(0x10af+3716-0x1f31)]={(0x12a5+782-0x15b3)};if
+(needAck){TP_FCS=(0x1021+3013-0x1be6);sprintf(strValue,"\x25\x64",
+(0xdda+1677-0x1466));}else{TP_FCS=(0x1a8+8976-0x23e5);sprintf(strValue,
+"\x25\x64",(0x1c31+584-0x1e77));}sprintf(reportParam.SCA,"\x25\x73",cfg_get(
+"\x73\x6d\x73\x5f\x63\x65\x6e\x74\x65\x72\x5f\x6e\x75\x6d"));total_length=
+zUfiSms_EncodePdu_DeliverReport(&reportParam,ackPduStr,TP_FCS);memset(&
+g_zUfiSms_ackPdu,(0xdaf+5972-0x2503),sizeof(g_zUfiSms_ackPdu));g_zUfiSms_ackPdu.
+length=String2Bytes(ackPduStr,g_zUfiSms_ackPdu.pdu,strlen(ackPduStr));memset(
+g_zUfiSms_ackPdu.pdu,(0x90d+2911-0x146c),sizeof(g_zUfiSms_ackPdu.pdu));memcpy(&
+g_zUfiSms_ackPdu.pdu,&ackPduStr,sizeof(ackPduStr));atBase_SendMsgToSelf(
+ZAT_CNMA_CMD,strValue,sizeof(strValue));
+#endif

+#if (0x72a+5465-0x1c83)
+CHAR strValue[(0xe55+4258-0x1ef5)]={(0x1132+167-0x11d9)};if(needAck){snprintf(
+strValue,sizeof(strValue),"\x25\x64",(0x1276+2761-0x1d3e));}else{snprintf(
+strValue,sizeof(strValue),"\x25\x64",(0x15c8+1400-0x1b3e));}zSvr_InnerSendMsg(
+ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,MSG_CMD_AT_CNMA,strlen(strValue
+),strValue);
+#endif

+if(needAck){zSms_SendCnmaReq((0x1136+5367-0x262c));}else{zSms_SendCnmaReq(
+(0xd58+317-0xe93));}}T_zUfiSms_CmdStatus zUfiSms_SendRawSms(T_zUfiSms_SendReq*
+ptSendMsg){if(NULL==ptSendMsg||(0x57a+6022-0x1d00)==ptSendMsg->receiver_count){
+return WMS_CMD_FAILED;}at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x52\x61\x77\x53\x6d\x73\x20\x72\x65\x63\x65\x69\x76\x65\x72\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x64\x65\x73\x74\x5f\x6e\x75\x6d\x3a\x25\x73\x2f\x6d\x73\x67\x5f\x6c\x65\x6e\x3a\x25\x64\x2f\x69\x64\x3a\x25\x64\x2e" "\n"
+,ptSendMsg->receiver_count,ptSendMsg->dest_num[(0xe43+5767-0x24ca)],ptSendMsg->
+msg_len,ptSendMsg->id);
+#if (0xe94+287-0xfb2)
+at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x52\x61\x77\x53\x6d\x73\x20\x64\x63\x73\x3a\x25\x64" "\n"
+,ptSendMsg->dcs);
+#endif

+sc_cfg_set(NV_SMS_SEND_RESULT,"");g_zUfiSms_SendFailedCount=(0x6ad+3566-0x149b);
+if(ptSendMsg->isDelete==TRUE||-(0x1379+2062-0x1b86)!=ptSendMsg->id){(void)
+zUfiSms_DeleteDraftSms(ptSendMsg->id);}zUfiSms_SetGlobalDcsLang(ptSendMsg->dcs);
+memset(&g_zUfiSms_GroupSms,(0xa63+4849-0x1d54),sizeof(g_zUfiSms_GroupSms));if(
+ZUFI_FAIL==zUfiSms_FillGroupSms(ptSendMsg,&g_zUfiSms_GroupSms)){return 
+WMS_CMD_FAILED;}memset(&g_zUfiSms_ConcatSms,(0x50+3418-0xdaa),sizeof(
+g_zUfiSms_ConcatSms));g_zUfiSms_UnitLen=zUfiSms_FillConcatSms(ptSendMsg,&
+g_zUfiSms_ConcatSms);g_zUfiSms_IsConcatSendSuc=TRUE;g_zUfiSms_CurConcatSegNo=
+(0x11ec+683-0x1497);memset(g_zUfiSms_DbStoreData,(0xff+6232-0x1957),sizeof(
+g_zUfiSms_DbStoreData));if(ptSendMsg->mem_store==(0x4fb+2182-0xd77)){
+g_displaymode=(0x852+6110-0x202f);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x3a\x20\x6d\x73\x67\x5f\x64\x69\x73\x70\x6c\x61\x79\x6d\x6f\x64\x65\x20\x3d\x20\x31" "\n"
+);}else{g_displaymode=(0x40d+1942-0xba3);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x6e\x64\x53\x6d\x73\x3a\x20\x6d\x73\x67\x5f\x64\x69\x73\x70\x6c\x61\x79\x6d\x6f\x64\x65\x20\x3d\x20\x30" "\n"
+);}return zUfiSms_SendSms();}T_zUfiSms_CmdStatus zUfiSms_WriteRawSms(
+T_zUfiSms_SaveReq*pSaveBuff){T_zUfiSms_ConcatInfo tConcatSms;T_zUfiSms_GroupInfo
+ tGroupSms;int iSmsLen=(0x742+2786-0x1224);T_zUfiSms_CmdStatus result=
+WMS_CMD_SUCCESS;if(NULL==pSaveBuff){return WMS_CMD_FAILED;}if(
+g_zUfiSms_MemFullFlag[ZTE_WMS_MEMORY_NV]){at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x6e\x76\x20\x6d\x65\x6d\x6f\x72\x79\x20\x69\x73\x20\x66\x75\x6c\x6c\x2c\x72\x65\x74\x75\x72\x6e" "\n"
+);return WMS_CMD_FAILED;}if(pSaveBuff->isDelete==TRUE){(void)
+zUfiSms_DeleteDraftSms(pSaveBuff->id);}zUfiSms_SetGlobalDcsLang(pSaveBuff->dcs);
+memset(&tConcatSms,(0x1c6+351-0x325),sizeof(T_zUfiSms_ConcatInfo));memset(&
+tGroupSms,(0x764+922-0xafe),sizeof(T_zUfiSms_GroupInfo));(void)
+zUfiSms_FillGroupSms(pSaveBuff,&tGroupSms);iSmsLen=zUfiSms_FillConcatSms(
+pSaveBuff,&tConcatSms);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x74\x6f\x74\x61\x6c\x5f\x72\x65\x63\x65\x69\x76\x65\x72\x3d\x25\x64\x2c\x69\x53\x6d\x73\x4c\x65\x6e\x3d\x25\x64" "\n"
+,tGroupSms.total_receiver,iSmsLen);for(tGroupSms.current_receiver=
+(0x1960+1255-0x1e47);tGroupSms.current_receiver<tGroupSms.total_receiver;
+tGroupSms.current_receiver++){tConcatSms.current_sending=(0xd41+1574-0x1367);
+result=zUfiSms_SaveSmsToDb(pSaveBuff,&tConcatSms,&tGroupSms,iSmsLen);at_print(
+LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x63\x75\x72\x72\x65\x6e\x74\x5f\x72\x65\x63\x65\x69\x76\x65\x72\x3d\x25\x64\x2c\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
+,tGroupSms.current_receiver,result);}sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);if(g_zUfiSms_MemFullFlag[
+WMS_STORAGE_TYPE_NV_V01]){zUfiSms_SendSmsStatusInfo(MSG_SMS_DEFAULT);}at_print(
+LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x57\x72\x69\x74\x65\x52\x61\x77\x53\x6d\x73\x20\x65\x6e\x64\x20\x61\x6e\x64\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
+,result);return result;}T_zUfiSms_CmdStatus zUfiSms_DeleteSms(T_zUfiSms_DelReq*
+ptDelBuff){T_zUfiSms_CmdStatus result=WMS_CMD_SUCCESS;BOOL 
+memoryFullbeforeDelete=FALSE;BOOL unreadBeforeDelete=FALSE;if(NULL==ptDelBuff){
+return WMS_CMD_FAILED;}at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x21\x21\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x69\x64\x5b\x25\x64\x5d\x2e" "\n"
+,ptDelBuff->all_or_count,ptDelBuff->id[(0x114b+3604-0x1f5f)]);(void)
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
+SMS_STATE_DELING);memset(&g_zUfiSms_DelMsg,(0x1c66+202-0x1d30),sizeof(
+T_zUfiSms_DelSms));if(ZUFI_FAIL==zUfiSms_SetDeleteInfo(ptDelBuff)){at_print(
+LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x74\x44\x65\x6c\x65\x74\x65\x49\x6e\x66\x6f\x20\x66\x61\x69\x6c\x2e" "\n"
+);zUfiSms_ChangeMainState(SMS_STATE_DELED);return WMS_CMD_FAILED;}at_print(
+LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x21\x21\x21\x7a\x55\x66\x69\x53\x6d\x73\x5f\x53\x65\x74\x44\x65\x6c\x65\x74\x65\x49\x6e\x66\x6f\x20\x52\x65\x61\x64\x20\x74\x6f\x20\x44\x65\x6c\x65\x74\x65\x3a\x6e\x76\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2f\x73\x69\x6d\x5f\x63\x6f\x75\x6e\x74\x3a\x25\x64\x2e" "\n"
+,g_zUfiSms_DelMsg.nv_count,g_zUfiSms_DelMsg.sim_count);if((0x980+2743-0x1437)<
+g_zUfiSms_DelMsg.nv_count){if(g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]){
+memoryFullbeforeDelete=TRUE;}unreadBeforeDelete=zUfiSms_IsUnreadSms(
+ZTE_WMS_MEMORY_NV);result=(T_zUfiSms_CmdStatus)zUfiSms_DeleteNvSms();(void)
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
+SMS_STATE_DELED);sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x20\x6d\x65\x6d\x6f\x72\x79\x46\x75\x6c\x6c\x62\x65\x66\x6f\x72\x65\x44\x65\x6c\x65\x74\x65\x3d\x25\x64\x2c\x4d\x65\x6d\x46\x75\x6c\x6c\x46\x6c\x61\x67\x28\x4e\x56\x29\x3d\x25\x64" "\n"
+,memoryFullbeforeDelete,g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]);if(
+memoryFullbeforeDelete&&!g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]){
+at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x4e\x76\x53\x6d\x73\x3a\x20\x73\x65\x6e\x64\x20\x41\x54\x2b\x5a\x4d\x45\x4e\x41\x3d\x30" "\n"
+);zSms_SendZmenaReq((0xd95+2081-0x15b6));}if(memoryFullbeforeDelete&&!
+g_zUfiSms_MemFullFlag[WMS_STORAGE_TYPE_NV_V01]||unreadBeforeDelete&&!
+zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){zUfiSms_SendSmsStatusInfo(
+MSG_SMS_DEFAULT);}}if((0x391+5270-0x1827)<g_zUfiSms_DelMsg.sim_count){result=
+zUfiSms_DeleteSimSms();(void)zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_SIM);}
+at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x6d\x73\x20\x72\x65\x73\x75\x6c\x74\x3d\x25\x64" "\n"
+,result);return result;}T_zUfiSms_CmdStatus zUfiSms_ModifySmsTag(
+T_zUfiSms_ModifyFlag*ptModifyBuff){unsigned long i=(0x67d+78-0x6cb);
+T_zUfiSms_CmdStatus result=WMS_CMD_SUCCESS;char acStorePos[(0xa4b+2857-0x1542)]=
+{(0x6ca+3788-0x1596)};if(NULL==ptModifyBuff){at_print(LOG_ERR,
+"\x69\x6e\x70\x75\x74\x73\x20\x69\x73\x20\x6e\x75\x6c\x6c\x2e");return 
+WMS_CMD_FAILED;}for(i=(0x2db+3157-0xf30);i<ptModifyBuff->total_id;i++){if(
+ptModifyBuff->id[i]<(0xcfa+5204-0x214d)||ZUFI_FAIL==zUfiSms_UpdateSmsTagInDb(
+ptModifyBuff->id[i],ptModifyBuff->tags)){result=WMS_CMD_FAILED;}else{result=
+WMS_CMD_SUCCESS;}}if(ZUFI_FAIL==zUfiSms_GetStorePosById(
+"\x4d\x65\x6d\x5f\x53\x74\x6f\x72\x65",acStorePos,sizeof(acStorePos),
+ptModifyBuff->id[(0x1b6+2999-0xd6d)])){return ZUFI_FAIL;}if((0x18ec+1375-0x1e4b)
+==strcmp(acStorePos,ZTE_WMS_DB_NV_TABLE)){zUfiSms_SendSmsStatusInfo(
+MSG_SMS_READING);}if((0xae9+3027-0x16bc)==strcmp(acStorePos,ZTE_WMS_DB_SIM_TABLE
+)&&ptModifyBuff->total_id>(0x594+4811-0x185f)){zUfiSms_ModifyModemSms(
+ptModifyBuff);}return result;}T_zUfiSms_CmdStatus zUfiSms_SetSmsPara(
+T_zUfiSms_ParaInfo*ptParaBuff){int atRes=(0xe21+2138-0x167b);CHAR sca[
+ZTE_WMS_ADDRESS_DIGIT_MAX_V01+(0x1283+3113-0x1eab)]={(0x93d+4710-0x1ba3)};CHAR 
+store[(0x9f2+2095-0x120d)]={(0x14a+1509-0x72f)};CHAR defaultStore[
+(0x217+4442-0x133f)]={(0xbb+7806-0x1f39)};if(ptParaBuff==ZUFI_NULL){return 
+WMS_CMD_FAILED;}if(strlen(ptParaBuff->sca)!=(0x1260+2650-0x1cba)){strncpy(sca,
+ptParaBuff->sca,sizeof(sca)-(0x6bc+1352-0xc03));at_print(LOG_DEBUG,
+"\x73\x65\x6e\x64\x20\x5a\x41\x54\x5f\x43\x53\x43\x41\x5f\x53\x45\x54\x5f\x43\x4d\x44\x20\x6d\x65\x73\x73\x61\x67\x65\x20\x63\x73\x63\x61\x20\x69\x73\x20\x25\x73\x2e" "\n"
+,sca);atRes=zSms_SetCscaReq(ptParaBuff->sca);if(atRes!=ZSMS_RESULT_OK){return 
+WMS_CMD_FAILED;}}sc_cfg_get(NV_DEFAULT_STORE,defaultStore,sizeof(defaultStore));
+if((*(ptParaBuff->default_store)!='\0')&&((0x3c+2694-0xac2)!=strcmp(defaultStore
+,ptParaBuff->default_store))){{strncpy(store,ptParaBuff->default_store,sizeof(
+store)-(0x884+5123-0x1c86));}atRes=zSms_SendCnmiReq(store);if(atRes!=
+ZSMS_RESULT_OK){return WMS_CMD_FAILED;}}if(-(0x846+6859-0x2310)==
+zUfiSms_SetDbParameters(ptParaBuff)){at_print(LOG_ERR,
+"\x73\x65\x74\x20\x70\x61\x72\x61\x6d\x65\x74\x65\x72\x73\x20\x74\x6f\x20\x74\x61\x62\x6c\x65\x20\x66\x61\x69\x6c\x65\x64\x2e"
+);return WMS_CMD_FAILED;}return WMS_CMD_SUCCESS;}void zUfiSms_CmgrNvSet(void){
+char sms_rec_flag[(0x16d+1853-0x8a5)]={(0x897+3326-0x1595)};char remind_flag[
+(0xbe3+1705-0x1287)];int sms_count=(0x88b+3327-0x158a);int remind_count=
+(0xa91+674-0xd33);memset(sms_rec_flag,(0x1171+425-0x131a),sizeof(sms_rec_flag));
+sc_cfg_get(ZTE_WMS_NVCONFIG_RECEVIED,sms_rec_flag,sizeof(sms_rec_flag));
+sms_count=atoi(sms_rec_flag);if(sms_count<(0x3d7+5576-0x199f)||sms_count>INT_MAX
+-(0xe8a+1188-0x132d)){at_print(LOG_ERR,
+"\x5b\x53\x4d\x53\x5d\x73\x6d\x73\x5f\x63\x6f\x75\x6e\x74\x20\x65\x72\x72\x3a\x25\x64" "\n"
+,sms_count);return;}memset(sms_rec_flag,(0x987+2733-0x1434),sizeof(sms_rec_flag)
+);snprintf(sms_rec_flag,sizeof(sms_rec_flag),"\x25\x64",sms_count+
+(0x93d+5305-0x1df5));sc_cfg_set(ZTE_WMS_NVCONFIG_RECEVIED,sms_rec_flag);
+sc_cfg_set(ZTE_WMS_NVCONFIG_RECEVIED_LED,sms_rec_flag);memset(remind_flag,
+(0x1003+3708-0x1e7f),sizeof(remind_flag));snprintf(remind_flag,sizeof(
+remind_flag),"\x25\x64",remind_count+(0x38+9457-0x2528));sc_cfg_set(
+ZTE_WMS_NVCONFIG_RECEVIED_REMIND,remind_flag);sc_cfg_set(NV_SMS_RECV_RESULT,
+"\x6f\x6b");sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");}void zUfiSms_CdsRespProc(
+T_zSms_SmsInd*ptRespData){unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
+(0x9ea+4102-0x19f0)};T_zUfiSms_DbStoreData tDbStoreData={(0xe76+2412-0x17e2)};
+int isPushSms=(0x381+247-0x478);if(strcmp(ptRespData->pdu,"")==
+(0x1052+195-0x1115)){CHAR srState[(0xac9+1469-0x1054)]={(0x1c56+180-0x1d0a)};
+sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if((0x82f+5473-0x1d90)!=strcmp(
+srState,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
+NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
+;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
+return;}zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)
+String2Bytes(ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
+(0xce3+2467-0x1681)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
+sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");
+zUfiSms_Ack_new_msg(TRUE);return;}return;}int zUfiSms_CheckIfWholeSms(
+T_zUfiSms_DbStoreData*data,SMS_MSG_INFO*pmsg){if(data->concat_sms!=
+(0x617+4819-0x18e9)){return(0x3ac+8367-0x245b);}zUfiSms_GetCurrentRecvTotalSeq(
+data,pmsg);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x68\x65\x63\x6b\x49\x66\x57\x68\x6f\x6c\x65\x53\x6d\x73\x20\x69\x64\x20\x3d\x20\x25\x73\x2c\x20\x74\x6f\x74\x61\x6c\x53\x65\x71\x20\x3d\x20\x25\x64\x2c\x72\x65\x66\x20\x3d\x25\x64\x2c\x74\x6f\x74\x61\x6c\x20\x3d\x25\x64\x2c\x20\x73\x65\x71\x3d\x25\x64" "\n"
+,pmsg->id,atoi(pmsg->total_seq),data->concat_info[(0x147+7478-0x1e7d)],data->
+concat_info[(0xad8+5057-0x1e98)],data->concat_info[(0x7c6+2218-0x106e)]);if(data
+->concat_info[(0x5d5+1524-0xbc8)]==atoi(pmsg->total_seq)){return
+(0x685+4804-0x1949);}return-(0x5b3+8404-0x2686);}void 
+zUfiSms_TrafficChangeSmsTag(T_zUfiSms_DbStoreData*data){CHAR smsNumber[
+(0x672+7618-0x2402)]={(0x15f0+3582-0x23ee)};sc_cfg_get(NV_TRAFFIC_SMS_NUMBER,
+smsNumber,sizeof(smsNumber));if((0xaa4+35-0xac7)==strcmp(smsNumber,data->number)
+){data->tag=WMS_TAG_TYPE_MT_READ_V01;data->msg_displaymode=(0x114f+5388-0x265a);
+}}void zUfiSms_HandleTrafficSms(T_zUfiSms_DbStoreData*data){int iSmsId=
+(0x1257+4896-0x2577);SMS_MSG_INFO msg={(0xa77+520-0xc7f)};CHAR smsNumber[
+(0x55f+4296-0x15f5)]={(0xb36+726-0xe0c)};sc_cfg_get(NV_TRAFFIC_SMS_NUMBER,
+smsNumber,sizeof(smsNumber));at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x74\x44\x62\x53\x74\x6f\x72\x65\x44\x61\x74\x61\x2e\x6e\x75\x6d\x62\x65\x72\x20\x3d\x20\x25\x73\x2c\x20\x74\x72\x61\x66\x66\x69\x63\x5f\x73\x6d\x73\x5f\x6e\x75\x6d\x62\x65\x72\x20\x3d\x20\x25\x73" "\n"
+,data->number,smsNumber);if((0x4e3+3708-0x135f)==strcmp(smsNumber,data->number))
+{if((0xa9a+6219-0x22e5)!=zUfiSms_CheckIfWholeSms(data,&msg)){at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x2c\x20\x72\x65\x63\x76\x20\x73\x6d\x73\x2c\x20\x62\x75\x74\x20\x6e\x6f\x74\x20\x77\x68\x6f\x6c\x65\x20\x73\x6d\x73\x2c\x20\x77\x61\x69\x74\x20\x74\x6f\x20\x72\x65\x63\x76\x20\x6e\x65\x78\x74\x20\x73\x65\x67" "\n"
+);return;}sc_cfg_set(NV_TRAFFIC_RECV_SMS_ID,msg.id);sc_cfg_set(
+NV_TRAFFIC_SMS_NUMBER,"\x30");at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x5b\x74\x72\x61\x66\x66\x69\x63\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x48\x61\x6e\x64\x6c\x65\x54\x72\x61\x66\x66\x69\x63\x53\x6d\x73\x20\x20\x20\x74\x72\x61\x66\x66\x69\x63\x5f\x72\x65\x63\x76\x5f\x73\x6d\x73\x5f\x69\x64\x20\x3d\x20\x25\x73" "\n"
+,msg.id);}}void zUfiSms_CmtRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType 
+iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
+(0xeef+2228-0x17a3)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
+(0x1781+1027-0x1b84);SMS_PARAM one_sms={(0x176b+2186-0x1ff5)};int 
+unread_sms_before_recv_new_sms=(0x8ab+123-0x926);memset(&tDbStoreData,
+(0x1497+3887-0x23c6),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
+,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);if(
+strcmp(ptRespData->pdu,"")==(0x48a+576-0x6ca)){CHAR srState[(0x358+391-0x4ad)]={
+(0xa85+1245-0xf62)};sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if(
+(0x1667+1461-0x1c1c)!=strcmp(srState,
+"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
+NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
+;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
+return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
+"\x5b\x73\x6d\x73\x5d\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
+,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
+strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0x2413+502-0x2609));}if(
+SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
+,one_sms.index);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);
+zUfiSms_Ack_new_msg(TRUE);return;}zUfiSms_GetReportStatus(ptRespData->pdu,&
+ptRespData->stat);(void)String2Bytes(ptRespData->pdu,acFormatPdu,(int)strlen(
+ptRespData->pdu));if((0xfd9+1406-0x1552)==ptRespData->stat){(void)
+zUfiSms_HandleReport(acFormatPdu);sc_cfg_set(NV_SR_STATE,
+"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");zUfiSms_Ack_new_msg(TRUE);return
+;}(void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->index,iStorePos,(
+T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,ptRespData->length,
+acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){iStorePos=
+WMS_STORAGE_TYPE_UIM_V01;}if(zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){
+unread_sms_before_recv_new_sms=(0x131d+1448-0x18c4);}else{
+unread_sms_before_recv_new_sms=(0x39c+2825-0xea5);}zUfiSms_TrafficChangeSmsTag(&
+tDbStoreData);if(ZTE_WMS_NV_MEMORY_FULL==zUfiSms_WriteSmsToDb(&tDbStoreData,
+iStorePos,-(0x1a58+1345-0x1f98))){zUfiSms_Ack_new_msg(FALSE);zSms_SendZmenaReq(
+(0x16f4+787-0x1a06));return;}if(tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){
+zUfiSms_Ack_new_msg(TRUE);}zUfiSms_CmgrNvSet();zUfiSms_CheckMemoryFull(
+ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(SMS_STATE_RECVED);
+zUfiSms_SendSmsStatusInfo(MSG_SMS_NEW);zUfiSms_HandleTrafficSms(&tDbStoreData);
+return;}void zUfiSms_ZmgrRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType 
+iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
+(0x19b6+1348-0x1efa)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
+(0x2f9+4293-0x13be);SMS_PARAM one_sms={(0xb03+5728-0x2163)};CHAR defaultStore[
+(0x1154+5303-0x25d9)]={(0x1c2+572-0x3fe)};memset(&tDbStoreData,
+(0x3bd+4483-0x1540),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
+,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);if(
+strcmp(ptRespData->pdu,"")==(0xa8b+6603-0x2456)){CHAR srState[
+(0x16ac+918-0x1a10)]={(0x607+2098-0xe39)};sc_cfg_get(NV_SR_STATE,srState,sizeof(
+srState));if((0xdb4+4069-0x1d99)!=strcmp(srState,
+"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
+NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
+;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
+return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
+"\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
+,isPushSms);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x25\x64\x20" "\n"
+,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
+strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0xb0a+6584-0x24c2));}if(
+SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
+,one_sms.index);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);return;}
+zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)String2Bytes(
+ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
+(0x1208+4515-0x23a6)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
+sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");return;}
+sc_cfg_get(NV_DEFAULT_STORE,defaultStore,sizeof(defaultStore));if(
+(0x62+2104-0x89a)==strcmp(defaultStore,"\x73\x69\x6d")){iStorePos=
+WMS_STORAGE_TYPE_UIM_V01;}(void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->
+index,iStorePos,(T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,
+ptRespData->length,acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){
+iStorePos=WMS_STORAGE_TYPE_UIM_V01;}zUfiSms_TrafficChangeSmsTag(&tDbStoreData);
+if(ZTE_WMS_NV_MEMORY_FULL==zUfiSms_WriteSmsToDb(&tDbStoreData,iStorePos,-
+(0x297+4578-0x1478))){return;}if(tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){}
+zUfiSms_CmgrNvSet();zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);
+zUfiSms_ChangeMainState(SMS_STATE_RECVED);zUfiSms_HandleTrafficSms(&tDbStoreData
+);return;}void zUfiSms_CmgrRespProc(T_zSms_SmsInd*ptRespData){zUfiSms_StoreType 
+iStorePos=WMS_STORAGE_TYPE_NV_V01;unsigned char acFormatPdu[ZSMS_PDU_SIZE]={
+(0x8b7+7273-0x2520)};T_zUfiSms_DbStoreData tDbStoreData;int isPushSms=
+(0x54a+8076-0x24d6);SMS_PARAM one_sms={(0x125b+1354-0x17a5)};int 
+unread_sms_before_recv_new_sms=(0x4aa+5375-0x19a9);memset(&tDbStoreData,
+(0xda9+3736-0x1c41),sizeof(T_zUfiSms_DbStoreData));at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x45\x6e\x74\x65\x72\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2f\x70\x64\x75\x3a\x25\x73\x21" "\n"
+,ptRespData->index,ptRespData->stat,ptRespData->length,ptRespData->pdu);
+zUfiSms_SendSmsStatusInfo(MSG_SMS_READING);if(strcmp(ptRespData->pdu,"")==
+(0x1001+3027-0x1bd4)){CHAR srState[(0x21cf+916-0x2531)]={(0x1840+2664-0x22a8)};
+sc_cfg_get(NV_SR_STATE,srState,sizeof(srState));if((0x696+1415-0xc1d)!=strcmp(
+srState,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x69\x6e\x67")){sc_cfg_set(
+NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(SMS_STATE_RECVED)
+;}else{sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");}
+return;}isPushSms=DecodePushPdu(ptRespData->pdu,&one_sms);at_print(LOG_DEBUG,
+"\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x20\x25\x64" "\n"
+,isPushSms);at_print(LOG_DEBUG,
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x43\x6d\x67\x72\x52\x65\x73\x70\x50\x72\x6f\x63\x20\x69\x73\x50\x75\x73\x68\x53\x6d\x73\x20\x3d\x25\x64\x20" "\n"
+,isPushSms);if(SMS_NOTIFICATION==isPushSms){BakNotificationSms(one_sms.TP_UD,
+strlen(one_sms.TP_UD));zte_fota_notifyPushMsg((0x301+6959-0x1e30));}if(
+SMS_NO_PUSH!=isPushSms){at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x69\x6e\x64\x65\x78\x20\x3d\x20\x25\x64" "\n"
+,one_sms.index);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x52\x65\x66\x65\x72\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_ReferNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x41\x6c\x6c\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_AllPieceNum);at_print(LOG_DEBUG,
+"\x20\x6f\x6e\x65\x5f\x73\x6d\x73\x2e\x54\x50\x5f\x43\x75\x72\x72\x65\x6e\x74\x50\x69\x65\x63\x65\x4e\x75\x6d\x20\x3d\x20\x25\x64" "\n"
+,one_sms.TP_CurrentPieceNum);zUfiSms_ChangeMainState(SMS_STATE_RECVED);return;}
+zUfiSms_GetReportStatus(ptRespData->pdu,&ptRespData->stat);(void)String2Bytes(
+ptRespData->pdu,acFormatPdu,(int)strlen(ptRespData->pdu));if(
+(0x135f+3869-0x2277)==ptRespData->stat){(void)zUfiSms_HandleReport(acFormatPdu);
+sc_cfg_set(NV_SR_STATE,"\x73\x72\x5f\x72\x65\x63\x65\x69\x76\x65\x64");return;}(
+void)zUfiSms_DecodeSmsData(&tDbStoreData,ptRespData->index,iStorePos,(
+T_SmsStatus)ptRespData->stat,WMS_MESSAGE_FORMAT_GW_PP_V01,ptRespData->length,
+acFormatPdu);if(tDbStoreData.sms_class==WMS_MESSAGE_CLASS_2){iStorePos=
+WMS_STORAGE_TYPE_UIM_V01;}if(zUfiSms_IsUnreadSms(ZTE_WMS_MEMORY_NV)){
+unread_sms_before_recv_new_sms=(0xf71+5803-0x261b);}else{
+unread_sms_before_recv_new_sms=(0xd67+1763-0x144a);}if(ZTE_WMS_NV_MEMORY_FULL==
+zUfiSms_WriteSmsToDb(&tDbStoreData,iStorePos,-(0xc16+328-0xd5d))){return;}if(
+tDbStoreData.sms_class!=WMS_MESSAGE_CLASS_2){}zUfiSms_CmgrNvSet();
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);zUfiSms_ChangeMainState(
+SMS_STATE_RECVED);return;}void zUfiSms_CmgsRespProc(VOID){T_zUfiSms_StatusInfo 
+tStatusInfo={(0x700+2008-0xed8)};g_zUfiSms_DbStoreData->msg_displaymode=
+g_displaymode;if(g_zUfiSms_DbStoreData->msg_displaymode!=(0x1bbc+2507-0x2586)){
+if((0x1bd4+1105-0x2025)==zUfiSms_WriteSmsToDb(&g_zUfiSms_DbStoreData[
+g_zUfiSms_CurConcatSegNo-(0x35f+2529-0xd3f)],WMS_STORAGE_TYPE_NV_V01,-
+(0x183+1522-0x774))){g_zUfiSms_MsgRefer++;(void)zUfiSms_SetMaxReference(
+g_zUfiSms_MsgRefer);}}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x73\x52\x73\x70\x20\x73\x65\x67\x4e\x6f\x3a\x25\x64\x2f\x54\x6f\x74\x61\x6c\x4e\x75\x6d\x3a\x25\x64\x2f\x46\x61\x69\x6c\x4e\x75\x6d\x3a\x25\x64\x2e" "\n"
+,g_zUfiSms_CurConcatSegNo,g_zUfiSms_ConcatTotalNum,g_zUfiSms_SendFailedCount);if
+(g_zUfiSms_CurConcatSegNo==g_zUfiSms_ConcatTotalNum){g_zUfiSms_CurConcatSegNo=
+(0x362+8307-0x23d5);memset((void*)&tStatusInfo,(0x183+5112-0x157b),sizeof(
+T_zUfiSms_StatusInfo));tStatusInfo.err_code=ZTE_SMS_CMS_NONE;tStatusInfo.
+send_failed_count=g_zUfiSms_SendFailedCount;tStatusInfo.delete_failed_count=
+(0x866+7294-0x24e4);if(g_zUfiSms_SendFailedCount==(0xa62+1848-0x119a)){
+tStatusInfo.cmd_status=WMS_CMD_SUCCESS;sc_cfg_set(NV_SMS_SEND_RESULT,"\x6f\x6b")
+;}else{tStatusInfo.cmd_status=WMS_CMD_FAILED;sc_cfg_set(NV_SMS_SEND_RESULT,
+"\x66\x61\x69\x6c");}tStatusInfo.cmd=WMS_SMS_CMD_MSG_SEND;(void)
+zUfiSms_SetCmdStatus(&tStatusInfo);sc_cfg_set(NV_SMS_DB_CHANGE,"\x31");
+zUfiSms_CheckMemoryFull(ZTE_WMS_MEMORY_NV);if(g_zUfiSms_MemFullFlag[
+WMS_STORAGE_TYPE_NV_V01]){zUfiSms_SendSmsStatusInfo(MSG_SMS_DEFAULT);}}else{}}
+int zte_fota_notifyPushMsg(int cmd){FOTA_MSG_BUF msg={(0x8f+7512-0x1de7)};int 
+errs=(0x5a0+6377-0x1e89);key_t req_id=ftok(
+"\x2f\x6d\x65\x64\x69\x61\x2f\x7a\x74\x65\x2f\x7a\x74\x65\x5f\x73\x6f\x63\x6b\x65\x74\x2f\x66\x6f\x74\x61\x5f\x64\x6d\x61\x70\x70\x5f\x6d\x73\x67"
+,(0x138f+1262-0x187c));int msgid=msgget(req_id,(0x205+558-0x433));if(msgid!=-
+(0x334+1294-0x841)){msg.mtype=(0x6c3+245-0x7b7);msg.mtext[(0x1a46+1438-0x1fe4)]=
+WEBUI_NOTIFY_PUSH_MSG_;errs=msgsnd(msgid,&msg,sizeof(msg)-sizeof(long),
+(0x42a+6169-0x1c43));}return(errs<(0x505+8564-0x2679)?(0x13c8+4378-0x24e2):
+(0x556+5523-0x1ae8));}
+#if (0x979+7072-0x2519)  
+int atSms_SendCmglReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){return 
+zSvr_SendAtSyn(ZAT_CMGL_CMD,"\x41\x54\x2b\x43\x4d\x47\x4c\x3d\x30" "\r\n",cid,
+pAtRst,atRstSize);}VOID atSms_RecvCmglRsp(T_zAt_AtRes*pResLine){return;}
+#endif 

+#if (0x1aa5+1940-0x2239) 
+int atSms_SendZmglReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){int res
+=(0x9cf+952-0xd87);pthread_mutex_lock(&smsdb_mutex);res=zSvr_SendAtSyn(
+ZAT_ZMGL_CMD,"\x41\x54\x2b\x5a\x4d\x47\x4c\x3d\x34" "\r\n",cid,pAtRst,atRstSize)
+;pthread_mutex_unlock(&smsdb_mutex);return res;}VOID atSms_initAtOk(VOID){
+T_zUfiSms_StatusInfo tStatus={(0x374+3933-0x12d1)};sc_cfg_set(NV_SMS_LOAD_RESULT
+,"\x6f\x6b");tStatus.cmd_status=WMS_CMD_SUCCESS;tStatus.cmd=WMS_SMS_CMD_INIT;(
+void)zUfiSms_SetCmdStatus(&tStatus);zUfiSms_ChangeMainState(SMS_STATE_LOADED);}
+int atSms_initAtErr(UINT8*pErrCode){T_zUfiSms_StatusInfo tStatus={
+(0xec4+2318-0x17d2)};sc_cfg_set(NV_SMS_LOAD_RESULT,"\x66\x61\x69\x6c");
+zUfiSms_ChangeMainState(SMS_STATE_LOADED);tStatus.cmd_status=WMS_CMD_FAILED;
+tStatus.cmd=WMS_SMS_CMD_INIT;(void)zUfiSms_SetCmdStatus(&tStatus);return FALSE;}
+VOID atSms_RecvZmglRsp(T_zAt_AtRes*pResLine){static T_zUfiSms_SmsItem tSmsPara={
+(0x157f+1247-0x1a5e)};printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x6c\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
+,pResLine->pduFlag,pResLine->result);if(pResLine->pduFlag==ZAT_ATRES_PDU_FLAG){
+zUfiSms_CmglRespProc(pResLine,&tSmsPara);}else{memset(&tSmsPara,
+(0x10e5+5423-0x2614),sizeof(T_zUfiSms_SmsItem));(void)zUfiSms_FormatSms(pResLine
+->resParas,sizeof(pResLine->resParas),&tSmsPara,(0x9a5+4514-0x1b46));printf(
+"\x5b\x53\x4d\x53\x5d\x20\x5a\x6d\x67\x6c\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
+,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}}int atSms_SendCmgrReq(PSTR 
+pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x443+8871-0x26d6)
+]={(0xd5d+4902-0x2083)};iSmsIndex=atoi(pAtCmdPara);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x72\x52\x65\x71\x20\x47\x65\x74\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2e" "\n"
+,iSmsIndex);snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x43\x4d\x47\x52\x3d\x25\x73" "\r\n",pAtCmdPara);return 
+zSvr_SendAtSyn(ZAT_CMGR_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID 
+atSms_RecvCmgrRsp(T_zAt_AtRes*pResLine){
+#if (0x917+2861-0x1444)

+static T_zUfiSms_SmsItem tSmsPara={(0x172b+1529-0x1d24)};T_zUfiSms_CmgrSetRsp 
+tCmgrRsp={(0x150c+400-0x169c)};printf(
+"\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x72\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
+,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
+ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
+"\x21\x21\x21\x21\x21\x21\x21\x21\x21\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x67\x72\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
+);return;}tCmgrRsp.index=tSmsPara.index;tCmgrRsp.length=tSmsPara.length;tCmgrRsp
+.stat=tSmsPara.stat;sscanf(pResLine->resParas,"\x25\x35\x30\x30\x73",tCmgrRsp.
+pdu);zUfiSms_CmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();sc_cfg_set(
+"\x73\x6d\x73\x5f\x72\x65\x63\x76\x5f\x72\x65\x73\x75\x6c\x74","\x6f\x6b");}else
+{memset(&tSmsPara,(0x1307+4716-0x2573),sizeof(T_zUfiSms_SmsItem));(void)
+zUfiSms_FormatSms(pResLine->resParas,&tSmsPara,(0x733+6534-0x20b7));tSmsPara.
+index=iSmsIndex;printf(
+"\x3d\x3d\x3d\x3d\x3d\x3d\x43\x6d\x67\x72\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
+,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}
+#endif

+}int atSms_SendZmgrReq(PSTR pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR 
+pAtcmdStr[(0x12ec+4760-0x2570)]={(0x1e5a+1155-0x22dd)};iSmsIndex=atoi(pAtCmdPara
+);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x5a\x6d\x67\x72\x52\x65\x71\x20\x47\x65\x74\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2e" "\n"
+,iSmsIndex);snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x5a\x4d\x47\x52\x3d\x25\x73" "\r\n",pAtCmdPara);return 
+zSvr_SendAtSyn(ZAT_ZMGR_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID 
+atSms_RecvZmgrOk(T_zAt_AtRes*pResLine,UINT8*nextAt){return;}VOID 
+atSms_RecvZmgrErr(T_zAt_AtRes*pResLine,UINT8*nextAt){at_print(LOG_DEBUG,
+"\x53\x4d\x53\x20\x7a\x6d\x67\x72\x20\x69\x73\x20\x66\x61\x69\x6c" "\n");
+at_print(LOG_DEBUG
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x45\x72\x72\x20\x20\x53\x4d\x53\x20\x7a\x6d\x67\x72\x20\x69\x73\x20\x66\x61\x69\x6c" "\n"
+);{sc_cfg_set(NV_SMS_RECV_RESULT,"\x66\x61\x69\x6c");zUfiSms_ChangeMainState(
+SMS_STATE_RECVED);}}VOID atSms_RecvZmgrRsp(T_zAt_AtRes*pResLine){static 
+T_zUfiSms_SmsItem tSmsPara={(0x753+3546-0x152d)};T_zUfiSms_CmgrSetRsp tCmgrRsp={
+(0x1ef3+1207-0x23aa)};printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
+,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
+ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x5a\x6d\x67\x72\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
+);return;}tCmgrRsp.index=tSmsPara.index;tCmgrRsp.length=tSmsPara.length;tCmgrRsp
+.stat=tSmsPara.stat;sscanf(pResLine->resParas,"\x25\x35\x30\x30\x73",tCmgrRsp.
+pdu);zUfiSms_ZmgrRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();sc_cfg_set(
+NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,(0x164+6948-0x1c88),sizeof
+(T_zUfiSms_SmsItem));(void)zUfiSms_FormatSms(pResLine->resParas,sizeof(pResLine
+->resParas),&tSmsPara,(0x1d1b+2531-0x26fc));tSmsPara.index=iSmsIndex;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x5a\x6d\x67\x72\x20\x52\x65\x73\x70\x21\x20\x69\x6e\x64\x65\x78\x3a\x25\x64\x2f\x73\x74\x61\x74\x3a\x25\x64\x2f\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
+,tSmsPara.index,tSmsPara.stat,tSmsPara.length);}}int atSms_SendCmgdReq(PSTR 
+pAtCmdPara,int cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x27d+4796-0x1525)
+]={(0x97d+1670-0x1003)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x43\x4d\x47\x44\x3d\x25\x73" "\r\n",pAtCmdPara);return 
+zSvr_SendAtSyn(ZAT_CMGD_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID 
+atSms_RecvCmgdOk(VOID){CHAR strUsed[(0x1690+1574-0x1cac)]={(0x913+4519-0x1aba)};
+int used=(0x1bd3+2499-0x2596);sc_cfg_set(NV_SMS_DEL_RESULT,"\x6f\x6b");printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x4f\x4b\x2e\x20" "\n"
+);sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi(
+strUsed)-(0x9c0+3095-0x15d6);if(used<(0x1763+1318-0x1c89)){used=
+(0x114c+1414-0x16d2);}memset(&strUsed,(0x7c+677-0x321),(0x152f+1998-0x1cf3));
+snprintf(strUsed,sizeof(strUsed),"\x25\x64",used);sc_cfg_set(
+ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed);}VOID atSms_RecvCmgdErr(VOID){sc_cfg_set
+(NV_SMS_DEL_RESULT,"\x66\x61\x69\x6c");printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x74\x20\x73\x69\x6d\x5f\x64\x65\x6c\x5f\x72\x65\x73\x75\x6c\x74\x20\x74\x6f\x20\x66\x61\x69\x6c\x2e\x20" "\n"
+);}VOID atSms_RecvCmgdFinish(VOID){char StrValue[(0x206f+386-0x21e7)]={
+(0xacb+3889-0x19fc)};CHAR strTotal[(0x156b+799-0x1880)]={(0x192c+1325-0x1e59)};
+CHAR strUsed[(0xa58+4353-0x1b4f)]={(0x34c+8283-0x23a7)};int total=
+(0x1064+5727-0x26c3);int used=(0xe0d+3097-0x1a26);int remain=(0x430+258-0x532);
+sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_USED,strUsed,sizeof(strUsed));used=atoi(
+strUsed);sc_cfg_get(ZTE_WMS_NVCONFIG_SIM_CARD_TOTAL,strTotal,sizeof(strTotal));
+total=atoi(strTotal);remain=total-used;if(remain<(0xa0+7377-0x1d71)){remain=
+(0xf35+1527-0x152c);}memset(&StrValue,(0x1482+3767-0x2339),(0x4c+8372-0x20f6));
+snprintf(StrValue,sizeof(StrValue),"\x25\x64",remain);sc_cfg_set(
+ZTE_WMS_NVCONFIG_SIM_CARD_REMAIN,StrValue);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x7a\x55\x66\x69\x53\x6d\x73\x5f\x44\x65\x6c\x65\x74\x65\x53\x69\x6d\x53\x6d\x73\x20\x75\x73\x65\x64\x3d\x25\x64\x2c\x72\x65\x6d\x61\x69\x6e\x3d\x25\x64\x2c\x74\x6f\x74\x61\x6c\x3d\x25\x64" "\n"
+,used,remain,total);zUfiSms_ChangeMainState(SMS_STATE_DELED);sc_cfg_set(
+NV_SMS_DB_CHANGE,"\x31");}int atSms_SendCmgsReq(PSTR pAtCmdPara,int cid,PSTR 
+pAtRst,int atRstSize){int atRes=(0xe4b+3483-0x1be6);CHAR pAtcmdStr[ZSMS_PDU_SIZE
+]={(0xba+3074-0xcbc)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x43\x4d\x47\x53\x3d\x25\x64" "\r\n",g_zUfiSms_FinalCmgsBuf.length)
+;atRes=zSvr_SendAtSyn(ZAT_CMGS_CMD,pAtcmdStr,cid,pAtRst,atRstSize);if(atRes!=
+ZAT_RESULT_SMS){return atRes;}memset(pAtcmdStr,(0x190c+644-0x1b90),ZSMS_PDU_SIZE
+);if(strlen(g_zUfiSms_FinalCmgsBuf.pdu)<ZSMS_PDU_SIZE-(0x12dc+1160-0x1763)){
+memcpy(pAtcmdStr,g_zUfiSms_FinalCmgsBuf.pdu,strlen(g_zUfiSms_FinalCmgsBuf.pdu));
+}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
+,g_zUfiSms_FinalCmgsBuf.pdu);memcpy(pAtcmdStr,g_zUfiSms_FinalCmgsBuf.pdu,
+ZSMS_PDU_SIZE-(0x610+601-0x867));}*(pAtcmdStr+strlen(g_zUfiSms_FinalCmgsBuf.pdu)
+)=ZSMS_CTRL_Z_CHAR;memset(pAtRst,(0xb7+1731-0x77a),atRstSize);return 
+zSvr_SendAtSyn(ZAT_CMGS_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID 
+atSms_RecvCmgsOk(UINT8*pResLine,int cid){at_print(LOG_DEBUG,
+"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x73\x75\x63\x63\x65\x73\x73\x2e\x20" "\n"
+);g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
+ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_DbStoreData[
+g_zUfiSms_CurConcatSegNo-(0x17d+9261-0x25a9)].tag=WMS_TAG_TYPE_MO_SENT_V01;
+zUfiSms_CmgsRespProc(cid);}VOID atSms_RecvCmgsErr(UINT8*pResLine,int cid){
+at_print(LOG_DEBUG,
+"\x73\x6d\x73\x20\x73\x65\x6e\x64\x65\x64\x20\x66\x61\x69\x6c\x2e\x20" "\n");
+g_zUfiSms_CurConcatSegNo++;if(g_zUfiSms_CurConcatSegNo>
+ZTE_WMS_CONCAT_SMS_COUNT_MAX){return;}g_zUfiSms_SendFailedCount++;at_print(
+LOG_DEBUG,
+"\x73\x65\x6e\x64\x20\x73\x6d\x73\x20\x66\x61\x69\x6c\x65\x64\x2c\x73\x6f\x20\x77\x72\x69\x74\x65\x20\x73\x6d\x73\x20\x74\x6f\x20\x64\x72\x61\x66\x74\x62\x6f\x78\x2e" "\n"
+);g_zUfiSms_DbStoreData[g_zUfiSms_CurConcatSegNo-(0x5bc+3822-0x14a9)].tag=
+WMS_TAG_TYPE_MO_NOT_SENT_V01;if(g_zUfiSms_ConcatTotalNum>(0x1198+3115-0x1dc2)){
+g_zUfiSms_IsConcatSendSuc=FALSE;}zUfiSms_CmgsRespProc(cid);}VOID 
+atSms_RecvCmgsRsp(T_zAt_AtRes*pResLine){return;}VOID atSms_RecvCmtRsp(
+T_zAt_AtRes*pResLine){CHAR needSMS[(0x10b5+773-0x1388)]={(0x209+3612-0x1025)};
+sc_cfg_get(NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0xe41+3041-0x1a22)==
+strcmp(needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}static T_zUfiSms_SmsItem tSmsPara={(0x19d9+2833-0x24ea)};
+T_zUfiSms_CmtSetRsp tCmtRsp={(0xab0+4246-0x1b46)};if(NULL==pResLine){return;}
+printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x45\x6e\x74\x65\x72\x20\x70\x64\x75\x46\x6c\x61\x67\x3a\x25\x64\x2f\x50\x61\x72\x61\x73\x3a\x25\x73\x2f\x72\x65\x73\x75\x6c\x74\x3a\x25\x64\x2e" "\n"
+,pResLine->pduFlag,pResLine->resParas,pResLine->result);if(pResLine->pduFlag==
+ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->result){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
+);return;}tCmtRsp.length=tSmsPara.length;sscanf(pResLine->resParas,
+"\x25\x35\x30\x30\x73",tCmtRsp.pdu);pthread_mutex_lock(&smsdb_mutex);
+zUfiSms_CmtRespProc(&tCmtRsp);zUfiMmi_SendSmsStatus();pthread_mutex_unlock(&
+smsdb_mutex);sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,
+(0xb79+3209-0x1802),sizeof(T_zUfiSms_SmsItem));atBase_PreProcRes(pResLine->
+resParas,sizeof(pResLine->resParas));printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x21\x20\x70\x52\x65\x73\x4c\x69\x6e\x65\x2d\x3e\x72\x65\x73\x50\x61\x72\x61\x73\x3a\x25\x73\x2e" "\n"
+,pResLine->resParas);sscanf(pResLine->resParas,"\x25\x73\x20\x25\x64",tSmsPara.
+alpha,&tSmsPara.length);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x6d\x74\x20\x69\x6e\x64\x21\x20\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
+,tSmsPara.length);}}VOID atSms_RecvCmtiRsp(T_zAt_AtRes*pResLine){CHAR needSMS[
+(0x3a+4255-0x10a7)]={(0x1997+2178-0x2219)};sc_cfg_get(NV_NEED_SUPPORT_SMS,
+needSMS,sizeof(needSMS));if((0x1f9+9003-0x2524)==strcmp(needSMS,"\x6e\x6f")){
+printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}char sms_Main_state[(0xe6f+3877-0x1d76)]={(0x12b9+2632-0x1d01)};char*
+memory=NULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x20\x65\x6e\x74\x65\x72\x20\x25\x73\x2e" "\n"
+,pResLine->resParas);if(NULL==pResLine){return;}if(ZAT_CMTI_CMD!=pResLine->
+atCmdId){return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));
+if(strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
+(0x1246+1277-0x1743)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
+);return;}memory=strstr(pResLine->resParas,"\"");if(NULL!=memory){memory++;}if(
+(0x7+3385-0xd40)==strncmp("\x53\x4d",memory,(0x14e2+4183-0x2537))){
+zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);zUfiSms_ChangeMainState(
+SMS_STATE_RECVING);memory+=(0x682+7316-0x2312);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x6e\x64\x20\x63\x6d\x67\x72\x3a\x20\x25\x73" "\n"
+,memory);zSvr_InnerSendMsg(ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,
+MSG_CMD_AT_ZMGR,strlen(memory),memory);}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
+);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}VOID atSms_RecvCdsRsp(T_zAt_AtRes*pResLine
+){CHAR needSMS[(0x1429+2746-0x1eb1)]={(0x519+4865-0x181a)};sc_cfg_get(
+NV_NEED_SUPPORT_SMS,needSMS,sizeof(needSMS));if((0x1537+3158-0x218d)==strcmp(
+needSMS,"\x6e\x6f")){printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}static T_zUfiSms_SmsItem tSmsPara={(0x1867+1625-0x1ec0)};
+T_zUfiSms_CmgrSetRsp tCmgrRsp={(0x276+5695-0x18b5)};if(NULL==pResLine){return;}
+if(pResLine->pduFlag==ZAT_ATRES_PDU_FLAG){if(ZAT_RESULT_AUTOREPORT!=pResLine->
+result){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x52\x73\x70\x20\x67\x65\x74\x20\x72\x65\x73\x75\x6c\x74\x20\x45\x72\x72\x6f\x72\x2e" "\n"
+);return;}tCmgrRsp.length=tSmsPara.length;sscanf(pResLine->resParas,
+"\x25\x35\x30\x30\x73",tCmgrRsp.pdu);pthread_mutex_lock(&smsdb_mutex);
+zUfiSms_CdsRespProc(&tCmgrRsp);zUfiMmi_SendSmsStatus();pthread_mutex_unlock(&
+smsdb_mutex);sc_cfg_set(NV_SMS_RECV_RESULT,"\x6f\x6b");}else{memset(&tSmsPara,
+(0x1472+4760-0x270a),sizeof(T_zUfiSms_SmsItem));atBase_PreProcRes(pResLine->
+resParas,sizeof(pResLine->resParas));printf(
+"\x5b\x53\x4d\x53\x5d\x20\x63\x64\x73\x20\x69\x6e\x64\x21\x20\x70\x52\x65\x73\x4c\x69\x6e\x65\x2d\x3e\x72\x65\x73\x50\x61\x72\x61\x73\x3a\x25\x73\x2e" "\n"
+,pResLine->resParas);sscanf(pResLine->resParas,"\x25\x73\x20\x25\x64",tSmsPara.
+alpha,&tSmsPara.length);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x52\x73\x70\x20\x63\x64\x73\x20\x69\x6e\x64\x21\x20\x6c\x65\x6e\x67\x74\x68\x3a\x25\x64\x2e" "\n"
+,tSmsPara.length);}}VOID atSms_RecvCdsiRsp(T_zAt_AtRes*pResLine){CHAR needSMS[
+(0x1fdf+312-0x20e5)]={(0x14b8+3005-0x2075)};sc_cfg_get(NV_NEED_SUPPORT_SMS,
+needSMS,sizeof(needSMS));if((0x506+2099-0xd39)==strcmp(needSMS,"\x6e\x6f")){
+printf(
+"\x5b\x53\x4d\x53\x5d\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x6d\x74\x52\x73\x70\x20\x6e\x65\x65\x64\x53\x4d\x53\x3d\x6e\x6f\x21"
+);return;}char sms_Main_state[(0x1419+153-0x1494)]={(0x182b+2074-0x2045)};char*
+memory=NULL;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x20\x65\x6e\x74\x65\x72\x20\x25\x73\x2e" "\n"
+,pResLine->resParas);if(NULL==pResLine){return;}if(ZAT_CDSI_CMD!=pResLine->
+atCmdId){return;}sc_cfg_get(NV_SMS_STATE,sms_Main_state,sizeof(sms_Main_state));
+if(strcmp(sms_Main_state,"\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67")==
+(0xb88+3843-0x1a8b)){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x3a\x20\x73\x6d\x73\x5f\x64\x65\x6c\x69\x6e\x67" "\n"
+);return;}memory=strstr(pResLine->resParas,"\"");if(NULL!=memory){memory++;}
+printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x3a\x20\x6d\x65\x6d\x6f\x72\x79\x20\x3d\x20\x25\x73" "\n"
+,memory);if((0x672+5749-0x1ce7)==strncmp("\x53\x4d",memory,(0x2400+403-0x2591)))
+{zUfiSms_SetSmsLocation(SMS_LOCATION_SIM);zUfiSms_ChangeMainState(
+SMS_STATE_RECVING);memory+=(0x18d4+1384-0x1e38);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x73\x65\x6e\x64\x20\x63\x6d\x67\x72\x3a\x20\x25\x73" "\n"
+,memory);zSvr_InnerSendMsg(ZUFI_MODULE_ID_AT_LOCAL,ZUFI_MODULE_ID_AT_UNSOLI,
+MSG_CMD_AT_ZMGR,strlen(memory),memory);}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x52\x65\x63\x76\x43\x64\x73\x69\x52\x73\x70\x20\x3a\x73\x74\x6f\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x6e\x6f\x74\x20\x53\x4d\x2e" "\n"
+);}sc_cfg_set(NV_SMS_RECV_RESULT,"");}int atSms_SendZmenaReq(PSTR pAtCmdPara,int
+ cid,PSTR pAtRst,int atRstSize){CHAR pAtcmdStr[(0x10fc+656-0x1378)]={
+(0xe0f+5854-0x24ed)};snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x5a\x4d\x45\x4e\x41\x3d\x25\x73" "\r\n",pAtCmdPara);return 
+zSvr_SendAtSyn(ZAT_ZMENA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}VOID 
+atSms_RecvZmenaOk(VOID){g_Zmena_rsp=TRUE;return;}VOID atSms_RecvZmenaErr(VOID){
+g_Zmena_rsp=FALSE;return;}int atSms_SendCnmaReq(PSTR pAtCmdPara,int cid,PSTR 
+pAtRst,int atRstSize){int atRes=(0x68a+4025-0x1643);CHAR pAtcmdStr[ZSMS_PDU_SIZE
+]={(0x7f2+1008-0xbe2)};CHAR ackPduStr[(0x172c+1885-0x1e57)]={(0x3c3+4472-0x153b)
+};if(atoi(pAtCmdPara)==(0x6e9+7538-0x245a)){snprintf(pAtcmdStr,sizeof(pAtcmdStr)
+,"\x41\x54\x2b\x43\x4e\x4d\x41\x3d\x25\x73" "\r\n",pAtCmdPara);atRes=
+zSvr_SendAtSyn(ZAT_CNMA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x31\x31\x31\x31\x31\x31\x20\x61\x63\x6b\x20\x6f\x6b\x20\x3d\x20\x25\x73\x2e" "\n"
+,pAtcmdStr);return(0xd2a+4658-0x1f5c);}else{zUfiSms_EncodePdu_DeliverReport(
+ackPduStr,(0xcef+5558-0x21d2));snprintf(pAtcmdStr,sizeof(pAtcmdStr),
+"\x41\x54\x2b\x43\x4e\x4d\x41\x3d\x25\x73\x2c\x25\x64" "\r\n",pAtCmdPara,strlen(
+ackPduStr)/(0xe50+3389-0x1b8b));atRes=zSvr_SendAtSyn(ZAT_CNMA_CMD,pAtcmdStr,cid,
+pAtRst,atRstSize);if(atRes!=ZAT_RESULT_SMS){return atRes;}printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x20\x3d\x20\x25\x73\x2e" "\n"
+,pAtcmdStr);memset(pAtcmdStr,(0x412+1275-0x90d),ZSMS_PDU_SIZE);if(strlen(
+ackPduStr)<ZSMS_PDU_SIZE-(0x353+5295-0x1801)){memcpy(pAtcmdStr,ackPduStr,strlen(
+ackPduStr));}else{printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6d\x67\x73\x52\x65\x71\x20\x70\x64\x75\x20\x74\x6f\x6f\x20\x6c\x6f\x6e\x67\x3a\x25\x73" "\n"
+,ackPduStr);memcpy(pAtcmdStr,ackPduStr,ZSMS_PDU_SIZE-(0xe0b+1562-0x1423));}*(
+pAtcmdStr+strlen(ackPduStr))=ZSMS_CTRL_Z_CHAR;printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x53\x6d\x73\x5f\x53\x65\x6e\x64\x43\x6e\x6d\x61\x52\x65\x71\x2e\x20\x70\x64\x75\x3d\x20\x25\x73" "\n"
+,pAtcmdStr);memset(pAtRst,(0x6aa+8231-0x26d1),atRstSize);return zSvr_SendAtSyn(
+ZAT_CNMA_CMD,pAtcmdStr,cid,pAtRst,atRstSize);}}VOID atSms_RecvCnmaRsp(
+T_zAt_AtRes*pResLine){return;}VOID atUnsoli_Delete_Sim_Sms(UINT8*pDatabuf,int 
+cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]={(0x19a7+2215-0x224e)};int atRes=
+(0x196c+196-0x1a30);if(pDatabuf==NULL){return;}atRes=atSms_SendCmgdReq(pDatabuf,
+cid,errCode,ZSVR_AT_RES_CODE_LEN);if(atRes==ZSMS_RESULT_OK){atSms_RecvCmgdOk();}
+else{atSms_RecvCmgdErr();}atSms_RecvCmgdFinish();}VOID atUnsoli_Report_Cnma(
+UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]={(0x131c+1462-0x18d2)
+};if(pDatabuf==NULL){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x43\x6e\x6d\x61\x20\x6e\x75\x6c\x6c"
+);return;}atSms_SendCnmaReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);}VOID 
+atUnsoli_Report_Zmena(UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]
+={(0x11f7+2543-0x1be6)};int atRes=(0xb9a+4471-0x1d11);if(pDatabuf==NULL){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x5a\x6d\x65\x6e\x61\x20\x6e\x75\x6c\x6c"
+);return;}atRes=atSms_SendZmenaReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);if
+(atRes==ZSMS_RESULT_OK){atSms_RecvZmenaOk();}else{atSms_RecvZmenaErr();}}VOID 
+atUnsoli_Report_Zmgr(UINT8*pDatabuf,int cid){CHAR errCode[ZSVR_AT_RES_CODE_LEN]=
+{(0x1b04+672-0x1da4)};if(pDatabuf==NULL){printf(
+"\x5b\x53\x4d\x53\x5d\x20\x61\x74\x55\x6e\x73\x6f\x6c\x69\x5f\x52\x65\x70\x6f\x72\x74\x5f\x5a\x6d\x67\x72\x20\x6e\x75\x6c\x6c"
+);return;}atSms_SendZmgrReq(pDatabuf,cid,errCode,ZSVR_AT_RES_CODE_LEN);}
+#endif

+