michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef XML_PARSER_DEFINES_H michael@0: #define XML_PARSER_DEFINES_H michael@0: michael@0: #include "sll_lite.h" michael@0: #include "cc_constants.h" michael@0: michael@0: michael@0: /** michael@0: * In general, when a parser constructs a xml string, michael@0: * it should translate the enum to cooresponding string michael@0: * value that is defined in the accompanied xsd files. michael@0: */ michael@0: /** michael@0: * Define the state values michael@0: */ michael@0: typedef enum { michael@0: XML_STATE_PARTIAL = 0, //Encode as "partial" michael@0: XML_STATE_FULL //"full" michael@0: } xml_state_t; michael@0: michael@0: /** michael@0: * Define the call orientation michael@0: */ michael@0: typedef enum { michael@0: XML_CALL_ORIENTATION_UNSPECIFIED = 0, michael@0: XML_CALL_ORIENTATION_TO, michael@0: XML_CALL_ORIENTATION_FROM michael@0: } xml_call_orientation_t; michael@0: michael@0: /** michael@0: * Define the call lock status michael@0: */ michael@0: typedef enum { michael@0: XML_CALLLOCK_UNLOCKED = 0, michael@0: XML_CALLLOCK_LOCKED, michael@0: XML_CALLLOCK_REMOTE_LOCKED michael@0: } xml_calllock_t; michael@0: michael@0: /** michael@0: * Define the direction values michael@0: */ michael@0: typedef enum { michael@0: XML_DIRECTION_INITIATOR = 0, michael@0: XML_DIRECTION_RECIPIENT michael@0: } xml_direction_t; michael@0: michael@0: /** michael@0: * Define the event values michael@0: */ michael@0: typedef enum { michael@0: XML_EVENT_CANCELLED = 0, michael@0: XML_EVENT_REJECTED, michael@0: XML_EVENT_REPLACED, michael@0: XML_EVENT_LOCAL_BYE, michael@0: XML_EVENT_REMOTE_BYE, michael@0: XML_EVENT_ERROR, michael@0: XML_EVENT_TIMEOUT michael@0: } xml_event_t; michael@0: michael@0: /** michael@0: * Define the yes or no values michael@0: */ michael@0: typedef enum { michael@0: XML_NO = 0, michael@0: XML_YES, michael@0: XML_NONEAPPLICABLE //"na" michael@0: } xml_yes_no_t; michael@0: michael@0: /** michael@0: * Define the on or off value michael@0: */ michael@0: typedef enum { michael@0: XML_OFF = 0, michael@0: XML_ON michael@0: } xml_on_off_t; michael@0: michael@0: /** michael@0: * Define the true or false values michael@0: */ michael@0: typedef enum { michael@0: XML_FALSE = 0, michael@0: XML_TRUE michael@0: } xml_true_false_t; michael@0: michael@0: /** michael@0: * Define the line key events michael@0: */ michael@0: typedef enum { michael@0: XML_LINE_KEY_EVENT_LINE = 0, michael@0: XML_LINE_KEY_EVENT_SPEEDDIAL michael@0: } xml_line_key_event_t; michael@0: michael@0: /** michael@0: * Define the persist types michael@0: */ michael@0: typedef enum { michael@0: XML_PERSIST_TYPE_ONE_SHOT = 0, michael@0: XML_PERSIST_TYPE_PERSIST, michael@0: XML_PERSIST_TYPE_SINGLE_NOTIFY michael@0: } xml_persist_type_t; michael@0: michael@0: /** michael@0: * Define the soft key invoke type michael@0: */ michael@0: typedef enum { michael@0: XML_SKEY_INVOKE_EXPLICIT = 0, michael@0: XML_SKEY_NVOKE_IMPLICIT michael@0: } xml_skey_invoke_t; michael@0: michael@0: /** michael@0: * Define the soft key event data michael@0: */ michael@0: typedef enum { michael@0: XML_SKEY_EVENT_UNDEFINED = 0, michael@0: XML_SKEY_EVENT_REDIAL, michael@0: XML_SKEY_EVENT_NEWCALL, michael@0: XML_SKEY_EVENT_HOLD, michael@0: XML_SKEY_EVENT_TRANSFER, michael@0: XML_SKEY_EVENT_CFWDALL, //5 michael@0: XML_SKEY_EVENT_CFWDBUSY, michael@0: XML_SKEY_EVENT_CFWDNOANSWER, michael@0: XML_SKEY_EVENT_BACKSPACE, michael@0: XML_SKEY_EVENT_ENDCALL, michael@0: XML_SKEY_EVENT_RESUME, //10 michael@0: XML_SKEY_EVENT_ANSWER, michael@0: XML_SKEY_EVENT_INFO, michael@0: XML_SKEY_EVENT_CONFERENCE, michael@0: XML_SKEY_EVENT_JION, //15 michael@0: XML_SKEY_EVENT_REMVOVE_LAST_CONF_PARTICIPANT, michael@0: XML_SKEY_EVENT_DIRECT_XFER, michael@0: XML_SKEY_EVENT_SELECT, //25 michael@0: XML_SKEY_EVENT_TRANSFER_TO_VOICE_MAIL, michael@0: XML_SKEY_EVENT_SAC, michael@0: XML_SKEY_EVENT_UNSELECT, //35 michael@0: XML_SKEY_EVENT_CANCEL, michael@0: XML_SKEY_EVENT_COPNFERENCE_DETAILS,//40 michael@0: XML_SKEY_EVENT_TRASFMG = 65, michael@0: XML_SKEY_EVENT_INTRCPT, michael@0: XML_SKEY_EVENT_SETWTCH, michael@0: XML_SKEY_EVENT_TRNSFVM, michael@0: XML_SKEY_EVENT_TRNSFAS michael@0: } xml_skey_event_code_t; michael@0: michael@0: /** michael@0: * Define the map for station sequence mapping michael@0: */ michael@0: typedef enum { michael@0: XML_STATION_SEQ_FIRST = 0, michael@0: XML_STATION_SEQ_MORE, michael@0: XML_STATION_SEQ_LAST michael@0: } xml_stataionseq_t; michael@0: michael@0: /** michael@0: * Define the hold reasons michael@0: */ michael@0: typedef enum { michael@0: XML_HOLD_REASON_NONE = 0, michael@0: XML_HOLD_REASON_TRANSFER, michael@0: XML_HOLD_REASON_CONFERENCE, michael@0: XML_HOLD_REASON_INTERNAL michael@0: } xml_hold_reason_t; michael@0: michael@0: /** michael@0: * Define the lamp status michael@0: */ michael@0: typedef enum { michael@0: XML_LAMP_STATE_OFF = 0, michael@0: XML_LAMP_STATE_ON, michael@0: XML_LAMP_STATE_BLINK, michael@0: XML_LAMP_STATE_FLASH michael@0: } xml_lamp_state_t; michael@0: michael@0: /** michael@0: * Define the lamp type michael@0: */ michael@0: typedef enum { michael@0: XML_LAMP_TYPE_LINE = 1, michael@0: XML_LAMP_TYPE_VOICE_MAIL michael@0: } xml_lamp_type_t; michael@0: michael@0: /** michael@0: * Define the image down load method michael@0: */ michael@0: typedef enum { michael@0: XML_IMAGE_DOWNLOAD_METHOD_TFTP = 1, michael@0: XML_IMAGE_DOWNLAOD_METHOD_HTTP, michael@0: XML_IMAGE_DOWNLOAD_METHOD_PPID michael@0: } xml_image_dl_method_t; michael@0: michael@0: /** michael@0: * Define the image download failure reason michael@0: */ michael@0: typedef enum { michael@0: XML_IMAGE_DOWNLOAD_FAILURE_REASON_DISKFULL = 1, michael@0: XML_IMAGE_DOWNLOAD_FAILURE_REASON_IMAGE_NOT_AVAILABLE, michael@0: XML_IMAGE_DOWNLOAD_FAILURE_REASON_ACCESS_VIOLATION michael@0: } xml_image_dl_failure_reason_t; michael@0: michael@0: typedef signed long xml_signed32; michael@0: typedef unsigned long xml_unsigned32; michael@0: typedef unsigned short xml_unsigned16; michael@0: typedef unsigned char xml_unsigned8; michael@0: michael@0: // start of copy from ccsip_eventbodies.h michael@0: typedef struct State { michael@0: xml_signed32 event; michael@0: xml_signed32 code; michael@0: xml_signed32 state; michael@0: } State; michael@0: michael@0: typedef struct Replaces { michael@0: char call_id[128]; michael@0: char local_tag[64]; michael@0: char remote_tag[64]; michael@0: } Replaces; michael@0: michael@0: typedef struct RefferedBy { michael@0: char display_name[64]; michael@0: char uri[64]; michael@0: } RefferedBy; michael@0: michael@0: typedef struct RouteSet { michael@0: char hop[5][16]; michael@0: } RouteSet; michael@0: michael@0: typedef struct Identity { michael@0: char display_name[64]; michael@0: char uri[64]; michael@0: } Identity; michael@0: michael@0: typedef struct Param { michael@0: char pname[32]; michael@0: char pval[32]; michael@0: } Param; michael@0: michael@0: typedef struct Target { michael@0: Param param[4]; michael@0: char uri[64]; michael@0: } Target; michael@0: michael@0: typedef struct SessionDescription { michael@0: char type[32]; michael@0: } SessionDescription; michael@0: michael@0: typedef struct Participant { michael@0: Identity identity; michael@0: Target target; michael@0: SessionDescription session_description; michael@0: xml_unsigned16 cseq; michael@0: } Participant; michael@0: michael@0: typedef struct primCall { michael@0: char call_id[128]; michael@0: char local_tag[64]; michael@0: char remote_tag[64]; michael@0: xml_signed32 h_reason; michael@0: } primCall; michael@0: michael@0: typedef struct callFeature { michael@0: char cfwdall_set[128]; michael@0: char cfwdall_clear[128]; michael@0: } callFeature; michael@0: michael@0: typedef struct Stream { michael@0: char reverse[16]; michael@0: } Stream; michael@0: michael@0: typedef struct Regex { michael@0: char regexData[32]; michael@0: char tag[32]; michael@0: char pre[32]; michael@0: } Regex; michael@0: michael@0: typedef struct Pattern { michael@0: xml_signed32 flush; michael@0: Regex regex; michael@0: xml_signed32 persist; michael@0: xml_unsigned32 interdigittimer; michael@0: xml_unsigned32 criticaldigittimer; michael@0: xml_unsigned32 extradigittimer; michael@0: xml_unsigned16 longhold; michael@0: xml_unsigned8 longrepeat; michael@0: xml_unsigned8 nopartial; michael@0: char enterkey[8]; michael@0: } Pattern; michael@0: michael@0: typedef struct KPMLRequest { michael@0: Stream stream; michael@0: Pattern pattern; michael@0: char version[16]; michael@0: } KPMLRequest; michael@0: michael@0: typedef struct KPMLResponse { michael@0: char version[16]; michael@0: char code[16]; michael@0: char text[16]; michael@0: xml_unsigned8 suppressed; michael@0: char forced_flush[16]; michael@0: char digits[16]; michael@0: char tag[16]; michael@0: } KPMLResponse; michael@0: michael@0: typedef struct dialogID { michael@0: char callid[128]; michael@0: char localtag[64]; michael@0: char remotetag[64]; michael@0: } dialogID; michael@0: michael@0: typedef struct consultDialogID { michael@0: char callid[128]; michael@0: char localtag[64]; michael@0: char remotetag[64]; michael@0: } consultDialogID; michael@0: michael@0: typedef struct joindialogID { michael@0: char callid[128]; michael@0: char localtag[64]; michael@0: char remotetag[64]; michael@0: } joindialogID; michael@0: michael@0: typedef struct reg_contact_t { michael@0: char Register[16]; michael@0: char Unregister[16]; michael@0: xml_unsigned32 line; michael@0: xml_unsigned32 low; michael@0: xml_unsigned32 high; michael@0: xml_signed32 all; michael@0: } reg_contact_t; michael@0: michael@0: michael@0: typedef struct remotecc { michael@0: char status[16]; michael@0: } remotecc; michael@0: michael@0: typedef struct combine { michael@0: xml_unsigned16 max_bodies; michael@0: remotecc remotecc; michael@0: char service_control[16]; michael@0: } combine; michael@0: michael@0: typedef struct dialog { michael@0: char usage[64]; michael@0: char unot[16]; michael@0: char sub[16]; michael@0: } dialog; michael@0: michael@0: typedef struct presence { michael@0: char usage[64]; michael@0: char unot[16]; michael@0: char sub[16]; michael@0: } presence; michael@0: michael@0: typedef struct voice_msg_t { michael@0: xml_signed32 newCount; michael@0: xml_signed32 oldCount; michael@0: } voice_msg_t; michael@0: michael@0: typedef struct voice_msg_hp_t { michael@0: xml_signed32 newCount; michael@0: xml_signed32 oldCount; michael@0: } voice_msg_hp_t; michael@0: michael@0: typedef struct fax_msg_t { michael@0: xml_signed32 newCount; michael@0: xml_signed32 oldCount; michael@0: } fax_msg_t; michael@0: michael@0: typedef struct fax_msg_hp_t { michael@0: xml_signed32 newCount; michael@0: xml_signed32 oldCount; michael@0: } fax_msg_hp_t; michael@0: michael@0: typedef struct emwi_t { michael@0: voice_msg_t voice_msg; michael@0: voice_msg_hp_t voice_msg_hp; michael@0: fax_msg_t fax_msg; michael@0: fax_msg_hp_t fax_msg_hp; michael@0: } emwi_t; michael@0: michael@0: typedef struct cfwdallupdate { michael@0: char fwdAddress[256]; michael@0: } cfwdallupdate; michael@0: michael@0: typedef struct Contact_t { michael@0: xml_unsigned32 line; michael@0: xml_unsigned32 high; michael@0: xml_unsigned32 low; michael@0: xml_signed32 all; michael@0: xml_signed32 mwi; michael@0: emwi_t emwi; michael@0: cfwdallupdate cfwdallupdate; michael@0: } Contact_t; michael@0: michael@0: typedef struct dialog_t { michael@0: char usage[64]; michael@0: char unot[12]; michael@0: char sub[12]; michael@0: } dialog_t; michael@0: michael@0: typedef struct presence_t { michael@0: char usage[64]; michael@0: char unot[12]; michael@0: char sub[12]; michael@0: } presence_t; michael@0: michael@0: typedef struct options_ans_t { michael@0: combine combine; michael@0: dialog_t dialog; michael@0: presence_t presence; michael@0: } options_ans_t; michael@0: michael@0: typedef struct PersonStatusStruct { michael@0: char basic[32]; michael@0: } PersonStatusStruct; michael@0: michael@0: typedef struct ActivitiesStruct { michael@0: char alerting[12]; michael@0: char onThePhone[12]; michael@0: char busy[12]; michael@0: char away[12]; michael@0: char meeting[12]; michael@0: } ActivitiesStruct; michael@0: michael@0: typedef struct PersonStruct { michael@0: char id[256]; michael@0: PersonStatusStruct personStatus; michael@0: ActivitiesStruct activities; michael@0: } PersonStruct; michael@0: michael@0: typedef struct StatusStruct { michael@0: char basic[32]; michael@0: ActivitiesStruct activities; michael@0: } StatusStruct; michael@0: michael@0: typedef struct TupleStruct { michael@0: char id[256]; michael@0: StatusStruct status; michael@0: char contact[1][256]; michael@0: char note[1][1024]; michael@0: } TupleStruct; michael@0: michael@0: typedef struct PresenceRPIDStruct { michael@0: char entity[256]; michael@0: PersonStruct person; michael@0: TupleStruct tuple[1]; michael@0: char note[5][1024]; michael@0: } PresenceRPIDStruct; michael@0: michael@0: typedef struct sipProfile { michael@0: xml_unsigned16 kpml_val; michael@0: } sipProfile; michael@0: michael@0: typedef struct ConfigApp_req_data_t { michael@0: sipProfile sip_profile; michael@0: } ConfigApp_req_data_t; michael@0: michael@0: typedef struct to_encoder_t { michael@0: xml_unsigned32 picture_fast_update; michael@0: } to_encoder_t; michael@0: michael@0: typedef struct vc_primivite_t { michael@0: to_encoder_t to_encoder; michael@0: char stream_id[128]; michael@0: } vc_primivite_t; michael@0: michael@0: typedef struct Media_Control_t { michael@0: vc_primivite_t vc_primitive; michael@0: char general_error[128]; michael@0: } Media_Control_t; michael@0: michael@0: // end of copy from ccsip_eventbodies.h michael@0: michael@0: typedef struct Presence_ext_t_ { michael@0: PresenceRPIDStruct presence_body; michael@0: /* michael@0: * Some of the tags' mere presence in the rpid document has a meaning. These tags michael@0: * may not contain any value between starting and ending tag. So we need a way to michael@0: * indicate the presence of a tag. We will use the following boolean memeber fields. michael@0: */ michael@0: boolean onThePhone; michael@0: boolean busy; michael@0: boolean away; michael@0: boolean meeting; michael@0: boolean alerting; michael@0: } Presence_ext_t; michael@0: michael@0: michael@0: typedef enum { michael@0: EVENT_DATA_INVALID = 0, michael@0: EVENT_DATA_KPML_REQUEST, michael@0: EVENT_DATA_KPML_RESPONSE, michael@0: EVENT_DATA_REMOTECC_REQUEST, michael@0: EVENT_DATA_PRESENCE, michael@0: EVENT_DATA_DIALOG, michael@0: EVENT_DATA_RAW, michael@0: EVENT_DATA_CONFIGAPP_REQUEST, michael@0: EVENT_DATA_MEDIA_INFO michael@0: } ccsip_event_data_type_e; michael@0: michael@0: typedef struct { michael@0: char *data; michael@0: uint32_t length; michael@0: } raw_data_t; michael@0: michael@0: typedef struct { michael@0: Media_Control_t media_control; michael@0: uint32_t picture_fast_update; michael@0: } media_control_ext_t; michael@0: michael@0: #define TAG_LENGTH 16 michael@0: typedef struct { michael@0: char current_method[TAG_LENGTH]; michael@0: char hookstate[TAG_LENGTH]; michael@0: char presence[TAG_LENGTH]; michael@0: } Options_ind_t; michael@0: michael@0: michael@0: michael@0: typedef struct rcc_response_t { michael@0: xml_unsigned16 code; michael@0: char reason[128]; michael@0: xml_unsigned32 applicationid; michael@0: xml_unsigned32 transactionid; michael@0: xml_signed32 stationsequence; michael@0: xml_unsigned16 displaypriority; michael@0: xml_unsigned16 appinstance; michael@0: xml_unsigned16 linenumber; michael@0: xml_unsigned32 routingid; michael@0: xml_unsigned32 confid; michael@0: char callID[128]; michael@0: options_ans_t options_ind; michael@0: } rcc_response_t; michael@0: michael@0: typedef enum { michael@0: RCC_NULL_REQ = 0, michael@0: RCC_INITCALL_REQ = 1, michael@0: RCC_MONITORCALL_REQ, michael@0: RCC_DIALCALL_REQ, michael@0: RCC_DIALDTMF_REQ, michael@0: RCC_ANSCALL_REQ, michael@0: RCC_DISCCALL_REQ, michael@0: RCC_XFERSETUP_REQ, michael@0: RCC_XFERCOMPLETE_REQ, michael@0: RCC_CONFSETUP_REQ, michael@0: RCC_CONFCOMPLETE_REQ, michael@0: RCC_HOLD_REQ, michael@0: RCC_HOLDRETRIEVE_REQ, michael@0: RCC_DATAPASSTHROUGH_REQ, michael@0: RCC_CFWDALL_REQ, michael@0: RCC_LINEKEY_EVT, michael@0: RCC_STATUS_UPDATE_REQ, michael@0: RCC_SET_IDLE_STATUS_PROMPT_REQ, michael@0: RCC_PLAY_TONE_REQ, michael@0: RCC_STOP_TONE_REQ, michael@0: RCC_CALL_SELECT_REQ, michael@0: RCC_SOFTKEY_EVT, michael@0: RCC_LINE_RINGER_SET_REQ, michael@0: RCC_HOLD_REVERSION_REQ, michael@0: RCC_LAMP_CONTROL_REQ, michael@0: RCC_LINEKEY_UPDATE, michael@0: RCC_BULKREGISTER_REQ, michael@0: RCC_OPTIONS_IND, michael@0: RCC_BULK_UPDATE, michael@0: RCC_CALL_JOIN_REQ, michael@0: RCC_NOTIFY_REQ, michael@0: RCC_MONITOR_UPDATE_REQ, michael@0: RCC_MAX_REQ michael@0: } rcc_request_type_t; michael@0: michael@0: typedef struct rcc_softkey_event_msg_t { michael@0: xml_signed32 softkeyevent; michael@0: dialogID dialogid; michael@0: xml_unsigned16 linenumber; michael@0: xml_unsigned16 participantnum; michael@0: dialogID consultdialogid; michael@0: xml_unsigned8 state; michael@0: dialogID joindialogid; michael@0: //eventData eventdata; michael@0: char userdata[32]; michael@0: xml_unsigned16 soktkeyid; michael@0: xml_unsigned16 applicationid; michael@0: } rcc_softkey_event_msg_t; michael@0: michael@0: michael@0: typedef struct RCC_req_data { michael@0: rcc_softkey_event_msg_t rcc_softkey_event_msg; michael@0: } RCC_req_data; michael@0: michael@0: typedef struct rcc_int_t_ { michael@0: RCC_req_data rcc_int; michael@0: // User added fields michael@0: xml_unsigned8 iterations; michael@0: cc_lineid_t line; michael@0: cc_callid_t gsm_id; michael@0: cc_callid_t consult_gsm_id; michael@0: cc_callid_t join_gsm_id; michael@0: rcc_request_type_t rcc_request_type; michael@0: } RCC_data; michael@0: michael@0: michael@0: // Data for event generation michael@0: typedef struct ccsip_event_data_t_ { michael@0: struct ccsip_event_data_t_ *next; michael@0: ccsip_event_data_type_e type; michael@0: union { michael@0: KPMLResponse kpml_response; michael@0: KPMLRequest kpml_request; michael@0: RCC_data remotecc_data; michael@0: rcc_response_t remotecc_data_response; michael@0: Options_ind_t options_ind; michael@0: Presence_ext_t presence_rpid; michael@0: raw_data_t raw_data; // used for cmxml and other body types michael@0: ConfigApp_req_data_t configapp_data; michael@0: media_control_ext_t media_control_data; michael@0: } u; michael@0: } ccsip_event_data_t; michael@0: michael@0: michael@0: /** michael@0: * Request to allocate memory for external xml parser michael@0: * @param [in] size ofrequested memory michael@0: * @return pointer to memory allocated. michael@0: */ michael@0: void *ccAllocXML(cc_size_t size); michael@0: michael@0: /** michael@0: * Free xml memory michael@0: * @param [in] mem - memory to free michael@0: * @return void michael@0: */ michael@0: void ccFreeXML(void *mem); michael@0: #endif