#ifndef _RESTAPI_H
#define _RESTAPI_H

#include "../../../../plat/public/src/include/public.h"

#define	MAX_BODY_LEN	1024

#define REST_PROXY_PORT	4951

enum RESULT_TYPE 
{
	RES_SUCCEED = 0,
	RES_FAILED = 1,
};

enum ERROR_CODE 
{
	ERR_REST_SUCCESS = 2001,
	ERR_REST_COMMAND_UNSUPPORTED=3001,
	ERR_REST_UNKNOWN_PEER = 3010,
	ERR_REST_INVALID_USER_STATUS = 4001,
	ERR_REST_DEST_USER_NOT_ALLOWED = 4008,
	ERR_REST_CREDIT_LIMIT = 4012,
	ERR_REST_INVALID_PARAMETER_VALUE=5004,
	ERR_REST_MISSING_PARAMETER = 5005,
	ERR_REST_INVALID_RECHARGE_PWD = 5006,
	ERR_REST_UNABLE_TO_COMPLY=5012,
	ERR_REST_USER_UNKNOWN = 5030,
	ERR_REST_NO_LICENSE = 5040,
};

enum REST_PROXY_MSG_TYPE 
{
	REST_QUERY=1,
	REST_TOPUP=2,
	REST_TRANSFER=3,

	REST_ORDER=0x84,
	REST_FREE_RESOURCE=0x85,
	REST_DOWNLOAD_APP=0x86,
	REST_CHANNEL=0x87,
	REST_OFFER_CHANGE=0x88,
	REST_POINT_QUERY=0x89,
	REST_POINT_TRANSFER=0x8a,

	// for selfcare
	REST_SEND_AUTHCODE_REQ=5,
	REST_SEND_AUTHCODE_RSP=6,
	REST_QUERY_USERDATA_REQ=7,
	REST_QUERY_USERDATA_RSP=8,
	REST_BUNDLE_SUBS_REQ=9,
	REST_BUNDLE_SUBS_RSP=10,
	REST_BUNDLE_USAGE_REQ=11,
	REST_BUNDLE_USAGE_RSP=12,
	REST_RECHARGE_REQ=13,
	REST_RECHARGE_RSP=14,
	REST_TRANSFER_REQ=15,
	REST_TRANSFER_RSP=16,
	REST_RECHARGE_CARD_REQ=17,
	REST_RECHARGE_CARD_RSP=18,
	REST_CHECK_BALANCE_REQ=19,
	REST_CHECK_BALANCE_RSP=20,
	REST_QUERY_BALANCE_REQ=21,
	REST_QUERY_BALANCE_RSP=22,

	REST_QUERY_RECHARGE_CARD_REQ=23,  // query recharge card interface from CRM
	REST_QUERY_RECHARGE_CARD_RSP=24,
	REST_UPDATE_RECHARGE_CARD_REQ=25,  // update recharge card interface with CRM
	REST_UPDATE_RECHARGE_CARD_RSP=26,

	REST_CRM_PAYMENT_REQ=27,
	REST_CRM_PAYMENT_RES=28,

	REST_CRM_SMS_DELIVER_REQ=29,
	REST_CRM_SMS_DELIVER_RES=30,

	REST_CRM_CREATE_ACCT_REQ=31,
	REST_CRM_CREATE_ACCT_RES=32,
	
	REST_CRM_QUERY_TARIFF_REQ=33,
	REST_CRM_QUERY_TARIFF_RES=34,

	REST_CRM_UPDATE_SUBS_REQ=35,
	REST_CRM_UPDATE_SUBS_RES=36,

	REST_CRM_DELETE_SUBS_REQ=37,
	REST_CRM_DELETE_SUBS_RES=38,

	REST_CRM_UPDATE_SESS_INFO_REQ=39,	
	REST_CRM_UPDATE_SESS_INFO_RES=40,	

	REST_CRM_UPDATE_PLAN_INFO_REQ=41,	
	REST_CRM_UPDATE_PLAN_INFO_RES=42,	

	REST_CRM_RENT_CHARGE=43,
	REST_CRM_RENT_CHARGE_RES=44,
	
	
};

#if 0
enum PAY_TYPE
{
	PAY_TYPE_BALANCE = 1,
	PAY_TYPE_PAYPAL = 2,
	PAY_TYPE_VISA = 3,
	PAY_TYPE_MASTER = 4,
};

enum ACCT_STATUS
{
    AS_FRESH,           /* fresh account, can't dial in or out, 
                              but can recharge. */
    AS_NORMAL,      /* normal account */
    AS_SUSPEND,
    AS_BLACKLIST,
    AS_RELEASED,
    AS_OPRTRIAL,
    //AS_MAX_USER_TYPE,

    AS_EXTERNAL=10,
};
#endif

enum REST_IE_TAG
{
	IE_SRC_REF=1,
	IE_DST_REF,
	IE_MSISDN,
	IE_RESULT,
	IE_ERROR_CODE,
	IE_BALANCE,
	IE_MO_EXPIRY,
	IE_MT_EXPIRY,
	IE_USERNAME,
	IE_PASSWORD,
	IE_MSG_CONTENT, //value=11
	IE_STATUS,
	IE_REMARK,
	IE_GROUP_NAME,
	IE_MO_VOICE_MIN,// in minute
	IE_REMAIN_MO_VOICE_SEC,// in second
	IE_REMAIN_MO_VOICE_MIN,// in minute
	IE_MT_VOICE_MIN,// in minute
	IE_REMAIN_MT_VOICE_SEC,// in second
	IE_REMAIN_MT_VOICE_MIN,// in minute
	IE_SMS_NUM, //value=21
	IE_REMAIN_SMS_NUM,
	IE_DATA_VOL_MB,// in MB
	IE_REMAIN_DATA_VOL_KB,// in KB
	IE_REMAIN_DATA_VOL_MB,// in MB
	IE_PAY_TYPE,
	IE_AMOUNT,
	IE_VALID_DAYS,
	IE_EXPIRY_TIME,
	IE_MSISDN_TRANS_OUT,
	IE_MSISDN_TRANS_IN, //value=31
	IE_BALANCE_AVAILABLE,
	IE_RECHARGE_AMOUNT,
	IE_RECHARGE_TYPE,
	IE_RECHARGE_CARD_STATUS,
	IE_RECHARGE_CARD_FACE_VALUE,
	IE_RECHARGE_CARD_EXPIRED_TS,	
	IE_RECHARGE_CARD_UPDATED_TS,		
	IE_CUSTOMER_ID,
	IE_ACCOUNT_ID,
	IE_PRODUCT_ID, //value=41
	IE_PLAN_ID,
	IE_RENT_CHARGE,	
	IE_BIRTHDAY,
	IE_SMS_CONTENT,	
	IE_SERVICE_TYPE,
	IE_TARIIFF_PREFIX,
	IE_TARIFF_UNIT,
	IE_TARIFF_CHARGE,
	IE_TARIFF_DISCOUNT,
	IE_PLAN_VALUE,//value=51
	IE_PLAN_USED_VALUE,	
	IE_BUNDLE_ID,
	IE_CAUSE,	
	IE_SESS_FLAG,
	IE_TIMESTAMP,
	IE_CONSUME_VALUE,
	IE_CALLED_NUMBER,
	IE_UE_IP,
	IE_GW_IP,	
	IE_CUG_ID,
	IE_VAS_CUG_STATUS,	
	IE_SESS_UPDATE_TIME,
	IE_PLAN_VALUE_ADD_THIS_TIME,	
	IE_USER_CLASS,
	IE_PINCODE,
	IE_CALLER_NUMBER,
	IE_MAX_NUM,
	
};

typedef struct rest_header
{
	u16	src_ref;
	u16	dst_ref;
}_rest_header;

typedef struct rest_query
{
	char	msisdn[24];
}_rest_query;

typedef struct rest_query_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
	u32	balance;
	u32	mo_expiry;
	u32	mt_expiry;
}_rest_query_res;

typedef struct rest_topup
{
	u8	optional_flag; /* optional=1 ,account_id is presented */
	char	msisdn[24];

	char	username[24];
	char	password[24];
	char	pincode[24];
	u32 balance;
	long account_id;
}_rest_topup;

typedef struct rest_topup_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
	u32	balance;
	u32	mo_expiry;
	u32	mt_expiry;
}_rest_topup_res;

typedef struct rest_channel
{
	u8	optional_flag; /* optional=1 ,account_id is presented */
	char	msisdn[24];

	char	sess_id[64];
	char	sc_url[128];
	char	input[24];
}_rest_channel;

typedef struct rest_channel_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
    
	u8	sess_state;
	char prompt[256];
}_rest_channel_res;

typedef struct rest_order
{
	u8	optional_flag; /* optional=1 ,account_id is presented */
	char	msisdn[24];
	char	callerMsisdn[24];
	char	payMsisdn[24];

	u32 busicode;// 1000: recharge; 1001: order; 1002: cancel;
	u32 offer_id;
	u32 balance;// when busicode=1000
    u32 paymethod;// byte0: 4: balance; 10: mobile money; null: default balance // byte1: thirdPartyPayMethod
	char pincode[64];// when paymethod 10
	//char thirdPartyPayMethod[32];// Airtel, MTN
	//char thirdPartyPayPhone[64];// use payMsisdn
}_rest_order;


typedef struct rest_order_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
}_rest_order_res;

typedef struct rest_freeresource
{
	char	msisdn[24];
}_rest_freeresource;


typedef struct rest_freeresource_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
}_rest_freeresource_res;

typedef struct rest_downloadApp
{
	char	msisdn[24];
}_rest_downloadApp;


typedef struct rest_downloadApp_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
}_rest_downloadApp_res;

typedef struct rest_offerChange
{
	char	msisdn[24];
	u8	opt_out;
}_rest_offerChange;


typedef struct rest_offerChange_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
}_rest_offerChange_res;

typedef struct rest_queryPoint
{
	char	msisdn[24];
}_rest_queryPoint;


typedef struct rest_queryPoint_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;

	u32 amount;
	u32 airtime_amount;
}_rest_queryPoint_res;

typedef struct rest_transferPoint
{
	char	msisdn[24];
	char	target_msisdn[24];

	u32 amount;
	u32 busicode;
}_rest_transferPoint;


typedef struct rest_transferPoint_res
{
	u8	optional_flag;
	u8	result;
	u8	error_code;
}_rest_transferPoint_res;

// for selfcare =============================
typedef struct rest_send_authcode_req
{
	char	msisdn[24];
	char	sms_content[MAX_BODY_LEN];
}_rest_send_authcode_req;

typedef struct rest_send_authcode_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_send_authcode_rsp;

typedef struct rest_query_user_data_req
{
	char	msisdn[24];
}_rest_query_user_data_req;

typedef struct rest_query_user_data_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;

	char	msisdn[24];
	u8    status;// use ACCT_STATUS
	char remark[64];
	char usrGrpName[64];// usr data==>cos id==>cos title
	u32	balance;
	u64	mo_expiry;
	u32	mo_voc_min;// in Min
	u32	remain_mo_voc_min;
	u32	mt_voc_min;// in Min
	u32	remain_mt_voc_min;
	u32	total_sms_num;// reserved, set to 0 or do not send
	u32	remain_sms_num;
	u32	total_data_vol;// reserved, set to 0 or do not send
	u32	remain_data_vol;// MB
}_rest_query_user_data_rsp;

typedef struct rest_bundle_subs_req
{
	char	msisdn[24];
	u8 payType;// 1: balance; 2: paypal; 3: visa; 4: master, use PAY_TYPE
	u32 charge;// Conditional, mandatory if balance
	u32 moVoiceMinute;
	u32 mtVoiceMinute;
	u32 dataVolume;// MB
	u32 smsNum;
	u32 validDays;
}_rest_bundle_subs_req;


typedef struct rest_bundle_subs_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_bundle_subs_rsp;


typedef struct rest_bundle_usage_req
{
	char	msisdn[24];
}_rest_bundle_usage_req;


typedef struct rest_bundle_usage_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u32	moVoiceInSec;// remained mo voice in second
	u32	mtVoiceInSec;// remained mt voice in second
	u32  dataVolInKB;// remained data volume in KB
	u32  smsNum;// remained sms
	u64  expiredTime;// expired time
}_rest_bundle_usage_rsp;


typedef struct rest_recharge_req
{
	char	msisdn[24];

	u32	amount;// mandatory, add to balance
	u8   op_type;	
	u16   valid_days;
}_rest_recharge_req;


typedef struct rest_recharge_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u8	status;// current status
	u32	balance;// current balance
	u64	expiredTime;// expired time
}_rest_recharge_rsp;


typedef struct rest_transfer_req
{
	char	transferOutMsisdn[24];
	char	transferInMsisdn[24];

	u32	amount;// mandatory
}_rest_transfer_req;


typedef struct rest_transfer_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u32	balance;
}_rest_transfer_rsp;


typedef struct rest_recharge_card_req
{
	char	msisdn[24];

	char	cardPwd[32];// rechare card password
	//u32	amount;// mandatory, add to balance
}_rest_recharge_card_req;


typedef struct rest_recharge_card_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u32	rechargeAmount;// mandatory, add to balance
	u32	balance;// current balance
	u64	expiredTime;// expired time
}_rest_recharge_card_rsp;


typedef struct rest_check_balance_req
{
	char	msisdn[24];

	u32	amount;// mandatory
}_rest_check_balance_req;


typedef struct rest_check_balance_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u8	available;// 0: enough balance; 1: else
}_rest_check_balance_rsp;


typedef struct rest_query_balance_req
{
	char	msisdn[24];
}_rest_query_balance_req;


typedef struct rest_query_balance_rsp
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	u8    status;// use ACCT_STATUS
	u32	balance;// current balance
	u32 mo_expiry;	
}_rest_query_balance_rsp;

typedef struct rest_sms_deliver_req
{
	char	msisdn[24];
	u16   sms_len;
	char	sms_content[MAX_BODY_LEN];
}_rest_sms_deliver_req;

typedef struct rest_sms_deliver_res
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_sms_deliver_res;

typedef struct rest_create_acct_req
{
	char	msisdn[24];
	u32  customer_id;
	u32  account_id;
	u32  product_id;
	u32  plan_id;  /* basic plan */
	u8    user_class;	
	u32  balance;
	u32  expiry_date;
	u32	 rent_charge;	
	u32  birthday;
	u32  cug_id;
}_rest_create_acct_req;

typedef struct rest_create_acct_res
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_create_acct_res;

typedef struct rest_query_tariff_req
{
	char msisdn[24];
	u8	service_type; /*0=mo call, 1=mt call, 2=sms, 3=data */
	char	called_number[24];
}_rest_query_tariff_req;

typedef struct rest_query_tariff_res
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
	char prefix[24];
	u32  unit_time;
	u32  unit_charge;
	u32  discount;
	u32  plan_id;
	u32  bundle_plan_id;
	u64  total_plan_value;
	u64  used_plan_value;	
}_rest_query_tariff_res;

typedef struct rest_update_subs_req
{
	u32	optional_flag;
	char msisdn[24];
	u32 account_id;
	u8	status; 			/*falg=1*/
	u32	balance;
	u32  balance_expiry_date;
	u32	basic_plan_id;
	u32	basic_plan_rent;	
	u8	vas_cug_status;	
}_rest_update_subs_req;

typedef struct rest_update_subs_res
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_update_subs_res;

typedef struct rest_delete_subs_req
{
	char msisdn[24];
	u8	cause; 
}_rest_delete_subs_req;

typedef struct rest_delete_subs_res
{
	u8	optional_flag;
	u8	result;
	u32	error_code;
}_rest_delete_subs_res;

typedef struct rest_update_sess_info_req
{
	u32	optional_flag;			/*bit 0=called, 1= ue_ip, 2=pgw ip */
	char msisdn[24];
	u8   first_sess;				/*if 1 then clear all session in database */
	u8	service_type; 			/*0=mo call, 1=mt call, 2=mo sms, 3= data*/
	u32	start_time;
	u32  consumed_value;		/*duration of call, bytes of data */
	char called[24];				/*for call/sms */
	u32	ue_ip;
	u32  gw_ip;					
}_rest_update_sess_info_req;

typedef struct rest_update_plan_info_req
{
	u32	optional_flag;			/*bit 0=called, 1= ue_ip, 2=pgw ip */
	char msisdn[24];
	u8	service_type; 			/*0=mo call, 1=mt call, 2=mo sms, 3= data*/
	u32  account_id;
	u32  plan_id;
	u32  bundle_id;
	u64  plan_total_value;
	u64  plan_used_value;
	u32  sess_update_times;
	u64  this_time_add_value;
}_rest_update_plan_info_req;

typedef struct rest_rent_charge_req
{
	u32	optional_flag;			
	char msisdn[24];
	u32  balance;
	u32 rent_charge;
}_rest_rent_charge_req;



//======================================

typedef struct rest_msg_s
{
	u8	msg_type;
	_rest_header header;	
	union	
	{
		_rest_query	query;
		_rest_query_res	query_res;
		_rest_topup	topup;
		_rest_topup_res	topup_res;

        _rest_order order;
        _rest_order_res order_res;
        _rest_freeresource free_resource;
        _rest_freeresource_res free_resource_res;
        _rest_downloadApp downloadApp;
        _rest_downloadApp_res downloadApp_res;
		_rest_channel	chnl;
		_rest_channel_res chnl_res;
        _rest_offerChange offerChange;
        _rest_offerChange_res offerChange_res;
        _rest_queryPoint queryPoint;
        _rest_queryPoint_res queryPoint_res;
        _rest_transferPoint transferPoint;
        _rest_transferPoint_res transferPoint_res;
        
        // for selfcare
		_rest_send_authcode_req send_authcode_req;
		_rest_send_authcode_rsp send_authcode_rsp;
		_rest_query_user_data_req query_user_data_req;
		_rest_query_user_data_rsp query_user_data_rsp;
		_rest_bundle_subs_req bundle_subs_req;
		_rest_bundle_subs_rsp bundle_subs_rsp;
		_rest_bundle_usage_req bundle_usage_req;
		_rest_bundle_usage_rsp bundle_usage_rsp;
		_rest_recharge_req recharge_req;
		_rest_recharge_rsp recharge_rsp;
		_rest_transfer_req transfer_req;
		_rest_transfer_rsp transfer_rsp;
		_rest_recharge_card_req recharge_card_req;
		_rest_recharge_card_rsp recharge_card_rsp;
		_rest_check_balance_req check_balance_req;
		_rest_check_balance_rsp check_balance_rsp;
		_rest_query_balance_req query_balance_req;
		_rest_query_balance_rsp query_balance_rsp;
		//
		_rest_sms_deliver_req sms_deliver;
		_rest_sms_deliver_res sms_deliver_res;

		_rest_create_acct_req create_acct;
		_rest_create_acct_res create_acct_res;

		_rest_query_tariff_req  query_tariff;
		_rest_query_tariff_res   query_tariff_res;

		_rest_update_subs_req  update_subs;
		_rest_update_subs_res   update_subs_res;

		_rest_delete_subs_req  delete_subs;
		_rest_delete_subs_res   delete_subs_res;

		_rest_update_sess_info_req  update_sess_info;

		_rest_update_plan_info_req   update_plan_info;

		_rest_rent_charge_req	rent_charge;
		
		
	}msg;
}_rest_msg_s;

int encode_rest_query(_rest_msg_s *ptr, u8 *buf);

int encode_rest_query_res(_rest_msg_s *ptr, u8 *buf);

int encode_rest_topup(_rest_msg_s *ptr, u8 *buf);

int encode_rest_topup_res(_rest_msg_s *ptr, u8 *buf);

int decode_rest_api_msg(u8 *buf, int len, _rest_msg_s *ptr);

// for selfcare======================================
int encode_rest_send_authcode_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_send_authcode_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_query_user_data_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_query_user_data_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_bundle_subs_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_bundle_subs_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_bundle_usage_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_bundle_usage_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_recharge_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_recharge_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_transfer_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_transfer_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_recharge_card_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_recharge_card_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_check_balance_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_check_balance_rsp(_rest_msg_s *ptr, u8 *buf);
int encode_rest_query_balance_req(_rest_msg_s *ptr, u8 *buf);
int encode_rest_query_balance_rsp(_rest_msg_s *ptr, u8 *buf);
//

// for restproxy=====================================
#define YX_USSD_MENU_MAIN 0
#define YX_USSD_MENU_UNLIMITED_ONCE_RECUR 1
#define YX_USSD_MENU_PRESS_ZED_DATA 2
#define YX_USSD_MENU_PRESS_ZED_VOICE 3
#define YX_USSD_MENU_PRESS_MIFI_AND_ROUTER 4
#define YX_USSD_MENU_PRESS_INPUT_NO 5
#define YX_USSD_MENU_PRESS_BALANCE_CHECK 6
#define YX_USSD_MENU_PRESS_AMA 7
#define YX_USSD_MENU_PRESS_UNLIMITED_BUNDLES 8
#define YX_USSD_MENU_PRESS_PURCHASE_AIRTIME 9
#define YX_USSD_MENU_DATA_24HRS 10
#define YX_USSD_MENU_DATA_7DAYS 11
#define YX_USSD_MENU_DATA_30DAYS 12
#define YX_USSD_MENU_VOICE_DAILY 13
#define YX_USSD_MENU_VOICE_WEEKLY 14
#define YX_USSD_MENU_VOICE_MONTHLY 15
#define YX_USSD_MENU_MIFI_SUB 16
#define YX_USSD_MENU_BUY_FOR_OTHER 17
#define YX_USSD_MENU_SELECT_PROVIDER 18
#define YX_USSD_MENU_ENTER_PAY_NUMBER 19
#define YX_USSD_MENU_SELECT_MONEY 20
#define YX_USSD_MENU_PAID_MONEY 21
#define YX_USSD_MENU_SELECT_MOBIL_MONEY 22
#define YX_USSD_MENU_SUBSCRIB_COMPLETE 23
#define YX_USSD_MENU_CANCEL_RENEWAL 24
#define YX_USSD_MENU_AIRTIME_AMOUNT 25
#define YX_USSD_MENU_AIRTIME_NO 26
#define YX_USSD_MENU_DIBAAMA 27
#define YX_USSD_MENU_DIBA 28
#define YX_USSD_MENU_MOMO_PIN 29
#define YX_USSD_MENU_PROMO 30
#define YX_USSD_MENU_QUERY_POINT 31
#define YX_USSD_MENU_CUR_POINT 32
#define YX_USSD_MENU_POINT2NUM 33
#define YX_USSD_MENU_OFFER_CHANGED 34
#define YX_USSD_MENU_POINT_TRANSFERED 35
#define YX_USSD_MENU_POINT_LOW 36
#define YX_USSD_MENU_OFFER_OUT 37
#define YX_USSD_MENU_POINT_TRANS_FAIL 38
#define YX_USSD_MENU_SHARE_NBR 39
#define YX_USSD_MENU_NUM_MAX 64
extern char yx_ussd_menu[YX_USSD_MENU_NUM_MAX][512];
#define YX_USSD_CHNL_NUM_MAX 16
extern char yx_chnl_info[YX_USSD_CHNL_NUM_MAX][128];

#define YX_MOBILE_MONEY_MAX 8
#define YX_OFFER_TYPE_MAX 10
#define YX_OFFER_TYPE_BUNDLE 0
#define YX_OFFER_TYPE_DATA_1 1
#define YX_OFFER_TYPE_DATA_2 2
#define YX_OFFER_TYPE_DATA_3 3
#define YX_OFFER_TYPE_VOICE_1 4
#define YX_OFFER_TYPE_VOICE_2 5
#define YX_OFFER_TYPE_VOICE_3 6
#define YX_OFFER_TYPE_MIFI_1 7
#define YX_OFFER_TYPE_AMA_1 8
#define YX_OFFER_TYPE_DIBA_1 9
#define YX_OFFER_PER_TYPE 12

int pps_third_party_plan_process(u_short portid);
int pps_third_party_channel_process(u_short portid);
int match_channel_info(char *sc, char *url);

//

#endif
