C H A P T E R  8

Outgoing Push Messages

Push technology makes it possible for subscribers to receive the link to content without first having to request it from their device. Push technology can also be used to push content directly to a device. Sun Java System Content Delivery Server supports WAP push, SMS, and SMTP push formats for messages, and SMS and MMS push for content.

The Messaging Service pushes messages and content to subscribers. A push sender adapter serves as the interface between Content Delivery Server and your push implementation for delivering messages and content. Configure the Messaging Service to use the push sender adapters that you need.

The push sender adapters provided with Content Delivery Server are described in the following sections. If these adapters do not provide the functionality that you need, you can create your own push sender adapter using the Messaging API. See the Sun Java System Content Delivery Server Customization Guide for information on this API.

This chapter contains the following topics:


8.1 Push Sender Adapters

Content Delivery Server provides adapters for SMS, WAP, and SMTP push formats for messages. Several SMS formats are supported.

Delivery of binary content using either MMS or SMS is supported, but you must write your own adapter for each delivery method that you want to use.

8.1.1 SMS Push for Messages

Content Delivery Server supports the following SMS push protocols: Short Message Peer-to-Peer (SMPP) version 3.4, SMS HTTP, and Computer Interface to Message Distribution (CIMD2). Configure the Messaging Service for the protocol that you use.

8.1.1.1 Setting Up Support for SMPP

1. Install the SMPP API library version 0.3.7 on the server on which the Messaging Service is running.

This library is available from SourceForge.net.

a. Download the file http://downloads.sourceforge.net/smppapi/smppapi-0.3.7.tar.gz.

Save this file in a temporary location.

b. Extract the file smppapi-0.3.7/lib/smppapi-0.3.7.jar from the file just downloaded.

c. Copy the smppapi-0.3.7.jar file to the $CDS_HOME/deployment/deployment-name/lib/external directory.

d. If you are using the Sun Java System Application Server, add $CDS_HOME/deployment/deployment-name/lib/external/smppapi-0.3.7.jar to the CLASSPATH using one of the following methods:

2. Open the MsgService.properties file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

3. Set the SMS properties as needed for your environment.

The following code shows the properties for a sample SMPP Push adapter.


smsc.hostname = 127.0.0.1
smsc.port = 11111
esme.system_id=user1
esme.password = usrpw
esme.system_type =
esme.destination=
smsc.gsm.ton = 2
smsc.gsm.npi = 0

4. Set the push sender properties as needed for your environment.

The following code shows the properties for a sample SMPP Push adapter.


pushsender.send.keep_alive=true
pushsender.keep_alive.milliseconds=30000

5. (Optional) Set the properties used to categorize the outgoing message from the server.

The SMSC can use these properties for billing or for other purposes. If a value is not set for a service type, the value of the default.service_type property is used.


subscriber_detail_url.service_type=
mobile_originated_detail_url.service_type=
gifting_detail_url.service_type=
content_sharing_detail_ur.service_type=
password_reminder.service_type=
campaign_message.service_type=
default.service_type= 

6. Save your changes to the MsgService.properties file.

7. Register your adapter in the pushsenderfactory.xml file.

When you have your own SMSC, specify the following class as your adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.


com.sun.content.server.smpp34impl.msgserver.push.SMSPushMsgSender 

8.1.1.2 Setting Up Support for SMS HTTP

1. Open the MsgService.properties file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

2. Set the SMS properties as needed for your environment.

The following code shows the properties for a sample SMS HTTP Push adapter.


# SMS HTTP properties
cds.sms.http.serverurl=
cds.sms.http.user=
cds.sms.http.password=
cds.sms.http.from=CDS



Note - For SMS HTTP, your parameter names might be different than the defaults provided. If the SMSC that you use requires parameters different than those supported by this adapter, you must write your own adapter using the Messaging API. For information on this API, see the Sun Java System Content Delivery Server Customization Guide.


The following properties specify the names of the HTTP parameters to be passed in the SMS message.


cds.sms.attribname.userid
cds.sms.attribname.password
cds.sms.attribname.from
cds.sms.attribname.msg
cds.sms.attribname.to

For example, if the SMSC uses the HTTP parameter smsfrom to identify where the message is from, set cds.sms.attribname.from to smsfrom. The values must not be null or blank.

3. Save your changes to the MsgService.properties file.

4. Register your adapter in the pushsenderfactory.xml file.

When you are using HTTP for your SMS services, specify the following class as your adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.


com.sun.content.server.messagingservice.msgserver.push.HTTPSMSPushMsgSender

8.1.1.3 Setting Up Support for CIMD2

1. Open the MsgService.properties file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

2. Set the SMS properties as needed for your environment.

The following code shows the properties for a sample CIMD2 Push adapter.


smsc.hostname = 127.0.0.1
smsc.port = 11111
esme.system_id=user1
esme.password = usrpw

3. Save your changes to the MsgService.properties file.

4. Register your adapter in the pushsenderfactory.xml file.

When the SMSC that you use supports the CIMD2 protocol, specify the following class as your adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.


com.sun.content.server.messagingservice.msgserver.push.SMSCIMD2PushMsgSender 

8.1.2 WAP Push for Messages

This adapter supports push delivery using WAP push. To configure the Messaging Service for WAP Push support, follow these steps:

1. Open the MsgService.properties file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

2. Set the WAP and PPG properties as needed for your environment, for example:


#WAP and PPG properties
asyncmsg.wap.ppg=
asyncmsg.wap.id=CDS
asyncmsg.wap.ip.bearer=
asyncmsg.wap.priority=high 
asyncmsg.wap.bearer_type=SMS 
asyncmsg.wap.bearer_required=false 
asyncmsg.wap.delivery_method=unconfirmed
asyncmsg.wap.network_type=GSM
asyncmsg.wap.netwok_required=true

3. Save your changes to the MsgService.properties file.

4. Register your adapter in the pushsenderfactory.xml file.

Use the class com.sun.content.server.messagingservice.msgserver.push.WAPPushMsgSender as your adapter. Specify this adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.

5. If your WAP push proxy gateway (PPG) requires attributes other than those currently included in the message template, you must update the wap_push_msg_template.xsl file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

8.1.3 SMTP Push for Messages

This adapter supports push delivery using SMTP. Use the class com.sun.content.server.messagingservice.msgserver.push.SMTPPushMsgSender as your adapter. Specify this adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.

8.1.4 SMS Push for Binary Content

If you want to push binary content to devices, you must create your own adapter using the Messaging API. Use the push category to determine whether binary content or a message is sent. The constant PUSH_CONTENT_BINARY_CATEGORY defined in the PushConstants class identifies messages that contain binary content. See the Sun Java System Content Delivery Server Customization Guide for information on the Messaging API and the PushConstants class.

If you write your own adapter, specify this adapter in the pushsenderfactory.xml file as described in Section 8.2, Using a Push Adapter.


8.2 Using a Push Adapter

The pushsenderfactory.xml file is used to register push sender adapters. As shown in the following code example, the pushmsgsender properties must include the fully qualified name of the push adapter class and the protocol that the adapter supports.

The following sample registers an adapter for each type of push sender supported.


CODE EXAMPLE 8-1 Sample pushsenderfactory.xml File
<pushmsgsenderset>
  <pushmsgsender0
    class= 
"com.sun.content.server.messagingservice.msgserver.push.TestSMSPushMsgSenderImpl"
    protocol="sms"/>
  <pushmsgsender1
    class=
"com.sun.content.server.messagingservice.msgserver.push.WAPPushMsgSender"
    protocol="wap"/>
  <pushmsgsender2
    class=
"com.sun.content.server.messagingservice.msgserver.push.SMTPPushMsgSender"
    protocol="smtp"/>
  <pushmsgsender3 
    class=
"com.sun.content.server.messagingservice.msgserver.push.MMSPushMsgSender"
    protocol="mms"/>
</pushmsgsenderset>

To specify the push sender adapters that you want to use, follow these steps:

1. Register the adapters with Content Delivery Server.

To register the adapters, create an XML file named pushsenderfactory.xml in the $CDS_HOME/deployment/deployment-name/conf directory. Only one SMS push adapter can be specified.

See CODE EXAMPLE 8-1 for an example of this file.

2. Include the adapter class and any dependent classes in your classpath.

3. Save the pushsenderfactory.xml file.


8.3 Configuring the SMS Push Message

The default SMS push message contains a message from Content Delivery Server and the URL for the content to be downloaded, for example:


Download: Application Name
http://servername:port/subscriber/main/ddd?subid=101&riid=115

If the length of the message sent causes a problem, you can limit this message to just the message from Content Delivery Server or just the URL. Edit the template sms_push_msg_template.xsl found in the $CDS_HOME/deployment/deployment-name/conf directory.

The following code shows a sample template.


1. <?xml version=”1.0” ?> 
2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3. version=”1.0”>
4. <xsl:output method="text" indent="yes" /> 
5. <xsl:template match="/">
6. <xsl:value-of select="/SMSMessage/MESSAGE" /> 
7. <xsl:value-of select="/CDSSMSMessage/HREF" /> 
8. </xsl:template>
9. </xsl:stylesheet>

To limit the message to just the message from Content Delivery Server, remove line 7. To limit the message to just the URL, remove line 6.


8.4 Configuring Support for MMS

To have Content Delivery Server deliver content by MMS, you must configure the MMS messaging properties in the VSAdminConsole.properties, SubscriberPortal.properties, and MsgService.properties files. The Multimedia Message Service Center (MMSC) processes the MMS message based on the values that you enter for the properties. The MMS messaging properties and their values are described in TABLE 8-1.

1. Edit the VSAdminConsole.properties and the SubscriberPortal.properties files.

These files are in the $CDS_HOME/deployment/deployment-name/conf directory.

2. Set the following MMS messaging properties in each of the two files, so that the values match.

The following code shows sample settings for MMS support.


mms_smil.template.filename=mms_smil_template.xsl
mms.message.class=AUTO
mms.message.priority=NORMAL
mms.message.sender.visibility=SHOW
mms.message.read_report_required=true
mms.message.delivery_report_required=true
admin.mms.from.address=address@host.com

3. Set the following additional property in the SubscriberPortal.properties file, for example:

mms.fallback.pushtype=sms

Note that the service that you specify must also be configured for Content Delivery Server. For more information on configuring SMS or WAP, see Chapter 10.

4. Edit the MsgService.properties file.

This file is in the $CDS_HOME/deployment/deployment-name/conf directory.

5. Set the full class name for the MMS sender class, for example:


mms.senderclass=
    com.sun.content.server.messagingservice.msgserver.push.TestMMSSenderImpl

The following table describes the properties for MMS messages.


TABLE 8-1 MMS Messaging Properties

MMS Property Name

Description

admin.mms.from.address

The email address or phone number used to send MMS content.

mms.fallback.pushtype

Identifies an alternate mechanism to push the message if MMS is not used. The following values are valid:

  • sms - Short message service (default)
  • wap - Wireless application protocol

The alternate mechanism must be configured for

Content Delivery Server. See Chapter 10 for more information.

mms.message.class

Provides the MMSC with categories for the messages. The following values are valid:

  • ADVERTISEMENT
  • AUTO (default)
  • INFORMATIONAL
  • PERSONAL

mms.message.delivery_report_required

Indicates if a delivery report is expected from the subscriber’s device. The following values are valid:

  • true - Requires that a delivery report be received from the subscriber’s device. This is the default.
  • false - Does not require a delivery report. For example, messages that are sent to subscribers as part of a promotional campaign could have this property set to false.

mms.message.priority

Provides the MMSC with priority levels for messages. The following values are valid:

  • HIGH
  • NORMAL (default)
  • LOW

mms.message.read_report_required

Indicates if a message indicating that the message has been read is expected from the subscriber’s device. The following values are valid:

  • true - Requires that a read report be received from the subscriber’s device. This is the default.
  • false - Does not require a read report. For example, messages that are sent to subscribers as part of a promotional campaign could have this property set to false.

mms.message.sender.visibility

Indicates if the name of the message sender is displayed or hidden. The following values are valid:

  • HIDE - The name of the sender is be displayed in the MMS message.
  • SHOW - The name of the sender is displayed in the MMS message. This is the default.

mms.senderclass

The full name of the class that implements the MMSSender class. The MMSSender class can be found in the cdsapi module.

mms_smil.template.filename

The name of the XSL template that is used to create the Synchronized Multimedia Integration Language (SMIL) data. The value of this property is expressed as the name of the template file and its path, relative to the conf directory.