使用SMPP发送短信

时间:2019-12-23 22:04:28

标签: java core smpp jsmpp

我正在为我的项目配置SMPP以下是我的程序

    System.out.println("Example: Send/Receive message through SMPP using JSMPP.");
    System.out.println(Library.getLibraryDescription());
    System.out.println("Version: " + Library.getLibraryVersion());

    PropertyConfigurator.configure("log4j.properties");
    logger.info("Hi Logger");


    JSMPPGateway gateway = new JSMPPGateway("smppcon", smppIp, port, new BindAttributes(username, password, "cp", BindType.TRANSCEIVER));
    Service.getInstance().addGateway(gateway);
    Service.getInstance().setInboundMessageNotification(new InboundNotification());
    Service.getInstance().setGatewayStatusNotification(new GatewayStatusNotification());
    Service.getInstance().setOutboundMessageNotification(new OutboundNotification());
    Service.getInstance().startService();
    // Send a message.
    OutboundMessage msg = new OutboundMessage("+5016017235", "Hello from SMSLib and JSMPP");
    // Request Delivery Report
    msg.setStatusReport(true);
    Service.getInstance().sendMessage(msg);
    System.out.println(msg);
    System.out.println("Now Sleeping - Hit <enter> to terminate.");
    System.in.read();
    Service.getInstance().stopService();

当调试器到达Service.getInstance()。startService();行时在调试器上单击下一步后,指向startservice之后不会返回到下一行而不返回调试器

0 个答案:

没有答案