扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
package com.commerceware.cmpp; public class Test{ public void readPaME(conn_desc con) { cmppe_result cr = null; CMPP cp = new CMPP(); try{ cr = cp.readResPack(con); System.out.println("cr.pack_id=" + cr.pack_id); switch(cr.pack_id) { case CMPP.CMPPE_NACK_RESP: System.out.println("CMPP.CMPPE_NACK_RESP:get nack pack"); break; case CMPP.CMPPE_LOGIN_RESP: cmppe_login_result cl; cl = (cmppe_login_result)cr; System.out.println("CMPP.CMPPE_LOGIN_RESP:login resp: STAT = "+cl.stat); break; case CMPP.CMPPE_LOGOUT_RESP: System.out.println("CMPP.CMPPE_LOGOUT_RESP:logout resp: STAT = "+cr.stat); break; case CMPP.CMPPE_SUBMIT_RESP: System.out.println("CMPP.CMPPE_SUBMIT_RESP"); cmppe_submit_result sr; sr = (cmppe_submit_result)cr; cmppe_cancel cc1 = new cmppe_cancel(); //cc1.set_msgid(new String(sr.msg_id))); cc1.set_msgid(new String(sr.msg_id)); break; case CMPP.CMPPE_DELIVER: System.out.println("CMPP.CMPPE_DELIVER:deliver: STAT = 0"); cmppe_deliver_result cd= (cmppe_deliver_result)cr; cp.cmpp_send_deliver_resp(con,cd.seq,cd.stat); break; case CMPP.CMPPE_CANCEL_RESP: System.out.println("CMPP.CMPPE_CANCEL_RESP:cancel: STAT = " + cr.stat); break; case CMPP.CMPPE_ACTIVE_RESP: System.out.println("CMPP.CMPPE_ACTIVE_RESP:active resp: STAT " + cr.stat); break; default: break; } }catch(Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); System.out.println("have a exception"); try{ System.in.read(); }catch(Exception e1){} } } public static void main(String[] args) { if(args[0] == null || args[0].equals("") || args[0].length() != 11){ System.out.println("手机号码输入不正确"); return; } if(args[1] == null || args[0].equals("") || args[1].length() == 0){ System.out.println("没有输入短信内容"); return; } CMPP p = new CMPP(); Test t = new Test(); char test[] = new char[10]; byte short_msg[] = new byte[150]; byte buf[] = new byte[40]; byte b1[] = new byte[10]; cmppe_submit sub = new cmppe_submit(); cmppe_submit_result res =new cmppe_submit_result(); cmppe_cancel can = new cmppe_cancel(); byte icp_id[] = new byte[10]; //ICP隐藏 icp_id[0] =0x**; icp_id[1] =0x**; icp_id[2] =0x**; icp_id[3] =0x**; icp_id[4] =0x**; icp_id[5] =0x**; icp_id[6] = 0; byte svc_type[] = new byte[6]; svc_type[0] = 0x39; svc_type[1] = 0x34; svc_type[2] = 0x31; svc_type[3] = 0x30; svc_type[4] = 0; byte fee_type = 0; byte info_fee = 1; byte proto_id = 1; byte msg_mode = 1; byte priority =9; byte fee_utype = 2; byte fee_user[] = new byte[CMPP.CMPPE_MAX_MSISDN_LEN]; for(int i=0; i<12; i++) fee_user[0] = 0x31; fee_user[1] = 0x33; fee_user[2] = 0x38; fee_user[3] = 0x30; fee_user[4] = 0x35; fee_user[5] = 0x30; fee_user[6] = 0x30; fee_user[7] = 0x31; fee_user[8] = 0x30; fee_user[9] = 0x36; fee_user[10]= 0x34; fee_user[11]= 0x0; byte validate[] = new byte[10]; validate[0] =0; byte schedule[] = new byte[2]; schedule[0] =0; byte src_addr[] = new byte[12]; src_addr[0] = 0x31; src_addr[1] = 0x33; src_addr[2] = 0x38; src_addr[3] = 0x30; src_addr[4] = 0x35; src_addr[5] = 0x30; src_addr[6] = 0x30; src_addr[7] = 0x31; src_addr[8] = 0x30; src_addr[9] = 0x36; src_addr[10]= 0x34; src_addr[11]= 0x0; byte du_count = 1; byte dst_addr[][] = new byte[10][15]; dst_addr[0][0] = toHex(args[0].charAt(0)); //CMPPE_MAX_MSISDN_LEN+1 dst_addr[0][1] = toHex(args[0].charAt(1)); dst_addr[0][2] = toHex(args[0].charAt(2)); dst_addr[0][3] = toHex(args[0].charAt(3)); dst_addr[0][4] = toHex(args[0].charAt(4)); dst_addr[0][5] = toHex(args[0].charAt(5)); dst_addr[0][6] = toHex(args[0].charAt(6)); dst_addr[0][7] = toHex(args[0].charAt(7)); dst_addr[0][8] = toHex(args[0].charAt(8)); dst_addr[0][9] = toHex(args[0].charAt(9)); dst_addr[0][10]= toHex(args[0].charAt(10)); dst_addr[0][11]= 0x0; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者