Send OMA Client Provisioning (OTA XML) via PHP

Posted by on Mar 26, 2009 in Support Blog

Topic Keywords: , ,

OMA Provisioing Content Messages are special SMS messages that contain information used to configure certain settings of a mobile phone, such as settings for the browser (APN, proxy, bookmarks), MMS client, IM client, or SyncML client.
These messages are sometimes referred to as OTA configuration messages, where OTA is an acronym for Over-The-Air.
These settings are specified in an XML format, and the encoded by NowSMS into a compact binary format for sending via SMS.
Some of the XML document formats supported by NowSMS include:

1.) OMA (Open Mobile Alliance) Provisioning Content (root XML element “wap-provisioningdoc”)

2.) OMA (Open Mobile Alliance) DRM Rights Objects (root XML element “o-ex:rights”)

3.) WAP Push Service Indication, Service Load and Cache Operation (root XML element “si”, “sl”, or “co”)

4.) OMA (Open Mobile Alliance) E-Mail Notification (EMN) (root XML element “emn”)

5.) Nokia/Ericsson Over The Air Settings (OTA) Specification (root XML element “CHARACTERISTIC-LIST”)

6.) Nokia/Ericssson SyncML OTA or Wireless Village Settings (root XML element “SyncSettings” or “WVSettings”)

A couple of years ago, we posted an example of a simple command line script that can be used to submitting an XML document to NowSMS to send out as an OTA configuration message.  That script is described in more detail in the following article:
http://www.nowsms.com/send-oma-client-provisioning-ota-xml-settings-from-the-command-line

We frequently receive questions about how to submit an XML OTA document via PHP, so I’ve posted an example PHP script that can be downloaded from http://www.nowsms.com/download/sendota-php.txt.
This PHP script contains a function called SendOTA.
The function definition for SendOTA contains the following parameters:
function SendOTA ($host, $port, $username, $password, $phoneNoRecip, $otafilename, $otapin, $otapintype)
$host – IP address or host name of the NowSMS server
$port – “Port number for the web interface” of the NowSMS Server
$username“SMS Users” account on the NowSMS server
$password – Password defined for the “SMS Users” account on the NowSMS Server
$phoneNoRecip – One or more phone numbers (comma delimited) to receive the text message
$otafilename – File name of a local file containing the XML document to be encoded and sent as an OTA message
$otapin – Optional PIN code for signing the OTA message
$otapintype – Type of PIN code (USERPIN or NETWPIN)
Assuming that you have created an XML document named f:/temp/bookmark.xml, the following function call could be used to submit this document for sending as an OTA message via NowSMS:
SendOTA(“127.0.0.1”, 8800, “username”, “password”, “+4499999999999”, “f:/temp/bookmark.xml”, “0000”, “USERPIN”);
PIN codes are always the most confusing part of sending an OTA message.
An OTA PIN can be associated with many of the XML settings types to provide a layer of authentication to the message. Many devices will allow you to send XML settings without a PIN, but some will require a PIN to be present before the settings will be accepted at all.

There are three different types of PINs, depending on the “OTA PIN Type” ($otapintype) setting.

The simplest “OTA PIN Type” is “USERPIN” (User PIN). This setting indicates that a short PIN code (often 4 digits) is supplied as the “OTA PIN”. When the user receives the OTA settings message, they will need to supply this PIN code in order to be able to open the message and apply the settings. If a “PINValue” is specified, but a “PINType” is not, then USERPIN will be assumed.

“NETWPIN” (Network PIN) indicates the PIN is a network PIN code. In the GSM environment, this is the IMSI number associated with the SIM card in the device. (Hint, if you want to experiment with determining the PIN card associated with a SIM, you can put the SIM into a GSM modem and the AT+CIMI command to return the IMSI. However, not all GSM modems support the AT+CIMI command.) When the device receives the settings, if the NETWPIN does not match the IMSI, the settings will be discarded.

An additional type of PIN, known as “USERNETWPIN” also exists, which indicates a combination of the USERPIN and NETWPIN types. To use this OTA PIN type, specify the OTA PIN as the IMSI number associated with the SIM card in the device, followed by a “:” character, followed by a USERPIN (e.g., 1234567889012345:1234). When the device receives the settings, the user will be prompted for a PIN. This user supplied PIN, and the SIM card IMSI, must match in order for the settings to be accepted.

For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...