Home |
|
You are logged on as Guest | Login | Register | | Thu, 9 September 2010 (GMT+2) |
Last Updated: 18/12/2008Contents
Abbreviations and Terms
IntroductionThe XML interface is designed for supporting non-Windows systems or Web Services on sending SMS Messages. The following features are included:
Overview:
Servers:
Secure Servers: https://www.mobilefx.com/web/sms.asp XML EncodingThe XML declaration is a processing instruction (PI) that identifies the document as being XML and sets the encoding of the document. In order be able to send SMS messages with both English ASCII or Unicode characters, all XML documents you create and transmit to our servers must be encoded in UTF8 and begin with the following XML declaration: <?xml version="1.0" encoding="utf-8"?> If a request does not contain exactly this declaration, it may be refused.
<?xml version="1.0" encoding="UTF-8" ?>
<!--
mobileFX XML Document for describing various kinds of SMS Messages.
This XML is just sample for introducing the XML elements involved.
In real-life, only one Message Kind at a time is valid.
Depending on the message kind (Text/Picture/Ringtone/etc..)
several elements are required and others can be omitted.
Have a look on Message Kinds and MessageDataType topic below for detailed information.
-->
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind='SMS_MESSAGE_KIND'
MessageDataType='SMS_MESSAGE_DATA'
MessageEffects='SMS_EFFECTS'
MessageReplaceIndex='SMS_REPLACE_MESSAGE_INDEX'
TrackID=''
DeferredDeliveryTime=''
LifeTime='0'
TimeZone='0'
XSer=''
Pesonalized='0|1'>
<URL_BUFFERED><![CDATA[URL_BUFFERED]]></URL_BUFFERED>
<URL_DELIVERED><![CDATA[URL_DELIVERED]]></URL_DELIVERED>
<URL_NOT_DELIVERED><![CDATA[URL_NOT_DELIVERED]]></URL_NOT_DELIVERED>
<ORIGINATOR><![CDATA[Your Name]]></ORIGINATOR>
<!-- Required for Text SMS Messages -->
<DATA><![CDATA[Hello World!]]></DATA>
<!-- Required for Ringtone Messages -->
<DATA><![CDATA[Hex-Coded Binary Data String]]></DATA>
<!-- Required for Picture SMS Messages only -->
<DATA><![CDATA[Hello World!]]></DATA>
<PIC><![CDATA[Hex-Coded Binary Data String]]></PIC>
<!-- Required for VCard SMS Messages only -->
<VNAME><![CDATA[Jack Nickelson]]></VNAME>
<VNUM><![CDATA[+0441273770932]]></VNUM>
<!-- Required for WAP Push SMS Messages only -->
<WAP_CAP><![CDATA[Download this Game!]]></WAP_CAP>
<WAP_URL><![CDATA[http://wap.mobilefx.com/web/cms.asp?gameid=435465]]></WAP_URL>
<RECIPIENTS>
<R number='+xxxxxx'/>
<R number='+xxxxxx'/>
...
<R number='+xxxxxx'/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>
Single Part and Multi Part Text SMS Messages(Edited: 03/01/2008) The Short Message Service - Point to Point (SMS-PP) is
defined in GSM recommendation 03.40. GSM 03.41 defines the Short Message Service
- Cell Broadcast (SMS-CB) which allows messages (advertising, public
information, etc.) to be broadcast to all mobile users in a specified
geographical area. Messages are sent to a Short Message Service Centre (SMSC)
which provides a store-and-forward mechanism. It attempts to send messages to
their recipients. If a recipient is not reachable, the SMSC queues the message
for later retry. Some SMSCs also provide a "forward and forget" option where
transmission is tried only once. Both Mobile Terminated (MT), for messages sent
to a mobile handset, and Mobile Originating (MO), for those that are sent from
the mobile handset, operations are supported. Message delivery is best effort,
so there are no guarantees that a message will actually be delivered to its
recipient and delay or complete loss of a message is not uncommon, particularly
when sending between networks. Users may choose to request delivery reports,
which can provide positive confirmation that the message has reached the
intended recipient.
For Picture and WAP Push SMS Messages, display captions may
be up to 60 ASCII characters but not all mobile devices can display them. Character Sets We support Arabic and other special characters too. You need just to encode a SMS in UCS2/HexEncoded and set the proper XSer value for the character set. Arabic http://www.unicode.org/charts/PDF/U0600.pdf Syriac http://www.unicode.org/charts/PDF/U0700.pdf Thaana http://www.unicode.org/charts/PDF/U0780.pdf Arabic Presentation Forms-A http://www.unicode.org/charts/PDF/UFB50.pdf Arabic Presentation Forms-B http://www.unicode.org/charts/PDF/UFE70.pdf Greek and Coptic http://www.unicode.org/charts/PDF/U0370.pdf Hebrew http://www.unicode.org/charts/PDF/U0590.pdf Thai http://www.unicode.org/charts/PDF/U0E00.pdf Full list for all special characters (Arabic, Greek,
Cyrillic, Chinese, Japanese, Thai etc.):
http://www.unicode.org/charts
How to get the Parts of a
Text Message
Function GetMessageParts(Text)
Dim a, b
GetMessageParts = 1
If Len(Text) <= 160 Then
GetMessageParts = 1
Else
a = CSng(Len(Text)) / 153
b = Fix(a)
If a > b Then
b = b + 1
End If
GetMessageParts = b
End If
End Function
How to check if a String is
Unicode
Function IsUnicode(s)
Dim i, L
L = Len(s)
For i = 1 To L
If AscW(Mid(s, i, 1)) > &HFF Then
IsUnicode = True
Exit Function
End If
Next
End Function
Converting a
Unicode String to Hex-Coded Binary
Function UnicodeToUCS2(s, bTrimForSMS)
Dim i, L
Dim t
Dim h
L = Len(s)
For i = 1 To L
h = Hex(AscW(Mid(s, i, 1)))
h = String(4 - Len(h), "0") + h
t = t + h
Next
If bTrimForSMS Then
'Cut down to 140 bytes, 70 chars
t = Left(t, 280)
End If
UnicodeToUCS2 = t
End Function
Converting an
ISO-8859-7 String to GSM 03.38
(Added 03/01/2008)
Function ISO_2_GSM(t)
Dim s
s = t + ""
s = Replace(s, Chr(64), Chr(&H0))
s = Replace(s, Chr(163), Chr(&H1))
s = Replace(s, Chr(36), Chr(&H2))
s = Replace(s, Chr(165), Chr(&H3))
s = Replace(s, Chr(232), Chr(&H4))
s = Replace(s, Chr(233), Chr(&H5))
s = Replace(s, Chr(249), Chr(&H6))
s = Replace(s, Chr(236), Chr(&H7))
s = Replace(s, Chr(242), Chr(&H8))
s = Replace(s, Chr(199), Chr(&H9))
s = Replace(s, Chr(10), Chr(&HA))
s = Replace(s, Chr(216), Chr(&HB))
s = Replace(s, Chr(248), Chr(&HC))
s = Replace(s, Chr(13), Chr(&HD))
s = Replace(s, Chr(197), Chr(&HE))
s = Replace(s, Chr(229), Chr(&HF))
s = Replace(s, ChrW(&H394), Chr(&H10))
s = Replace(s, Chr(95), Chr(&H11))
s = Replace(s, ChrW(&H3A6), Chr(&H12))
s = Replace(s, ChrW(&H393), Chr(&H13))
s = Replace(s, ChrW(&H39B), Chr(&H14))
s = Replace(s, ChrW(&H3A9), Chr(&H15))
s = Replace(s, ChrW(&H3A0), Chr(&H16))
s = Replace(s, ChrW(&H3A8), Chr(&H17))
s = Replace(s, ChrW(&H3A3), Chr(&H18))
s = Replace(s, ChrW(&H398), Chr(&H19))
s = Replace(s, ChrW(&H39E), Chr(&H1A))
s = Replace(s, ChrW(&H1B), Chr(&H1B))
s = Replace(s, Chr(12), Chr(&H1B) + Chr(&HA))
s = Replace(s, Chr(94), Chr(&H1B) + Chr(&H14))
s = Replace(s, Chr(123), Chr(&H1B) + Chr(&H28))
s = Replace(s, Chr(125), Chr(&H1B) + Chr(&H29))
s = Replace(s, Chr(92), Chr(&H1B) + Chr(&H2F))
s = Replace(s, Chr(91), Chr(&H1B) + Chr(&H3C))
s = Replace(s, Chr(126), Chr(&H1B) + Chr(&H3D))
s = Replace(s, Chr(93), Chr(&H1B) + Chr(&H3E))
s = Replace(s, Chr(124), Chr(&H1B) + Chr(&H40))
s = Replace(s, ChrW(&H20AC), Chr(&H1B) + Chr(&H65)) '(ISO-8859-15)
s = Replace(s, Chr(198), Chr(&H1C))
s = Replace(s, Chr(230), Chr(&H1D))
s = Replace(s, Chr(223), Chr(&H1E))
s = Replace(s, Chr(201), Chr(&H1F))
s = Replace(s, Chr(32), Chr(&H20))
s = Replace(s, Chr(33), Chr(&H21))
s = Replace(s, Chr(34), Chr(&H22))
s = Replace(s, Chr(35), Chr(&H23))
s = Replace(s, ChrW(164), Chr(&H24)) '(ISO-8859-1)
s = Replace(s, Chr(37), Chr(&H25))
s = Replace(s, Chr(38), Chr(&H26))
s = Replace(s, Chr(39), Chr(&H27))
s = Replace(s, Chr(40), Chr(&H28))
s = Replace(s, Chr(41), Chr(&H29))
s = Replace(s, Chr(42), Chr(&H2A))
s = Replace(s, Chr(43), Chr(&H2B))
s = Replace(s, Chr(44), Chr(&H2C))
s = Replace(s, Chr(45), Chr(&H2D))
s = Replace(s, Chr(46), Chr(&H2E))
s = Replace(s, Chr(47), Chr(&H2F))
s = Replace(s, Chr(48), Chr(&H30))
s = Replace(s, Chr(49), Chr(&H31))
s = Replace(s, Chr(50), Chr(&H32))
s = Replace(s, Chr(51), Chr(&H33))
s = Replace(s, Chr(52), Chr(&H34))
s = Replace(s, Chr(53), Chr(&H35))
s = Replace(s, Chr(54), Chr(&H36))
s = Replace(s, Chr(55), Chr(&H37))
s = Replace(s, Chr(56), Chr(&H38))
s = Replace(s, Chr(57), Chr(&H39))
s = Replace(s, Chr(58), Chr(&H3A))
s = Replace(s, Chr(59), Chr(&H3B))
s = Replace(s, Chr(60), Chr(&H3C))
s = Replace(s, Chr(61), Chr(&H3D))
s = Replace(s, Chr(62), Chr(&H3E))
s = Replace(s, Chr(63), Chr(&H3F))
s = Replace(s, Chr(161), Chr(&H40))
s = Replace(s, Chr(65), Chr(&H41))
s = Replace(s, Chr(66), Chr(&H42))
s = Replace(s, Chr(67), Chr(&H43))
s = Replace(s, Chr(68), Chr(&H44))
s = Replace(s, Chr(69), Chr(&H45))
s = Replace(s, Chr(70), Chr(&H46))
s = Replace(s, Chr(71), Chr(&H47))
s = Replace(s, Chr(72), Chr(&H48))
s = Replace(s, Chr(73), Chr(&H49))
s = Replace(s, Chr(74), Chr(&H4A))
s = Replace(s, Chr(75), Chr(&H4B))
s = Replace(s, Chr(76), Chr(&H4C))
s = Replace(s, Chr(77), Chr(&H4D))
s = Replace(s, Chr(78), Chr(&H4E))
s = Replace(s, Chr(79), Chr(&H4F))
s = Replace(s, Chr(80), Chr(&H50))
s = Replace(s, Chr(81), Chr(&H51))
s = Replace(s, Chr(82), Chr(&H52))
s = Replace(s, Chr(83), Chr(&H53))
s = Replace(s, Chr(84), Chr(&H54))
s = Replace(s, Chr(85), Chr(&H55))
s = Replace(s, Chr(86), Chr(&H56))
s = Replace(s, Chr(87), Chr(&H57))
s = Replace(s, Chr(88), Chr(&H58))
s = Replace(s, Chr(89), Chr(&H59))
s = Replace(s, Chr(90), Chr(&H5A))
s = Replace(s, Chr(196), Chr(&H5B))
s = Replace(s, Chr(214), Chr(&H5C))
s = Replace(s, Chr(209), Chr(&H5D))
s = Replace(s, Chr(220), Chr(&H5E))
s = Replace(s, Chr(167), Chr(&H5F))
s = Replace(s, Chr(191), Chr(&H60))
s = Replace(s, Chr(97), Chr(&H61))
s = Replace(s, Chr(98), Chr(&H62))
s = Replace(s, Chr(99), Chr(&H63))
s = Replace(s, Chr(100), Chr(&H64))
s = Replace(s, Chr(101), Chr(&H65))
s = Replace(s, Chr(102), Chr(&H66))
s = Replace(s, Chr(103), Chr(&H67))
s = Replace(s, Chr(104), Chr(&H68))
s = Replace(s, Chr(105), Chr(&H69))
s = Replace(s, Chr(106), Chr(&H6A))
s = Replace(s, Chr(107), Chr(&H6B))
s = Replace(s, Chr(108), Chr(&H6C))
s = Replace(s, Chr(109), Chr(&H6D))
s = Replace(s, Chr(110), Chr(&H6E))
s = Replace(s, Chr(111), Chr(&H6F))
s = Replace(s, Chr(112), Chr(&H70))
s = Replace(s, Chr(113), Chr(&H71))
s = Replace(s, Chr(114), Chr(&H72))
s = Replace(s, Chr(115), Chr(&H73))
s = Replace(s, Chr(116), Chr(&H74))
s = Replace(s, Chr(117), Chr(&H75))
s = Replace(s, Chr(118), Chr(&H76))
s = Replace(s, Chr(119), Chr(&H77))
s = Replace(s, Chr(120), Chr(&H78))
s = Replace(s, Chr(121), Chr(&H79))
s = Replace(s, Chr(122), Chr(&H7A))
s = Replace(s, Chr(228), Chr(&H7B))
s = Replace(s, Chr(246), Chr(&H7C))
s = Replace(s, Chr(241), Chr(&H7D))
s = Replace(s, Chr(252), Chr(&H7E))
s = Replace(s, Chr(224), Chr(&H7F))
ISO_2_GSM = s
End Function
Converting a GSM 03.38 String to ISO-8859-7 (Added 03/01/2008)
Function GSM_2_ISO(t)
Dim s
s = t + ""
s = Replace(s, Chr(&H0), Chr(64))
s = Replace(s, Chr(&H1), Chr(163))
s = Replace(s, Chr(&H2), Chr(36))
s = Replace(s, Chr(&H3), Chr(165))
s = Replace(s, Chr(&H4), Chr(232))
s = Replace(s, Chr(&H5), Chr(233))
s = Replace(s, Chr(&H6), Chr(249))
s = Replace(s, Chr(&H7), Chr(236))
s = Replace(s, Chr(&H8), Chr(242))
s = Replace(s, Chr(&H9), Chr(199))
s = Replace(s, Chr(&HA), Chr(10))
s = Replace(s, Chr(&HB), Chr(216))
s = Replace(s, Chr(&HC), Chr(248))
s = Replace(s, Chr(&HD), Chr(13))
s = Replace(s, Chr(&HE), Chr(197))
s = Replace(s, Chr(&HF), Chr(229))
s = Replace(s, Chr(&H10), ChrW(&H394))
s = Replace(s, Chr(&H11), Chr(95))
s = Replace(s, Chr(&H12), ChrW(&H3A6))
s = Replace(s, Chr(&H13), ChrW(&H393))
s = Replace(s, Chr(&H14), ChrW(&H39B))
s = Replace(s, Chr(&H15), ChrW(&H3A9))
s = Replace(s, Chr(&H16), ChrW(&H3A0))
s = Replace(s, Chr(&H17), ChrW(&H3A8))
s = Replace(s, Chr(&H18), ChrW(&H3A3))
s = Replace(s, Chr(&H19), ChrW(&H398))
s = Replace(s, Chr(&H1A), ChrW(&H39E))
s = Replace(s, Chr(&H1B), ChrW(&H1B))
s = Replace(s, Chr(&H1B) + Chr(&HA), Chr(12))
s = Replace(s, Chr(&H1B) + Chr(&H14), Chr(94))
s = Replace(s, Chr(&H1B) + Chr(&H28), Chr(123))
s = Replace(s, Chr(&H1B) + Chr(&H29), Chr(125))
s = Replace(s, Chr(&H1B) + Chr(&H2F), Chr(92))
s = Replace(s, Chr(&H1B) + Chr(&H3C), Chr(91))
s = Replace(s, Chr(&H1B) + Chr(&H3D), Chr(126))
s = Replace(s, Chr(&H1B) + Chr(&H3E), Chr(93))
s = Replace(s, Chr(&H1B) + Chr(&H40), Chr(124))
s = Replace(s, Chr(&H1B) + Chr(&H65), ChrW(&H20AC)) '(ISO-8859-15)
s = Replace(s, Chr(&H1C), Chr(198))
s = Replace(s, Chr(&H1D), Chr(230))
s = Replace(s, Chr(&H1E), Chr(223))
s = Replace(s, Chr(&H1F), Chr(201))
s = Replace(s, Chr(&H20), Chr(32))
s = Replace(s, Chr(&H21), Chr(33))
s = Replace(s, Chr(&H22), Chr(34))
s = Replace(s, Chr(&H23), Chr(35))
s = Replace(s, Chr(&H24), ChrW(164)) '(ISO-8859-1)
s = Replace(s, Chr(&H25), Chr(37))
s = Replace(s, Chr(&H26), Chr(38))
s = Replace(s, Chr(&H27), Chr(39))
s = Replace(s, Chr(&H28), Chr(40))
s = Replace(s, Chr(&H29), Chr(41))
s = Replace(s, Chr(&H2A), Chr(42))
s = Replace(s, Chr(&H2B), Chr(43))
s = Replace(s, Chr(&H2C), Chr(44))
s = Replace(s, Chr(&H2D), Chr(45))
s = Replace(s, Chr(&H2E), Chr(46))
s = Replace(s, Chr(&H2F), Chr(47))
s = Replace(s, Chr(&H30), Chr(48))
s = Replace(s, Chr(&H31), Chr(49))
s = Replace(s, Chr(&H32), Chr(50))
s = Replace(s, Chr(&H33), Chr(51))
s = Replace(s, Chr(&H34), Chr(52))
s = Replace(s, Chr(&H35), Chr(53))
s = Replace(s, Chr(&H36), Chr(54))
s = Replace(s, Chr(&H37), Chr(55))
s = Replace(s, Chr(&H38), Chr(56))
s = Replace(s, Chr(&H39), Chr(57))
s = Replace(s, Chr(&H3A), Chr(58))
s = Replace(s, Chr(&H3B), Chr(59))
s = Replace(s, Chr(&H3C), Chr(60))
s = Replace(s, Chr(&H3D), Chr(61))
s = Replace(s, Chr(&H3E), Chr(62))
s = Replace(s, Chr(&H3F), Chr(63))
s = Replace(s, Chr(&H40), Chr(161))
s = Replace(s, Chr(&H41), Chr(65))
s = Replace(s, Chr(&H42), Chr(66))
s = Replace(s, Chr(&H43), Chr(67))
s = Replace(s, Chr(&H44), Chr(68))
s = Replace(s, Chr(&H45), Chr(69))
s = Replace(s, Chr(&H46), Chr(70))
s = Replace(s, Chr(&H47), Chr(71))
s = Replace(s, Chr(&H48), Chr(72))
s = Replace(s, Chr(&H49), Chr(73))
s = Replace(s, Chr(&H4A), Chr(74))
s = Replace(s, Chr(&H4B), Chr(75))
s = Replace(s, Chr(&H4C), Chr(76))
s = Replace(s, Chr(&H4D), Chr(77))
s = Replace(s, Chr(&H4E), Chr(78))
s = Replace(s, Chr(&H4F), Chr(79))
s = Replace(s, Chr(&H50), Chr(80))
s = Replace(s, Chr(&H51), Chr(81))
s = Replace(s, Chr(&H52), Chr(82))
s = Replace(s, Chr(&H53), Chr(83))
s = Replace(s, Chr(&H54), Chr(84))
s = Replace(s, Chr(&H55), Chr(85))
s = Replace(s, Chr(&H56), Chr(86))
s = Replace(s, Chr(&H57), Chr(87))
s = Replace(s, Chr(&H58), Chr(88))
s = Replace(s, Chr(&H59), Chr(89))
s = Replace(s, Chr(&H5A), Chr(90))
s = Replace(s, Chr(&H5B), Chr(196))
s = Replace(s, Chr(&H5C), Chr(214))
s = Replace(s, Chr(&H5D), Chr(209))
s = Replace(s, Chr(&H5E), Chr(220))
s = Replace(s, Chr(&H5F), Chr(167))
s = Replace(s, Chr(&H60), Chr(191))
s = Replace(s, Chr(&H61), Chr(97))
s = Replace(s, Chr(&H62), Chr(98))
s = Replace(s, Chr(&H63), Chr(99))
s = Replace(s, Chr(&H64), Chr(100))
s = Replace(s, Chr(&H65), Chr(101))
s = Replace(s, Chr(&H66), Chr(102))
s = Replace(s, Chr(&H67), Chr(103))
s = Replace(s, Chr(&H68), Chr(104))
s = Replace(s, Chr(&H69), Chr(105))
s = Replace(s, Chr(&H6A), Chr(106))
s = Replace(s, Chr(&H6B), Chr(107))
s = Replace(s, Chr(&H6C), Chr(108))
s = Replace(s, Chr(&H6D), Chr(109))
s = Replace(s, Chr(&H6E), Chr(110))
s = Replace(s, Chr(&H6F), Chr(111))
s = Replace(s, Chr(&H70), Chr(112))
s = Replace(s, Chr(&H71), Chr(113))
s = Replace(s, Chr(&H72), Chr(114))
s = Replace(s, Chr(&H73), Chr(115))
s = Replace(s, Chr(&H74), Chr(116))
s = Replace(s, Chr(&H75), Chr(117))
s = Replace(s, Chr(&H76), Chr(118))
s = Replace(s, Chr(&H77), Chr(119))
s = Replace(s, Chr(&H78), Chr(120))
s = Replace(s, Chr(&H79), Chr(121))
s = Replace(s, Chr(&H7A), Chr(122))
s = Replace(s, Chr(&H7B), Chr(228))
s = Replace(s, Chr(&H7C), Chr(246))
s = Replace(s, Chr(&H7D), Chr(241))
s = Replace(s, Chr(&H7E), Chr(252))
s = Replace(s, Chr(&H7F), Chr(224))
GSM_2_ISO = s
End Function
XML Elements
IMPORTANT:
DOM.selectNodes("//SMS").length + DOM.selectNodes("//R").length <= 1000 This means that you can have up to 1000 SMS elements with 1 R element each, 1 SMS element with 1000 R elements in it, or any combination of SMS and R elements that SMS + R <= 1000.
This means that if you want to send both Text SMS messages and Picture Messages you should create and send two (2) XML Documents.
This is very important!! If for example you send an XML Document with 999 ASCII Text Messages with English Characters and 1 Text Message with Unicode characters, then all 1000 messages will be treated as Unicode and the server will apply the limitation check of 70 Unicode characters per message. Added on 3/1/2008: Text SMS messages with Greek capital characters are treated as standard GSM-encoded messages and can have up to 1377 characters. Accounting and Utility XML FunctionsGetting Credits Balance XML<?xml version="1.0" encoding="UTF-8" ?> <REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='credits'/> Getting Termination Fees XML<?xml version="1.0" encoding="UTF-8" ?> <REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='termination'/> Getting Supported Networks XML<?xml version="1.0" encoding="UTF-8" ?> <REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='networks'/> Message Kinds and MessageDataTypeEach SMS or Bulk SMS message has a MessageKind property that determines what kind of SMS message will be sent to the recipients. MessageDataType property defines the format of the message data or where to retrieve them from. Text Message XML
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind='0' MessageDataType='0' MessageEffects='0'
MessageReplaceIndex='0' TrackID='' DeferredDeliveryTime=''
LifeTime='0' TimeZone='2' XSer=''>
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[Hello World!]]></DATA>
<RECIPIENTS>
<R number='xxxxxx'/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>Personalized Bulk SMS Message XML
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind='0' MessageDataType='0' MessageEffects='0'
MessageReplaceIndex='0' TrackID='' DeferredDeliveryTime=''
LifeTime='0' TimeZone='2' XSer='' Personalized='1'>
<ORIGINATOR><![CDATA[mobileFX]]></ORIGINATOR>
<DATA><![CDATA[]]></DATA>
<RECIPIENTS>
<R number='xxxxxx'><![CDATA[Hello John, Merry XMas!]]></R>
<R number='xxxxxx'><![CDATA[Hello Marry, Merry XMas!]]></R>
<R number='xxxxxx'><![CDATA[Γεια σου Κώστα, Ευτυχισμένα Χριστούγεννα!]]></R>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>Picture Message XML
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="1" MessageDataType="1" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[This is a Picture message.]]></DATA>
<PIC><![CDATA[474946383961B000D000F7...D6477F37]]></PIC>
<RECIPIENTS>;
<R number="xxxxxxx"/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="1" MessageDataType="2" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[This is a Picture message.]]></DATA>
<PIC><![CDATA[http://www.mobilefx.com/web/images/gamers.png]]></PIC>
<RECIPIENTS>;
<R number="xxxxxxx"/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>
Ringtone Message XML
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="2" MessageDataType="1" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[64656174683A643D342C6F3D352C623D3130303A...32E0D0A]]></DATA>
<RECIPIENTS>
<R number="xxxxxx"/>
</RECIPIENTS>;
</SMS>
</MESSAGES>
</REQUEST>
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="2" MessageDataType="2" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[http://www.mobilefx.com/_content/ringtone_file.txt]]></DATA>
<RECIPIENTS>
<R number="xxxxxx"/>
</RECIPIENTS>;
</SMS>
</MESSAGES>
</REQUEST>VCard Message XML
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="3" MessageDataType="0" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<VNAME><![CDATA[Charles]]></VNAME>
<VNUM><![CDATA[+44127345293]]></VNUM>
<RECIPIENTS>
<R number="xxxxxx"/>
</RECIPIENTS>;
</SMS>
</MESSAGES>
</REQUEST>WAP Push Message XML
<?xml version="1.0" encoding="UTF-8" ?>
&<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind="4" MessageDataType="0" MessageEffects="0"
MessageReplaceIndex="0" TrackID="" DeferredDeliveryTime=""
LifeTime="0" TimeZone="2" XSer="">
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<WAP_CAP><![CDATA[Test]]></WAP_CAP>
<WAP_URL><![CDATA[http://wap.mobilefx.com]]></WAP_URL>
<RECIPIENTS>
<R number="xxxxxx"/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>Notifications and HTTP CallbacksBy setting SMS properties URL_BUFFERED, URL_DELIVERED and URL_NOT_DELIVERED you instruct our server to perform an HTTP Callback to those URLs when the state of your submission changes.
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxxx' password='xxxxxx' method='send'>
<MESSAGES>
<SMS MessageKind='0' MessageDataType='0' MessageEffects='0'
MessageReplaceIndex='0' TrackID='' DeferredDeliveryTime=''
LifeTime='0' TimeZone='2' XSer=''>
<URL_BUFFERED>
<![CDATA[http://www.yourhost.com/Buffered.asp?SCTS=<SCTS>&DSCTS=<DSCTS>&RSN=<RSN>&DST=<DST>&TRN=<TRN>]]>
</URL_BUFFERED>
<URL_DELIVERED>
<![CDATA[http://www.yourhost.com/Delivered.asp?SCTS=<SCTS>&DSCTS=<DSCTS>&RSN=<RSN>&DST=<DST>&TRN=<TRN>]]>
</URL_DELIVERED>
<URL_NOT_DELIVERED>
<![CDATA[http://www.yourhost.com/NotDelivered.asp?SCTS=<SCTS>&DSCTS=<DSCTS>&RSN=<RSN>&DST=<DST>&TRN=<TRN>]]>
</URL_NOT_DELIVERED>
<ORIGINATOR><![CDATA[xxxxxx]]></ORIGINATOR>
<DATA><![CDATA[Hello World!]]></DATA>
<RECIPIENTS>
<R number='xxxxxx'/>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>The Callback URL Query String provides several fields as described below:
The tags within the definition of the URL may be placed on any position but
the length of one URL is limited to 200 characters. A URL, which may be called
mobileFX, could look like the following: http:///www.yourhost.com/Buffered.asp?SCTS=25062002120236&DSCTS=25062002120241&RSN=107&DST=1&TRN=00001Explanation: Submissiondate: 25.06.2002 12:02:36 Notificationdate: 25.06.2002 12:02:41 Reasoncode: 107 (Absent Subscriber) Deliverystatus: 1 (Buffered) TrackID: 00001 Please not that after Delivery status 1 (Buffered) occurs, nearly always the URL is called a second time with Delivery status 0 (Delivered) or Delivery status 2 (Not delivered). ASP Query String Decode Sample Code <script language=VBScript runat=server>
Public Sub HandleCallBack()
On Error Resume Next
Dim RCPNT
Dim SCTS
Dim DSCTS
Dim RSN
Dim DST
Dim TRN
RCPNT = Request.QueryString("RCPNT").Item
SCTS = parseDateTime(Request.QueryString("SCTS").Item)
DSCTS = parseDateTime(Request.QueryString("DSCTS").Item)
RSN = Request.QueryString("RSN").Item
DST = Request.QueryString("DST").Item
TRN = Request.QueryString("TRN").Item
' Your handling code here...
End Sub
Private Function parseDateTime(s)
On Error Resume Next
Dim yy, mm, dd, H, m, ss
dd = CInt(Left(s, 2))
mm = CInt(Mid(s, 3, 2))
yy = CInt(Mid(s, 5, 4))
H = CInt(Mid(s, 9, 2))
m = CInt(Mid(s, 11, 2))
ss = CInt(Mid(s, 13, 2))
parseDateTime = DateSerial(yy, mm, dd) + TimeSerial(H, m, ss)
If Err.Number <> 0 Then
parseDateTime = Null
End If
End Function
</script>
Possible values of Deliverystatus
Possible values of ReasoncodeReasoncodes specify the reason if a message is first being buffered or the delivery of message has definitely failed. They are only relevant if Deliverystatus of a message is 1 (Buffered) or 2 (Not delivered)
Most occurring ReasoncodesIn cases of failures, several reasoncodes do occur quite often, others very seldom. The following reasoncodes are most the occurring reasoncodes in our system and therefore listed here.
Pre-Send Cost CalculationIt is very important to know whether you have enough credits in your account to successfully send your SMS messages. As a general rule, for every SMS message and regardless of its MessageKind, only one (1) credit is charged. However, certain Network Operators apply additional charges, known as Termination Fees. In order to properly and accurately calculate the cost of your Bulk Job, you must implement the following calculation:
EnumerationsSMS_MESSAGE_KIND
SMS_Text = 0 SMS_NO_EFFECTS=0
SMS_REPLACE_MESSAGE_INDEX Examples of XML HTTP POSTVisual Basic Sample Code
Function SendSms(XMLDoc As String) As String
Dim h As Object
Dim x As Object
Dim r As String
Dim erNo As Long, erMsg As String
On Error GoTo ErrHnd
Set h = CreateObject("Microsoft.XMLHTTP")
h.Open "POST", "https://www.mobilefx.com/web/sms.asp", False
h.Send XMLDoc + ""
r = h.responseText
SendSms = r
If InStr(r, "<") > 0 Then
Set x = XML_DOM(r)
If Not x.documentElement Is Nothing Then
If x.documentElement.nodeName = "ERROR" Then
XHTTP = ""
Err.Raise 1010, , x.documentElement.Text
End If
End If
End If
End Function
Private Function XML_DOM(Optional v) As Object
Dim X As Object
Set X = CreateObject("Microsoft.XMLDOM")
X.async = True
If Not IsEmpty(v) Then
X.loadXML v
End If
Set XML_DOM = X
End Function
VBScript Sample Code (ASP Server)
<script language=VBScript runat=server>
Function SendSms(XMLDoc)
Dim h
Dim r
Set h = Server.CreateObject("Microsoft.XMLHTTP")
h.Open "POST", "https://www.mobilefx.com/web/sms.asp", False
h.Send XMLDoc + ""
r = h.responseText
SendSms = r
End Function
</script>HTML Sample Code (VBScript)
<html>
<body>
<textarea id=txt style="width:100%;height:400px">
<?xml version="1.0" encoding="UTF-8" ?>
<REQUEST version='1.0.0' username='xxxxx' password='xxxxx' method='send'>
<MESSAGES>
<SMS MessageKind='0' MessageDataType='0' MessageEffects='0'
MessageReplaceIndex='0' TrackID='' DeferredDeliveryTime=''
LifeTime='0' TimeZone='2' XSer='' Personalized='1'>
<ORIGINATOR><![CDATA[mobileFX]]></ORIGINATOR>
<DATA><![CDATA[]]></DATA>
<RECIPIENTS>
<R number='xxxxx'><![CDATA[Hello Lina, Merry XMas!]]></R>
<R number='xxxxx'><![CDATA[Hello Elias, Merry XMas!]]></R>
<R number='xxxxx'><![CDATA[Γεια σου Κώστα, Ευτυχισμένα Χριστούγεννα!]]></R>
</RECIPIENTS>
</SMS>
</MESSAGES>
</REQUEST>
</textarea>
<button onclick="send()">Send</button>
<script language=vbscript>
sub Send()
dim x
set x = createobject("Microsoft.XMLDOM")
x.async = false
x.loadxml txt.value
if x.xml = "" then
msgbox x.parseError.reason
else
msgbox SendSms(x.xml)
end if
end sub
Function SendSms(XMLDoc)
Dim h
Dim r
Set h = CreateObject("Microsoft.XMLHTTP")
h.Open "POST", "https://www.mobilefx.com/web/sms.asp", False
h.Send XMLDoc + ""
r = h.responseText
SendSms = r
End Function
</script>
</body>
</html>
PHP Sample Code(Edited 03/01/2008)
<?php
$xmldocument = ...
$len = strlen($xmldocument);
$fp = fsockopen("www.mobilefx.com", 80, &$errno, &$errdesc );
if ( ! $fp ) die ( "Couldn't connect: $errno $errdesc\n" );
fputs( $fp, "POST /web/sms.asp HTTP/1.0\r\n");
fputs( $fp, "Host: www.mobilefx.com\r\n");
fputs( $fp, "Content-Type: text/xml\r\n");
fputs( $fp, "Content-Length: $len\r\n\r\n");
fputs( $fp, $xmldocument);
while ( ! feof( $fp ) )
$reply[] = fgets( $fp, 1024 );
fclose( $fp );
?>Python Sample Code#!/usr/bin/python2 print 'Content-Type: text/html' print # Blank line marking end of HTTP headers import socket HOST = 'www.mobilefx.com' # The remote host PORT = 80 # The same port as used by the server XMLDOC = ... #XML SMS Document according to specifications of this document length = len(XMLDOC) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.send("POST /web/sms.asp HTTP/1.0\r\n") s.send("Content-Type: text/xml\r\n") s.send("Content-Length: "+str(length)+"\r\n\r\n") s.send(XMLDOC) datarecv=s.recv(1024) print "Reply Received: "+ str(datarecv) s.close() C# Sample Code
using System;
using System.Xml;
using System.Net.Sockets;
using System.IO;
using System.Text;
using System.Net;
class SendSMS
{
public static int port = 80;
public static string host = "https://www.mobilefx.com";
public static string url = "/web/sms.asp";
public static void Main(string[] args)
{
SendSMS sms = new SendSMS();
sms.send();
}
private void send(string message)
{
HttpWebRequest httpRequest = (HttpWebRequest) WebRequest.Create(host + ":" + port + url);
httpRequest.Method = "POST";
httpRequest.ContentType = "text/xml";
Stream requestStream = httpRequest.GetRequestStream();
XmlTextWriter xmlTextWriter = new XmlTextWriter(requestStream, System.Text.Encoding.UTF8);
// Write code to construct XML Document here...
xmlTextWriter.Close();
HttpWebResponse httpResponse = (HttpWebResponse) httpRequest.GetResponse();
Console.WriteLine("Response is:");
StreamReader streamReader = new StreamReader(httpResponse.GetResponseStream(), System.Text.Encoding.UTF8);
Console.WriteLine(streamReader.ReadToEnd());
streamReader.Close();
httpResponse.Close();
}
}
Java Sample Code
import java.net.*;
import java.io.*;
public class SMS
{
String xmlURL = "https://www.mobilefx.com/web/sms.asp";
SMS() {}
public String send(int idsms,
String number,
String message,
int flashing,
String URLDeliveryNotification,
String URLNonDeliveryNotification)
{
StringBuffer content = new StringBuffer();
// Construct XML here
InetAddress inetAddr = null;
String xmlResult = "";
try
{
URL mURL = new URL(xmlURL);
URLConnection mConn = mURL.openConnection();
mConn.setRequestProperty("Content-Type","text/xml");
mConn.setDoOutput(true);
mConn.setDoInput(true);
PrintWriter out = new PrintWriter(mConn.getOutputStream());
char[] buffer = new char[1024*10];
buffer = content.toCharArray();
out.write(buffer,0,content.length());
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(mConn.getInputStream()));
String inputLine = null;
while ((inputLine = in.readLine()) != null)
{
xmlResult = xmlResult + inputLine;
System.out.println(inputLine);
}
in.close();
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
return xmlResult;
}
public static void main(String[] args)
{
SMS testSMS = new SMS();
String xmlResult = SMS.send(refnumber,handynumber,message,flashing,urldelivery_yes,urldelivery_no);
}
}
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2004-2007 mobileFX™, All Rights Reserved. [
Terms of Use
| Privacy Policy
] mobileFX, mobileFX Studios, the Moby Cartoon and mobileFX logo are a Registered Trademarks of E.Politakis in Greece. Microsoft and the Internet Explorer logo are registered trademarks of trademarks of Microsoft Corporation in the United States and/or other countries. Other product and company names herein may be the trademarks of their respective owners. Please direct your questions or comments to webmaster@mobilefx.com |