Setting up Answers Anywhere for SMS

Answers Anywhere uses CellularModemController (CMC) software to communicate with your SMS provider. CMC acts as an interface between the SMS service and Unwired Accelerator. The CMC software can be located on the same machine as Unwired Accelerator, or can be moved to a different machine.

To configure CMC, modify the CMCConfig.properties file, using command line options. To run the configuration file, use the run command, and to list available commands, use the run -help command.

The CMCConfig.properties file is located in SYBASE\UA80\cmc\classes\com\sybase\cellmodem.

If you want to move the CMC software to another machine, copy the CMCConfig.properties file to the new location.

NoteIf you set up multiple resources (RIDs) in Unwired Accelerator, you must configure a different instance of CMC for each resource. See the Chapter 5, “Resources” for information about setting up resources.

StepsConfiguring the CMC at the command line

This section describes how to configure the CMC at the command line.

  1. Configure CMC by entering commands and the command line in the following format:

    -optionName optionValue

    For example:

    -baudrate 9600
    

    See Table 3-2 for a partial list of commands. Use the run -help command to see a complete list of properties.

    Table 3-2: CMCConfig.properties file settings

    Option name

    Description

    Default value

    accessChecker

    Fully qualified class name that implements the interface: com.sybase.cellmodem.AccessChecker

    com.sybase.cellmodem.BlackWhite ListChecker

    accessLog.File

    Name of the file where access log data is kept.

    None. If no file is specified, no access log is maintained.

    accessLog.Request

    Boolean valued property (true or false). If true, the request body from each message received will be recorded in the access log.

    true

    accessLog.Response

    Boolean valued property (true or false). If true, the response body sent back to uses is included in the access log.

    true

    accessLogger

    Full qualified class name that implements the com.sybase.cellmodem.AccessLogger interface.

    com.sybase.cellmodem.AccessLogger Impl

    baudrate

    Integer valued property. Specifies the bits per second communication rate to use with the serial port to which the modem is connected.

    9600

    blacklistFile

    List of telephone numbers that are excluded from SMS service. When this list is specified and contains values, each message received is checked against the list. If the number is on the list, the message is not processed.

    None. The file should have at least one telephone number if used.

    config

    Name of a ResourceBundle or a java.util.Properties formatted file containing any of the command line options defined in this table. Any options specified explicitly on the command line take precedence over values contained in this file.

    com.sybase.cellmodem.CMCConfig

    The default package includes com/sybase/cellmodem/CMCConfig.properties file with default command line options. This file is packaged in the sybcmc.jar from which this entire package comes.

    databaseDriver

    Fully qualified class name of a java.sql.Driver implementation for connecting to a database.

    com.sybase.jdbc2.jdbc.SybDriver

    databasePwd

    Password to use when connecting to the database.

    SQL

    databaseURL

    JDBC URL to the database containing tables used by CMC.

    None.

    If this option is not specified, CMC does not attempt to connect to, or use any database.

    databaseUser

    User name to use when connecting to the database.

    dba

    httpAuthenticationURL

    When roleBasedAccess is true, and a user is trying to register their cell phone, Unwired Accelerator tests the user name and password against this URL.

    http://localhost:4040/dejima/protected/protected.jsp if you are using Tomcat.

    httpURL

    This is the HTTP URL that the HTTPClientMessageHandler class sends requests to with the request body message. This is the access point for Answers Anywhere processing.

    The sms.jsp page looks for an optional RID=<N> query parameter, where <N> is the resource ID number. For example, http://machine.sybase.com:4040/dejima/sms.jsp?rid=211. If this is not specified, the default RID configured in uadejima.properties is used.

    http://localhost:4040/dejima.sms.jsp if you are using Tomcat.

    initDatabase

    Boolean property (true or false).

    If set to true and the databaseURL is specified, CMC tries to create the tables it uses in the database. This command line option is generally used only once to initialize the database.

    false

    instanceName

    This is the name by which this instance of the CMC process and its modem are known. When you have more than one CMC, you must give each a distinct name, so the configuration data is kept separate and the respective access logs can be distinguished.

    When CMC is using a database, this name is used in searches and inserts.

    DefaultName

    interval

    Integer valued property. Specifies in milliseconds how frequently CMC checks for new messages from the modem, and processes responses to return to users.

    15000 (every 15 seconds)

    logFile

    Name of the error log for the CMC process. The name can have a pattern, as described in java.util.logging.FileHandler constructors.

    CMC%g.log

    logLevel

    This determines the minimum severity level of messages that are placed in the log file. Valid values are described in java.util.logging.Level.

    WARNING

    messageHandler

    Fully qualified class name that implements the com.sybase.cellmodem.MessageHandler interface.

    com.sybase.cellmodem.HTTPClient MessageHandler

    modemDriver

    Fully qualified class name that implements com.sybase.cellmodem.CellModem interface.

    com.sybase.cellmodem.CService Wrapper

    roleBasedAccess

    Boolean property (true or false).

    true – CMC attempts to match a sender’s phone number to a registered cell number in the user.cell_phone column of the portaldatabase. If a match is found, the login_name for that user is passed as a parameter to the httpURL for the Web application to use in applying access control.

    false – role-based access is not used.

    false

    serialPort

    The name of the serial port to which the modem is connected.

    com1

    simPin

    If the Subscriber Information Module (SIM) card in the modem requires a PIN to unlock it for use, specify that PIN with this property

    none

    smscPhone

    Usually a SIM card stores its own telephone number for the SMS Service Center it contacts to send SMS messages. To override this telephone number, enter it here.

    none

    whitelistFile

    List of telephone numbers that are allowed to use this SMS service. When this list is specified and contains values, each message received is checked against the list. If the number is not on the list, the message is not processed.

    None. The file should have at least one telephone number per line if used.

    maxResponseMessages

    For SMS messages that need to be parsed into 160 character message packages, indicates the maximum number of messages to send when splitting the response.

    1

    configInterval

    Number of millisecond periods that CMC should check for configuration changes.

    0 (never)

  2. Use the run.bat file, located in SYBASE\UA80\cmc\, to execute the program from a Command Prompt window.

  3. Check your configuration to make sure everything is set up correctly using this command from a Command Prompt window:

    run -logLevel FINEST
    

    The FINEST flag ensures you get the most output.

    You can also look in the CMC0.log file, located in SYBASE\UA80\cmc\, to see if the software is communicating with your cell modem properly.

    Common configuration problems include:

StepsConfiguring the CMC from the Admin GUI

An unsupported administrative graphical interface is also available for configuring CMC.

  1. To access the interface, open a Web Browser and enter this URL:

    http://hostname.domain:port/dejima/admin/home.jsp
    

    where:

    For example:

    http://labxp.sybase.com:4040/dejima/admin/home.jsp
    
  2. Log in using masuper/m8super.

  3. Configure the parameters, whitelist, and blacklist for your configuration. See Table 3-2 for values.

  4. Save your configuration.

See the “Answers Anywhere and SMS” for more information about the Admin GUI.

StepsSetting up CMC as a Windows service

This section describes how to set up CMC as a Windows service, so it runs automatically.

  1. Navigate to:

    SYBASE\UA80\cmc\conf

  2. Open the wrapper.conf file in a text editor.

  3. Search for the wrapper.java.command property, and modify the path to point to your Java installation. For example, if you installed Unwired Accelerator in SYBASE\UA80, set the property to:

    wrapper.java.command=%SYBASE%\jdk1.5.x\jre\bin\
    java
    
  4. Save and close the wrapper.conf file.

  5. Navigate to:

    SYBASE\UnwiredAccelerator\cmc\bin

  6. Execute the InstallCMC script. This creates a Windows service named SMSCellModemController that starts automatically when you reboot Windows.

  7. Execute the command net start SMSCellModemController to start the service, or use the Services console from Windows Explorer.

StepsRegistering with the SMS modem

Each user must register with the SMS modem by sending an SMS text message that includes user name and password to the SMS modem. Otherwise, SMS requests do not work. Develop a process for informing users how to register with the SMS modem. To register:

  1. Obtain the SMS modem number.

  2. Send an SMS text message with these three lines to the SMS modem number, substituting your Unwired Accelerator user name and password:

    Register
    <user name>
    <password>
    

    The user name and password values are entered in the portaldatabase table “users,” and the SMS modem number is entered in the “cell_phone_number” column.

    If role-based access is used (see Table 3-2 for information about the roleBasedAccess property), the CMC software checks the request to see whether the phone number for the requesting user is registered. If the number is not registered, the user is prompted to register it.