📄 cms_mmsprovide.h
字号:
MMSOPR_CANCEL,
MMSWAP_DISCONNECTED,
MMSSYSTEM_ERROR,
MMSUNKNOWN_ERROR,
MMSNET_DISCONNECTED,
MMSNET_DISCONNECTING,
/* macro define of Response status value */
MMS_RESPONSE_STATUS_VALUE_OK =128,
MMS_RESPONSE_STATUS_VALUE_E_UNSPECIFIED =129,
MMS_RESPONSE_STATUS_VALUE_E_SERVICE_DENIED =130,
MMS_RESPONSE_STATUS_VALUE_E_FORMAT_CORRUPT =131,
MMS_RESPONSE_STATUS_VALUE_E_ADDRESS_UNRESOLVED =132,
MMS_RESPONSE_STATUS_VALUE_E_MESSAGE_NOT_FOUND =133,
MMS_RESPONSE_STATUS_VALUE_E_NETWORK_PROBLEM =134,
MMS_RESPONSE_STATUS_VALUE_E_NOT_ACCEPTED =135,
MMS_RESPONSE_STATUS_VALUE_E_UNSUPORTED_MESSAGE =136,
MMS_RESPONSE_STATUS_VALUE_E_UNKNOW_ERROR =999,
}MMS_LIBSTATUS_VALUE;
typedef enum
{
SMS_TYPE_DELIVERY_IND,
SMS_TYPE_NOTIFICATION_IND,
SMS_TYPE_READORIG_IND,
SMS_TYPE_UNKNOW,
}SMS_HANDLE_STATUS;
typedef enum mmsliberrcode{
MMS_NO_ERROR = 0, //没有错误
MMSMEMORY_ERROR,
MMSSEND_ABORT,
MMSRECV_ABORT,
MMSTEXT_TOOLARGE,
MMSIMAGEAUDIO_TOOLARGE,
MMSMSG_TOOLARGE,
}MMSLIBERRCODE;
/*------------------------------------------------------------------------
*
*
*
* some data stucture set before sending
*
*
*
------------------------------------------------------------------------*/
typedef struct tag_send_setting
{
char *send_vfilename;
char *conf_vfilename;
}MMS_SEND_SETTING;
typedef struct tag_recv_setting
{
char *get_url;
char *recv_vfilename;
bool immediate_recv; //if receiving immediately,1 means receiving imediately;0,the opposite.
int recv_msgsize;
}MMS_RECV_SETTING;
typedef struct tag_mmsconfig_setting
{
unsigned char *wap_gateway; //gateway address,China Mobile provide it as "10.0.0.172" 2003.11.03
char *mms_centery; //mms centry,China Mobile provide as "Http://mmsc.monternet.com/"
int wap_port; //wap wtp port 9201
}MMS_CONFIG_SETTING;
/*------------------------------------------------------------------------
*
*
*
* display some subject as phone to the upper
*
*
*
------------------------------------------------------------------------*/
typedef struct tag_sms_msg
{
int msgsize; //消息大小
long de_date; //delivery report date
int de_status; //delivery report status
char *de_msgid; //delivery report message id
char *de_to; //delivery report receiver
char *mms_url; //MMS所在的URL
char *phone_number; //发件人的电话
char *subject; //MMS主题
char *tid; //transaction ID
}NOTIFICATION_IND_SMS_MSG;
#endif // Modified by TIPrj[2005/7/13]
/*------------------------------------------------------------------------
*
*
*
* MMS callback mmsproc
* report the status to upper
*
*
------------------------------------------------------------------------*/
/*
typedef enum
{
LIB_STATUS_SENDRETURN,
LIB_STATUS_RECVRETURN,
LIB_STATUS_NORMAL_STATUS,
LIB_STATUS_TOTAL_BYTES,
LIB_STATUS_SENDED_BYTES,
LIB_STATUS_RECVED_BYTES
}MMS_LIBSTATUS;
*/
/*------------------------------------------------------------------------
* MMS文档结构定义
*
*
*
------------------------------------------------------------------------*/
#ifndef MAX_VERSION_LENGTH
#define MAX_VERSION_LENGTH 16
#endif
#ifndef MAX_MESSAGEID_LENGTH
#define MAX_MESSAGEID_LENGTH 40
#endif
#ifndef MAX_CONTENTLOCATON_LENGTH
#define MAX_CONTENTLOCATON_LENGTH 100
#endif
#ifndef MAX_RESPONSETEXT_LENGTH
#define MAX_RESPONSETEXT_LENGTH 30
#endif
#ifndef MAX_NAME_LENGTH
#define MAX_NAME_LENGTH 90/*128*//*64*/
#endif
#ifndef MAX_BOUNDARY_STR_LENGTH
#define MAX_BOUNDARY_STR_LENGTH 40
#endif
#ifndef MAX_CONTENT_LENGTH
#define MAX_CONTENT_LENGTH 128
#endif
#ifndef MAX_SUBJECT_LENGTH
#define MAX_SUBJECT_LENGTH 60
#endif
#ifndef MAX_URL_LENGTH
#define MAX_URL_LENGTH 256
#endif
#ifndef MAX_LENGTH
#define MAX_LENGTH 256
#endif
#ifndef FILE_BLOCK_LENGTH
#define FILE_BLOCK_LENGTH 2048
#endif
/*
* Added by longqiangl
* 2003-07-01
* MMS client should process correctly multi-recepient information
* tag_MMS_RECEPIENT is defined for this consideration
* The MMS recepient information , including To/CC/BCC
*/
typedef struct tag_MMS_RECEPIENT
{
struct tag_MMS_RECEPIENT *p_next;
/* Address of the recipient. */
char m_address[MAX_NAME_LENGTH];
}MMS_RECEPIENT;
typedef MMS_RECEPIENT* p_MMS_RECEPIENT;
typedef struct _CmsMMSHead
{
/* Internal Flags */
int flagMultipartRelated;
/* Header Fields Flags */
int flagBccAvailable;
int flagCcAvailable;
int flagContentTypeAvailable;
int flagDateAvailable;
int flagDeliveryReportAvailable;
int flagDeliveryTimeAvailable;
int flagDeliveryTimeAbsolute;
int flagExpiryAvailable;
int flagExpiryAbsolute;
int flagFromAvailable;
int flagMessageClassAvailable;
int flagMessageIdAvailable;
int flagMessageTypeAvailable;
int flagMMSVersionAvailable;
int flagPriorityAvailable;
int flagReadReportAvailable;
int flagSenderVisibilityAvailable;
int flagStatusAvailable;
int flagReadStatusAvailable;
int flagSubjectAvailable;
int flagToAvailable;
int flagTransactionIdAvailable;
/* hulf add */
int flagContentLocationAvailable;
int flagReportAllowedAvailable;
int flagResponseStatusAvailable;
int flagResponseTextAvailable;
int flagMessageSizeAvailable;
/* head flied value */
/*
* Revised by longqiangl
* 2003-07-01
*/
//char Mms_bcc[MAX_NAME_LENGTH];/* Address of the recipient. */
//char Mms_cc[MAX_NAME_LENGTH]; /* Address of the recipient. */
p_MMS_RECEPIENT p_bcc_head;
p_MMS_RECEPIENT p_cc_head;
char Mms_content_location[MAX_CONTENTLOCATON_LENGTH];
/* This field defines the location of the message. */
char Mms_content_type[MAX_CONTENT_LENGTH];
/* The content type of the message. */
int Mms_date; /* Arrival time of the message at MMSProxy -Relay.
MMS Proxy -Relaywill generate this field when
not supplied by terminal. */
int Mms_delivery_time; /* default: immediate.
Time of desired delivery. Indicates the earliest
possible delivery of the message to the recipient.
The field has two formats, either absolute or
CMS_MMS_S32erval. */
int Mms_expiry; /* default: maximum.
Length of time the message will be stored in MMS
Proxy-Relayor time to delete the message. The field has
two formats, either absolute or CMS_MMS_S32erval. */
char Mms_from[MAX_NAME_LENGTH];
/* Address of the sender. If hiding the address of the sender
from the recipient is supported, the MMS Proxy -Relay
will not add this field to a message header. */
char Mms_message_ID[MAX_MESSAGEID_LENGTH];
/* This is an unique reference assigned to message. This ID
SHALL always be present when the originator client
requested a read reply.
The ID enables a client to match read reports with */
/* Encoded as in email address as per [RFC822].
The characters "<" and ">" are not included. */
char Mms_message_class; /* Class of the message. */ //xuelianb modify [2005-12-26]
unsigned char Mms_delivery_report; /* Default determined when service is ordered.
Specifies whether the user wants a delivery
report from each recipient. When Message-Class
is Auto, the field SHALL always be present and
the value SHALL be No. */
unsigned char Mms_message_type; /* Specifies the message type. */
unsigned char Mms_mms_version; /* The MMS version number. According to this
specification, the version is 1.0. */
/* The three most significant bits of the Short-CMS_MMS_S32eger are
CMS_MMS_S32erpreted to encode a major version number in the range 1-7,
and the four least significant bits contain a minor version
number in the range 0-14. If there is only a major version
number, this is encoded by placing the value 15 in the four
least significant bits [WAPWSP]. */
long Mms_message_size; /* Full size of message in octets. */
unsigned char Mms_priority; /* Default: Normal.
Priority of the message for the recipient. */
char Mms_read_report; /* Specifies whether the user wants a read report from each
recipient as a new message. When Message-Class is
Auto, the field SHALL always be present and the value
SHALL be No. */ //xuelianb modify [2005-12-26]
unsigned char Mms_report_allowed; /* Default: Yes.
Sending of delivery report allowed to the user or not. */
unsigned char Mms_response_status; /* MMS specific status. */
char Mms_response_text[MAX_RESPONSETEXT_LENGTH];
/* Description which qualifies the response status value. */
char Mms_subj[MAX_SUBJECT_LENGTH+12];
/* Subject of the message. */
/*
* Revised by longqiangl
* 2003-07-01
*/
//char Mms_to[MAX_NAME_LENGTH];
/* Address of the recipient. */
p_MMS_RECEPIENT p_to_head;
/* Address of the recipient. */
char Mms_transaction_ID[MAX_NAME_LENGTH];
unsigned char Mms_sender_visibility; /* Default: show address/phone number of the
sender to the recipient unless the sender has a secret
number/address.
Hide = don't show any address. Show = show even secret
address. */
unsigned char Mms_status; /* Message status. The status Retrieved SHALL be used
only after successful retrieval of multimedia message. */
/* This transaction ID identifies the M-Send.conf and the
corresponding request only. */
char Mms_read_status;//xuelianb add [2005-12-26]
//CENT_FILL_FIELD2
} CmsMMSHead;
/* struct define: MMSContentHead
* define data block head information in rfc2387 mutipart/related
*/
/*
typedef struct _MMSContentHead
{
CMS_MMS_S8 Charset[30];
CMS_MMS_S8 Type[30];
CMS_MMS_S8 Encoding[30];
} MMSContentHead;
*/
/* struct define: MMSContentList
* define data block list in MMS PDU body
*/
typedef struct _MMSContentList
{
int start; /* start poCMS_MMS_S32 of this data block */
int length; /* length of this data block */
char type[MAX_CONTENT_LENGTH]; /* format type of this block */
char id[MAX_NAME_LENGTH]; /* id value or filename of this block */
char filename[MAX_NAME_LENGTH]; /* file name of this block */
struct _MMSContentList *firstchild; /* first child of this data block */
struct _MMSContentList *next; /* next of this data block */
}MMSContentList;
/* struct define: CmsMMSDocument
* CmsMMSDocument describe a mms pdu
*/
typedef struct _CmsMMSDocument
{
char mmsfile[MAX_NAME_LENGTH]; /* filename of mm */
char mmsstart[MAX_NAME_LENGTH]; /* smil or wml document id(filename) */
char mmstype[MAX_NAME_LENGTH]; /* document type */
MMSContentList *ccontent; /* current content in body */
CmsMMSHead *mmshead; /* head of mm */
MMSContentList *content; /* content list in body */
int mms_totalsize; //2003.11.03
}CmsMMSDocument;
typedef CmsMMSDocument *P_MMS_DOCUMENT;
/*------------------------------------------------------------------------
*
*
*
* the Interface of CECW &MMS lib
* about the bottom message handle
*
*
------------------------------------------------------------------------*/
void mmsEventPostEvent(CenMsgType type,unsigned int param1,void* param2);
void mmsEventProcessEvent(void);
/*------------------------------------------------------------------------
*
*
*
* MMs init,send receive SMS handle interface
*
*
*
------------------------------------------------------------------------*/
void WAP_GlobalV_Init(void);
void MMS_GlobalV_Init(void);
int MMS_Init(void);
int MMS_SetMaxSize(int send_maxsize,int recv_maxsize);
void MMS_Close(void);
bool MMS_Machine_Config(MMS_CONFIG_SETTING *p_cfgset);
MMSHANDLE MMS_NewMms(void);
int MMS_DeleteMms(MMSHANDLE mmsdoc);
int MMS_SetDefault(MMSHANDLE mmsdoc, int mmstype);
void MmsSetReadReportDefault(MMSHANDLE mmsdoc,char* messageId);
int MMS_SetMmsFile(MMSHANDLE mmsdoc, char *mmsfile);
int MMS_GetMmsFile(MMSHANDLE mmsdoc, char *mmsfile);
int MMS_SetMmsHeadField(MMSHANDLE mmsdoc, int field, long ivalue, char *svalue);
int MMS_GetMmsHeadField(MMSHANDLE mmsdoc, int field, long *ivalue, char *svalue);
int MMS_ClearMmsHeadField(MMSHANDLE mmsdoc, int field);
//void mms_storecontent(MMSHANDLE mmsdoc);
void MMS_SetContentID_SUPPORT(int y_n);
int MMS_EncodeMms(MMSHANDLE mmsdoc);
int MMS_DecodeMms(MMSHANDLE mmsdoc);
CmsMMSHead *MMS_Decode_Header(char *filename);
void MMS_DeleteHead(CmsMMSHead* mmshead);
int MmsDecodeHead(MMSHANDLE mmsdoc);
int MMS_SendMms(MMS_SEND_SETTING *send_setting,mmsproc proc);
int MMS_ReceiveMms(MMS_RECV_SETTING *recv_setting,mmsproc proc);
int MMS_DeferMms(NOTIFICATION_IND_SMS_MSG *p_msg,MMS_CONFIG_SETTING *p_cfgset);
void MMS_SendRecvCancel(void);
int MMS_sms_onpushmessage(unsigned char *sms_userdata,int sms_userdata_len,int flag_userdata_head,smsproc proc);
/*P_MMS_DOUCMENT 和pMMS_EDocument struct converter*/
int cms_parse_mms(char * filename, pMMS_EDocument theDocument);
MMSHANDLE cms_integrate_mms(pMMS_EDocument pMms_edoc);
//int cms_mms_saveasmodu(pMMS_EDocument pMms_edoc,char * mmsfile);
void timer_thread(void);
MMSLIBERRCODE MMS_GetLastError(void);
#undef bool
#endif /*#ifndef _CMS_MMS_PROVIDE_H*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -