smpp.h
上传用户:hkcoast
上传日期:2007-01-12
资源大小:979k
文件大小:7k
源码类别:

手机短信编程

开发平台:

Visual C++

  1. #if _MSC_VER > 1000
  2. #pragma once
  3. #endif // _MSC_VER > 1000
  4. //special command_id (defined ourself in SMSC Vendor range)
  5. #define SMPP_SPECIAL_LINKCLOSE 0x000101A5
  6. //command_id
  7. #define SMPP_GENERIC_NACK 0x80000000
  8. #define SMPP_BIND_RECEIVER 0x00000001
  9. #define SMPP_BIND_RECEIVER_RESP   0x80000001
  10. #define SMPP_BIND_TRANSMITTER 0x00000002
  11. #define SMPP_BIND_TRANSMITTER_RESP 0x80000002
  12. #define SMPP_QUERY_SM 0x00000003
  13. #define SMPP_QUERY_SM_RESP 0x80000003
  14. #define SMPP_SUBMIT_SM 0x00000004
  15. #define SMPP_SUBMIT_SM_RESP 0x80000004
  16. #define SMPP_DELIVER_SM 0x00000005
  17. #define SMPP_DELIVER_SM_RESP 0x80000005
  18. #define SMPP_UNBIND 0x00000006
  19. #define SMPP_UNBIND_RESP 0x80000006
  20. #define SMPP_REPLACE_SM 0x00000007
  21.     #define SMPP_REPLACE_SM_RESP 0x80000007
  22.     #define SMPP_CANCEL_SM 0x00000008
  23.     #define SMPP_CANCEL_SM_RESP 0x80000008
  24. #define SMPP_BIND_TRANSCEIVER 0x00000009
  25. #define SMPP_BIND_TRANSCEIVER_RESP 0x80000009
  26. #define SMPP_OUTBIND 0x0000000B
  27.     #define SMPP_ENQUIRE_LINK 0x00000015
  28.     #define SMPP_ENQUIRE_LINK_RESP 0x80000015
  29. #define SMPP_SUBMIT_MULTI 0x00000021
  30. #define SMPP_SUBMIT_MULTI_RESP 0x80000021
  31. #define SMPP_ALERT_NOTIFICATION 0x00000102
  32. #define SMPP_DATA_SM 0x00000103
  33. #define SMPP_DATA_SM_RESP 0x80000103
  34. //data_coding
  35. typedef enum
  36. {
  37. CODING_DEFAULT = 0x00, // Default Alphabet
  38. CODING_ANSI_X3_4 = 0x01, // IA5 (CCITT T.50)/ASCII (ANSI X3.4)
  39. CODING_OCTET1 = 0x02, // Octet unspecified (8-bit binary)
  40. CODING_ISO8859_1 = 0x03, // Latin 1 (ISO-8859-1)
  41. CODING_OCTET2 = 0x04, // Octet unspecified (8-bit binary)
  42. CODING_JIS = 0x05, //JIS (X 0208-1990)
  43. CODING_CYRLLIC = 0x06, //Cyrllic (ISO-8859-5)
  44. CODING_LATIN = 0x07, //Latin/Hebrew (ISO-8859-8)
  45. CODING_UCS2 = 0x08, //UCS2 (ISO/IEC-10646)
  46. CODING_PICTOGRAM = 0x09, //Pictogram Encoding
  47. CODING_ISO_2200_JP = 0x0A //ISO-2200-JP
  48. } DATA_CODING;
  49. //command_status
  50. typedef enum
  51. {
  52. ESME_ROK = 0x00000000, // No error
  53. ESME_RINVMSGLEN = 0x00000001, // Message length is invalid
  54. ESME_RINVCMDLEN = 0x00000002, // Command length is invalid
  55. ESME_RINVCMDID = 0x00000003, // Invalid command id
  56. ESME_RINVBNDSTS = 0x00000004, // Incorrect BIND status for given command
  57. ESME_RALYBND = 0x00000005, // ESME already in bound state
  58. ESME_RINVPRTFLG = 0x00000006, // Invalid priority flag
  59. ESME_RINVREGDLVFLG = 0x00000007, // Invalid registered delivery flag
  60. ESME_RSYSERR = 0x00000008, // System error
  61. ESME_RINVSRCADR = 0x0000000A, // Invalid source address
  62. ESME_RINVDSTADR = 0x0000000B, // Invalid destination address
  63. ESME_RINVMSGID = 0x0000000C, // Invalid message id
  64. ESME_RBINDFAIL = 0x0000000D, // Bind failed
  65. ESME_RINVPASWD = 0x0000000E, // Invalid password
  66. ESME_RINVSYSID = 0x0000000F, // Invalid system id
  67. ESME_RCANCELFAIL = 0x00000011, // Cancel SM failed
  68. ESME_RREPLACEFAIL = 0x00000013, // Replace SM failed
  69. ESME_RMSGQFUL = 0x00000014, // Message queue full
  70. ESME_RINVSERTYP = 0x00000015, // Invalid service type
  71. ESME_RINVNUMDESTS = 0x00000033, // Invalid number of destinations
  72. ESME_RINVDLNAME = 0x00000034, // Invalid distribution list name
  73. ESME_RINVDESTFLAG = 0x00000040, // Destination flag is invalid
  74. ESME_RINVSUBREP = 0x00000042, // Invalid 'submit_with_replace' request
  75. ESME_RINVESMCLASS = 0x00000043, // Invalid 'esm_class' field data
  76. ESME_RCNTSUBDL = 0x00000044, // Cannot submit to distribution list
  77. ESME_RSUBMITFAIL = 0x00000045, // 'submit_sm' or 'submit_multi' failed
  78. ESME_RINVSRCTON = 0x00000048, // Invalid source address TON
  79. ESME_RINVSRCNPI = 0x00000049, // Invalid source address NPI
  80. ESME_RINVDSTTON = 0x00000050, // Invalid destination address TON
  81. ESME_RINVDSTNPI = 0x00000051, // Invalid destination address NPI
  82. ESME_RINVSYSTYP = 0x00000053, // Invalid 'system_type' field
  83. ESME_RINVREPFLAG = 0x00000054, // Invalid 'replace_if_present' flag
  84. ESME_RINVNUMMSGS = 0x00000055, // Invalid number of messages
  85. ESME_RTHROTTLED = 0x00000058, // Throttling error
  86. ESME_RINVSCHED = 0x00000061, // Invalid Scheduled Delivery Time
  87. ESME_RINVEXPIRY = 0x00000062, // Invalid Message Validity Period (Expiry time)
  88. ESME_RINVDFTMSGID = 0x00000063, // Predefined Message Invalid or Not Found
  89. ESME_RX_T_APPN = 0x00000064, // ESME Receiver Temporary App Error Code
  90. ESME_RX_P_APPN = 0x00000065, // ESME Receiver Permanent App Error Code
  91. ESME_RX_R_APPN = 0x00000066, // ESME Receiver Reject Message Error Code
  92. ESME_RQUERYFAIL = 0x00000067, // 'query_sm' request failed
  93. ESME_RINVOPTPARSTREAM = 0x000000C0, // Error in the optional part of the PDU Body
  94. ESME_RINVPARLEN = 0x000000C2, // Invalid Parameter Length
  95. ESME_RMISSINGOPTPARAM = 0x000000C3, // Expected Optional Parameter missing
  96. ESME_ROPTPARNOTALLWD = 0x000000C4, // Invalid Optional Parameter Value
  97. ESME_RDELIVERYFAILURE = 0x000000FE, // Delivery Failure (used for 'data_sm_resp')
  98. ESME_RUNKNOWNERR = 0x000000FF, // Unknown Error
  99. ESME_RTRANSPORTERR = 0x00000400, // Transport Error
  100. ESME_RGATEWAYFAILURE = 0x00000401, // Gateway Failure (Unable to reach internal gateway)
  101. ESME_RPERMANENTFAILURE = 0x00000402, // Permanent Network Failure (To external gateway)
  102. ESME_RTEMPORARYFAILURE = 0x00000403, // Temporary Network Failure (To external gateway)
  103. ESME_RINVSUBSCRIBER = 0x00000404, // Invalid Subscriber
  104. ESME_RINVMSG = 0x00000405, // Invalid Message
  105. ESME_RPROTOCOLERR = 0x00000406, // Gateway Protocol Error
  106. ESME_RDUPLICATEDMSG = 0x00000407, // Duplicated Messages
  107. ESME_RBARREDBYUSER = 0x00000408, // Barred by User
  108. ESME_RCANCELLEDBYSYS = 0x00000409, // Cancelled by System
  109. ESME_REXPIRED = 0x0000040A // Message Expired
  110. } CMD_STATUS_CODE;
  111. typedef enum
  112. {
  113. dest_addr_submit = 0x0005,
  114. dest_network_type = 0x0006,
  115. dest_bearer_type = 0x0007,
  116. dest_telematics_id = 0x0008,
  117. source_addr_submit = 0x000D,
  118. source_network_type = 0x000E,
  119. source_bearer_type = 0x000F,
  120. source_telematics_id = 0x0010,
  121. qos_time_to_live = 0x0017,
  122. payload_type = 0x0019,
  123. additional_status_info_text = 0x001D,
  124. receipted_message_id = 0x001E,
  125. ms_msg_wait_facilities = 0x0030,
  126. privacy_indicator = 0x0201,
  127. source_subaddress = 0x0202,
  128. dest_subaddress = 0x0203,
  129. user_message_reference = 0x0204,
  130. user_response_code = 0x0205,
  131. source_port = 0x020A,
  132. destination_port = 0x020B,
  133. sar_msg_ref_num = 0x020C,
  134. language_indicator = 0x020D,
  135. sar_total_segments = 0x020E,
  136. sar_segment_seqnum = 0x020F,
  137. SC_interface_version = 0x0210,
  138. callback_num_pres_ind = 0x0302,
  139. callback_num_atag = 0x0303,
  140. number_of_messages = 0x0304,
  141. callback_num = 0x0381,
  142. dpf_result = 0x0420,
  143. set_dpf = 0x0421,
  144. ms_availability_status = 0x0422,
  145. network_error_code = 0x0423,
  146. message_payload = 0x0424,
  147. ussd_service_op = 0x0501,
  148. display_time = 0x1201,
  149. sms_signal = 0x1203,
  150. ms_validity = 0x1204,
  151. alert_on_message_delivery = 0x130C,
  152. its_reply_type = 0x1380,
  153. its_session_info = 0x1383
  154. } OPTIONAL_PARAMETER;