com.objectxp.mms.transport
Class PPPDialup

java.lang.Object
  extended bycom.objectxp.mms.transport.PPPDialup
All Implemented Interfaces:
java.lang.Runnable, Transport

public class PPPDialup
extends java.lang.Object
implements Transport, java.lang.Runnable

This class can be used to establish a PPP connection over which the MMSC can be reached. Depending on the type of your Operating System, PPP connectivity is either reached through the BSD PPP daemon (on Unix Systems) or RAS (Windows).

See the init(Properties) section for details about the OS-specific configuration.

Note: PPPDialup does not deblock pin-code protected SIM-Cards. To activate a protected SIM-Card, open a GsmSmsService first and close it again.


Field Summary
static java.lang.String BSD_PEER_FILE
          BSD_PEER_FILE is the name of the constant holding the value "ppp.bsd.peerfile".
static java.lang.String BSD_PPP_CONNECTION_ESTABLISHED
          BSD_PPP_CONNECTION_ESTABLISHED is the name of the constant holding the value "ppp.bsd.connection.established".
static java.lang.String BSD_PPP_DEAMON
          BSD_PPP_DEAMON is the name of the constant holding the value "ppp.bsd.daemon".
static java.lang.String OPERATING_SYSTEM
          OPERATING_SYSTEM is the name of the constant holding the value "ppp.os".
static java.lang.String RAS_DIALUP_ENTRY
          RAS_DIALUP_ENTRY is the name of the constant holding the value "ppp.ras.dialup.entry".
static java.lang.String RAS_GATEWAY
          RAS_GATEWAY is the name of the constant holding the value "ppp.ras.addroute".
static java.lang.String RAS_INTERFACE
          RAS_INTERFACE is the name of the constant holding the value "ppp.ras.interface".
static java.lang.String RAS_MODEM
          RAS_MODEM is the name of the constant holding the value "ppp.ras.modem".
static java.lang.String RAS_PASSWORD
          RAS_PASSWORD is the name of the constant holding the value "ppp.ras.password".
static java.lang.String RAS_PHONE_NUMBER
          RAS_PHONE_NUMBER is the name of the constant holding the value "ppp.ras.phonenumber".
static java.lang.String RAS_USE_IFACE_FOR_ROUTE
          RAS_USE_IFACE_FOR_ROUTE is the name of the constant holding the value "ppp.ras.search.iface".
static java.lang.String RAS_USER
          RAS_USER is the name of the constant holding the value "ppp.ras.user".
static java.lang.String TIMEOUT
          TIMEOUT is the name of the constant holding the value "ppp.timeout".
 
Constructor Summary
PPPDialup()
           
 
Method Summary
 void close()
          Close the PPP connection.
 void init(java.util.Properties serialProperties)
          Initialize the PPP Transport implementation.
 boolean isConnected()
          Determine if the connection to the MMSC is currently established.
 void open()
          Start the PPP connection.
 void run()
          Observe the PPP connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMEOUT

public static final java.lang.String TIMEOUT
TIMEOUT is the name of the constant holding the value "ppp.timeout".

See Also:
Constant Field Values

OPERATING_SYSTEM

public static final java.lang.String OPERATING_SYSTEM
OPERATING_SYSTEM is the name of the constant holding the value "ppp.os".

See Also:
Constant Field Values

BSD_PEER_FILE

public static final java.lang.String BSD_PEER_FILE
BSD_PEER_FILE is the name of the constant holding the value "ppp.bsd.peerfile".

See Also:
Constant Field Values

BSD_PPP_DEAMON

public static final java.lang.String BSD_PPP_DEAMON
BSD_PPP_DEAMON is the name of the constant holding the value "ppp.bsd.daemon".

See Also:
Constant Field Values

BSD_PPP_CONNECTION_ESTABLISHED

public static final java.lang.String BSD_PPP_CONNECTION_ESTABLISHED
BSD_PPP_CONNECTION_ESTABLISHED is the name of the constant holding the value "ppp.bsd.connection.established".

See Also:
Constant Field Values

RAS_DIALUP_ENTRY

public static final java.lang.String RAS_DIALUP_ENTRY
RAS_DIALUP_ENTRY is the name of the constant holding the value "ppp.ras.dialup.entry".

See Also:
Constant Field Values

RAS_INTERFACE

public static final java.lang.String RAS_INTERFACE
RAS_INTERFACE is the name of the constant holding the value "ppp.ras.interface".

See Also:
Constant Field Values

RAS_PHONE_NUMBER

public static final java.lang.String RAS_PHONE_NUMBER
RAS_PHONE_NUMBER is the name of the constant holding the value "ppp.ras.phonenumber".

See Also:
Constant Field Values

RAS_MODEM

public static final java.lang.String RAS_MODEM
RAS_MODEM is the name of the constant holding the value "ppp.ras.modem".

See Also:
Constant Field Values

RAS_PASSWORD

public static final java.lang.String RAS_PASSWORD
RAS_PASSWORD is the name of the constant holding the value "ppp.ras.password".

See Also:
Constant Field Values

RAS_USER

public static final java.lang.String RAS_USER
RAS_USER is the name of the constant holding the value "ppp.ras.user".

See Also:
Constant Field Values

RAS_GATEWAY

public static final java.lang.String RAS_GATEWAY
RAS_GATEWAY is the name of the constant holding the value "ppp.ras.addroute".

See Also:
Constant Field Values

RAS_USE_IFACE_FOR_ROUTE

public static final java.lang.String RAS_USE_IFACE_FOR_ROUTE
RAS_USE_IFACE_FOR_ROUTE is the name of the constant holding the value "ppp.ras.search.iface".

See Also:
Constant Field Values
Constructor Detail

PPPDialup

public PPPDialup()
Method Detail

open

public void open()
          throws java.io.IOException,
                 TransportException
Start the PPP connection.

Specified by:
open in interface Transport
Throws:
java.io.IOException - if an I/O error occurs.
TransportException - if the PPP connection cannot be established.

close

public void close()
           throws java.io.IOException
Close the PPP connection.

Specified by:
close in interface Transport
Throws:
java.io.IOException - if an I/O error occurs.

init

public void init(java.util.Properties serialProperties)
          throws TransportException
Initialize the PPP Transport implementation. Please make sure that the user who is running jSMS is privileged to use PPP.

General Properties

Property Description
mms.transport.ppp.timeout number of seconds to wait for the PPP connection to be ready
mms.transport.ppp.os Override the autodetection of your Operating System.

Set this property to [WIN] for a system which is using a RAS dialer
Set this property to [LINUX], [UNIX] or [OSX] if your system provides a BSD PPP daemon.

BSD PPPD Properties

Property Description
mms.transport.ppp.bsd.peerfile Name of the PPP peer file in use (usually located in /etc/ppp/peers/).
mms.transport.ppp.bsd.daemon Location of the pppd Executable. Defaults to "/usr/sbin/pppd".
ppp.bsd.connection.established Part of a string that the PPP daemon writes to stdout when the PPP connection is established. jSMS will wait until it sees this string from pppd before continuing its work. Defaults to "remote IP address"

RAS Properties

For GPRS connections, please make sure you have configured your modem with the required GPRS initialization command <AT+CGDCONT=1,"IP","<accessPointName>"> as described in the jSMS Users Guide.

Property Description
mms.transport.ppp.ras.user Username for authenticating the PPP peer. If unset, authentication is not required.
mms.transport.ppp.ras.password Password for authenticating the PPP peer.
mms.transport.ppp.ras.modem Name of the modem you are using to establish a PPP connection.
mms.transport.ppp.ras.interface Name of the RAS interface which will be registered once the PPP connection has been established.

If you don't yet know the name of the RAS interface, just skip this entry and run the MMS "SendExample" that comes with jSMS. Running this example creates a new RAS Dialup entry named "jSMS-Dialup" which will be listed under "Network Connections" in your Control Panel. Next, invoke the command "route print" in a Command Prompt window, then start the "jSMS-Dialup" connection and invoke "route print" again after the PPP connection has been established. The RAS interface name can now be determined by looking at the "Interface List" output of the "route print" command.

mms.transport.ppp.ras.dialup.entry Name of the RAS Dialup entry to use for establishing a PPP connection. If you leave this property empty, jSMS will automatically create and use a RAS Dialup entry called "jSMS-Dialup". Do not reconfigure this entry since the changes will be overwritten by jSMS.
mms.transport.ppp.ras.addroute IP address of a router/gateway that must be used for reaching the MMSC. If set, jSMS will add a route to the MMSC using the given address as a gateway.
ppp.ras.use_iface_for_route If this property is set to "true", jSMS will look for the name/number of the PPP interface and will use this information when adding a route to the MMSC. Defaults to "false".

Specified by:
init in interface Transport
Parameters:
serialProperties - Configuration Properties.
Throws:
TransportException - if initialisation fails.

isConnected

public boolean isConnected()
Description copied from interface: Transport
Determine if the connection to the MMSC is currently established.

Specified by:
isConnected in interface Transport
Returns:
true if transport layer is connected, false otherwise.

run

public void run()
Observe the PPP connection.

Specified by:
run in interface java.lang.Runnable


object XP, Inc. © 2000-2007. All rights reserved object XP