Examples of KannelHTTPGateway


Examples of org.smslib.http.KannelHTTPGateway

    GatewayStatusNotification statusNotification = new GatewayStatusNotification();
    OutboundMessage msg;
    System.out.println("Example: Send message through Kannel HTTP Interface.");
    System.out.println(Library.getLibraryDescription());
    System.out.println("Version: " + Library.getLibraryVersion());
    KannelHTTPGateway gateway = new KannelHTTPGateway("mysmsc", "http://localhost:13013/cgi-bin/sendsms", "simple", "elpmis");
    // Uncomment in order gateway to start and stop SMSC automatically on Kannel
    //gateway.setAutoStartSmsc(true);
    //gateway.setAutoStopSmsc(true);
    // Set Kannel's Admin URL and password to be used starting, stopping and checking SMSC status  
    gateway.setAdminUrl("http://localhost:13000");
    gateway.setAdminPassword("bar");
    gateway.setOutbound(true);
    Service.getInstance().addGateway(gateway);
    Service.getInstance().setGatewayStatusNotification(statusNotification);
    Service.getInstance().startService();
    // Send a message.
    msg = new OutboundMessage("+967712831950", "Hello from SMSLib (Kannel handler)");
View Full Code Here

Examples of org.smslib.http.KannelHTTPGateway

  public void create() throws Exception
  {
    String propName;
    propName = getGatewayId() + ".";
    Properties properties = getProperties();
    KannelHTTPGateway gateway = new org.smslib.http.KannelHTTPGateway(getGatewayId(), properties.getProperty(propName + "url"), properties.getProperty(propName + "username"), properties.getProperty(propName + "password"));
    setGateway(gateway);
    gateway.setAdminUrl(properties.getProperty(propName + "adminurl"));
    gateway.setAdminPassword(properties.getProperty(propName + "adminpassword"));
    gateway.setStatusPassword(properties.getProperty(propName + "statuspassword"));
    if ("yes".equalsIgnoreCase(properties.getProperty(propName + "outbound"))) gateway.setOutbound(true);
    else if ("no".equalsIgnoreCase(properties.getProperty(propName + "outbound"))) gateway.setOutbound(false);
    else throw new Exception("Incorrect parameter: " + propName + "outbound");
    if ("yes".equalsIgnoreCase(properties.getProperty(propName + "autostartsmsc"))) gateway.setAutoStartSmsc(true);
    if ("yes".equalsIgnoreCase(properties.getProperty(propName + "autostopsmsc"))) gateway.setAutoStopSmsc(true);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.