|
|
|
|
|
Wireless Data Server 2.5 | Administrator's Guide |
| View in pdf format |
| Go to User's Guide |
Using another content service
In addition to its built-in calendar service, Wireless Data Server can also be configured to deliver content from other sources. This content must be in either plain text or XML format, delivered by SMTP, and must provide Wireless Data Server with certain information to specify the type of service from which the message originates, and the intended recipient of the message.
Sending information to Wireless Data ServerWireless Data Server accepts information from third-party content providers over SMTP. The sender must specify a valid MAIL FROM: value, and must supply the MSISDN number of the intended recipient on the RCPT TO: line.
Alternatively, you may choose to have your application invoke the smsnotify utility to deliver content to Wireless Data Server, in the same way that the calendar server calls smsnotify to deliver calendar notifications and reminders. For full details on the use and syntax of the smsnotify utility, see Appendix A, "Server parameters."
MIME headersBesides sender and recipient, you can pass to Wireless Data Server any other required information using MIME headers. Wireless Data Server processes these MIME headers into parameters that may be called in the stylesheet script. Non-standard MIME headers must be prefaced by X-.
For example, when the calendar server sends a notification to Wireless Data Server through smsnotify, it includes the MIME header X-Mobile-Device-Type, which specifies the type of mobile device the intended recipient of the message uses. The processing script, /etc/template/calendar_notif.xsl, calls this parameter through the following syntax:
- <xsl:param name="Mobile-Device-Type" select="'NOK.A61XX'"/>
Depending on the value of the Mobile-Device-Type parameter, Wireless Data Server then executes different sets of instructions for processing the input. The select value following the parameter name defines a default value for use when none is present in the message MIME headers.
XML input
XML input must be specified with the following MIME header:
- Content-Type: application/xml
You must specify the stylesheet Wireless Data Server uses to process each incoming message using two specific MIME headers: X-Service and X-Content. When these headers are present, Wireless Data Server will look in the /etc/config/wdstemplate.ini file for a section with the same title as the value of the X-Service header, and a parameter with the same name as the value of the X-Content header. If such a parameter exists, Wireless Data Server will use the stylesheet specified by this parameter to process the incoming message. By default, it expects this stylesheet to be in the /etc/template directory.
For example, to use the script /etc/template/nhl_scores.xsl to process an incoming message, you would first include the following lines in wdstemplate.ini:
- [Hockey]
- Scores = nhl_scores.xsl
By default, Wireless Data Server will look for the filename you specify within the /etc/template/ directory.
You must then ensure that all messages to be processed by this script include the following MIME headers:
- X-Service: Hockey
- X-Content: Scores
In the event that you need to pass your stylesheet further information, such as a specific team to include, simply include a new MIME header with your message, such as:
- X-Include-Team: Montreal
Inside your processing script, you would set an equivalent Include-Team parameter with the following line:
- <xsl:param name="Include-Team"/>
You could then process the message differently depending on the value of this parameter. For example:
- <xsl:when test="$Include-Team" = 'Montreal'>
- // code to include Montreal scores
- </xsl:when>
- <xsl:when test="$Include-Team" = 'Boston'>
- // code to include Boston scores
- </xsl:when>
Plain-text input
Plain-text input must be specified with the following MIME header:
- Content-Type: text/plain
Plain-text input will be processed by the script specified by the /etc/config/wdstemplate.ini [EMAIL] TEXTPLAIN parameter.
|
|
|
|
|
| Copyright information | |||