1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="Title" CONTENT="SMS Server Tools 3">
<META NAME="Robots" CONTENT="INDEX,FOLLOW">
<META NAME="Language" CONTENT="English">
<title>SMS Server Tools 3</title>
<STYLE type="text/css">
h3 {
background-color: #DCDCFE;
}
blockquote {
background-color: #FFD;
font-size: 90%;
padding:5pt;
padding-top:1pt;
margin-bottom:5pt;
border-style: outset;
border-color: #aaaa99;
border-width: 0.05pt 2pt 2pt 0.05pt;
}
blockquote p:first-letter {
font-size: 110%;
font-weight: bold;
color: red;
}
</STYLE>
</head>
<body>
<h2><font color=blue>SMS Server Tools 3</font></h2>
<a href="index.html">Home</a>
<h3>SMS file format</h3>
<!-- START --><p>
<h3>Text messages</h3>
<p>
An SMS file is a text file that contains the message and a header. You have to
store all SM you want to send in these files in the outgoing directory.
The filename does not matter but it has to be unique. You may use the
mktemp command to generate unique filenames.
<p>
Easy example:
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
To: 491721234567<br>
<br>
Hello, this is the sms.
</font>
</TD></TR></table>
<p>
Write the phone number in <u><b>international format</b></u> without the leading +.
When you like to send a message to a short number (for example to
order a ringtone), then preceed it with an "s".
<p>
More complex example:
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
From: Stefan<br>
To: 491721234567<br>
Flash: yes<br>
Alphabet: ISO<br>
<br>
Hello Stefan, how are you?
</font>
</TD></TR></table>
<p>
You can add as many header lines, as you like. When the program finds an unknown header, it simply
ignores that line. You can use the following header lines:
<p>
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>From</td>
<td>Senders name or phone number. This field has currently no function to the software. </td>
</tr>
<tr>
<td bgcolor=yellow>To</td>
<td>Receivers phone number in <u><b>international format</b></u> without the leading +.
When you like to send a message to a short number (for example to order a ringtone), then preceed it with an "s".
With version >= 3.1 the number can be given using grouped format, like <i>358 12 345 6789</i>.
</td>
</tr>
<tr>
<td bgcolor=yellow>Flash</td>
<td>Boolean value. If yes, then the message appears directly on the phones display. Most phones support this feature, but not all.</td>
</tr>
<tr>
<td bgcolor=yellow>Alphabet</td>
<td>Tells the program what character set is used in this sms file. Possible values are
<p>
<table border=1 bgcolor="#F0F0F0" width="80%" align=center>
<TR>
<TD bgcolor=yellow align=center>ISO<br>Latin<br>Ansi</td>
<td>Normal 8 bit character set, also called Ansi or Latin-1. All three keywords do the same. If the text is longer than 160 characters, then the program can split it automatically. This is the default.</td>
</TR>
<tr>
<TD bgcolor=yellow align=center>GSM</TD>
<td>7 bit character set, as described in the GSM specification, with one exception: The @ character is represented by the character code 0xB7. If the text is longer than 160 characters, the program can split it automatically. </td>
</tr>
<tr>
<TD bgcolor=yellow align=center>UCS<br>Chinese<br>Unicode</TD>
<td>UCS2 character set, maximum 70 characters. All three values do the same. The header must be written with an 8 bit character set but the message text part must be written with the 16 bit Unicode (big endian) character set. Please checkout the scripts directory, it contains some useful scripts for file format conversion. </td>
</tr>
<tr>
<TD bgcolor=yellow align=center>binary</TD>
<td>The short message contains 8-bit binary data, no text.</td>
</tr></table>
<br clear=all>
The program checks only the first 3 characters of that line, therefore keywords like ISO-8859-15 or UCS-2 will also work fine.
</td>
</tr>
<tr>
<td bgcolor=yellow>UDH</td>
<td>Only binary messages: Boolean value, tells if the message data contains a user data header. Default is true.</td>
</tr>
<tr>
<td bgcolor=yellow>UDH-DATA</td>
<td>User data header in hex-dump format. See <a href="udh.html">udh.html</a> and GSM 03.38. From version >= 3.1 also binary message can have UDH-DATA defined.</td>
</tr>
<tr>
<td bgcolor=yellow>SMSC</td>
<td>Phone number of the SMSC. From version >= 3.1 this setting is ignored if there is no smsc set in the config file.</td>
</tr>
<tr>
<td bgcolor=yellow>Provider<br>Queue</td>
<td>Name of the provider, can be used to override the normal sorting algorithm configured by [providers] and [queues] in the config file. Both keywords do the same.</td>
</tr>
<tr>
<td bgcolor=yellow>Report</td>
<td>Boolean value. Controls if a status report is requested for this message. Without this line, the setting from config file is used.</td>
</tr>
<tr>
<td bgcolor=yellow>Autosplit</td>
<td>Controls if and how the program splits large text messages. Without this line, the setting from config file is used. The program does not split binary messages, Unicode messages and text messages with UDH.<br>
<table border=1 bgcolor="#F0F0F0" width="80%" align=center>
<tr><td bgcolor=yellow>0</td><td>disabled</td></tr>
<tr><td bgcolor=yellow>1</td><td>enabled, no part-number</td></tr>
<tr><td bgcolor=yellow>2</td><td>enabled, text numbers</td></tr>
<tr><td bgcolor=yellow>3</td><td>enabled, concatenated format (not supported by some phones)</td></tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=yellow>Priority</td>
<td>Available from version >= 3.0. Possible value is:
<table border=1 bgcolor="#F0F0F0" width="80%" align=center>
<tr><td bgcolor=yellow>high</td><td>Message is handled first when moving to spooler and when taking from spooler to sending</td></tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=yellow>Validity</td>
<td>Available from version >= 3.0. Defines a message validity period.
Without this line, the setting from config file is used.<br>
<br>
You can specify value as a number following one of the keywords: <b>min</b>, <b>hour</b>, <b>day</b>, <b>week</b>, <b>month</b> or <b>year</b>.
Validity period will be rounded down to the nearest possible value.<br>
<br>
If you do not use any of those keywords, value will have the following meaning:
<table border=1 bgcolor="#F0F0F0" width="80%" align=center>
<tr><td bgcolor=yellow>0 ... 143</td><td>(value + 1) * 5 minutes (i.e. 5 minutes intervals up to 12 hours)</td></tr>
<tr><td bgcolor=yellow>144 ... 167</td><td>12 hours + ((value - 143) * 30 minutes) (i.e. 30 min intervals up to 24 hours)</td></tr>
<tr><td bgcolor=yellow>168 ... 196</td><td>(value - 166) * 1 day (i.e. 1 day intervals up to 30 days)</td></tr>
<tr><td bgcolor=yellow>197 ... 255</td><td>(value - 192) * 1 week (i.e. 1 week intervals up to 63 weeks)</td></tr>
</table>
Incorrect values are ignored.
</td>
</tr>
<tr>
<td bgcolor=yellow>Voicecall</td>
<td>Boolean value. Available from version >= 3.0.<p>
With this feature the smsd will make a voice call to the receivers phone number given in To: header.
If the receiver answers to the call, some DTMF tones are played.<br>
The message text must start with TONE: keyword. After this there can be number and space, which is number of times to repeat the tone sending.
Supported tones are #,*,0...9 and the tone list must be comma separated. <br>For example:<br>
<b>TONE: 1,2,3,4,5,6,7,8,9,0</b><br>
- this plays all digits, and it's repeated 3 times which is the default.<br>
<br>
<b>TONE: 5 #,#,#</b><br>
- this plays three #'s, and it's repeated 5 times.<br>
<br>
<b>TONE:</b><br>
- some default tones are played 3 times.<br>
<br>
After version >= 3.1 additional <i>TIME: number</i> definition can be used.
After a time has reached, hang up is done.
If a call is answered before a time is reached, normal sound playing is done.
NOTE that this time counting starts after a command is given to the modem and there will be
some delay before receiving device starts ringing.
You should test this with your own handset to find a reasonable time which works fine in the network you are using.
Example:<br>
<b>TONE: TIME: 15 2 #</b><br>
<br>
Before using this feature to serious alarm purposes, you should test if this works with you modem/phone.
Also notice that automatic redialing should be turned off in the phone's settings.
</td>
</tr>
<tr>
<td bgcolor=yellow>Hex</td>
<td>Boolean value. Available from version >= 3.0.<p>
Together with <b>Alphabet: binary</b> setting the binary data can be presented in hexadecimal format.<br>
One byte should be presented with two hexadecimal characters, for example <b>0F</b>.
Text can have empty lines and comment lines starting with /, ', # or : character.
Also after hexadecimal bytes there can be a comment character marking the rest of line as a comment.
<p>
Special keyword available:
<table border=1 bgcolor="#F0F0F0" width="80%" align=center>
<tr><td bgcolor=yellow>STRING:</td><td>A normal string can be presented (without needing to type it in hex)</td></tr>
<tr><td bgcolor=yellow>INLINESTRING:</td><td>As STRING:, but Inline String token and termination null are automatically added</td></tr>
<tr><td bgcolor=yellow>LENGTH</td><td>Set this keyword to the place where the following bytes should be counted.
Next LENGTH keyword will place the counted number to the place where the first keyword was.
Nesting is not possible.</td></tr>
</table>
See example below for more details.
</td>
</tr>
<tr>
<td bgcolor=yellow>Replace</td>
<td>Numeric code 1...7. Available from >= 3.0.9.<p>
If a receiving device and SIM supports "Replace Short Message Type n" -feature, a previously
received message with the same code is replaced with a new message. Only the messages sent from
the same originating address can be replaced. If there is nothing to replace, a message is stored
in the normal way.
</td>
</tr>
<tr>
<td bgcolor=yellow>Include</td>
<td>Filename. Available from >= 3.1.<p>
Some parts of a message can be read from different file.
If an included file contains only text part, it should begin with one empty line.
</td>
</tr>
<tr>
<td bgcolor=yellow>Macro</td>
<td>Definition. Available from >= 3.1.<p>
Syntax is: <i>Macro: name=value</i>.
Multiple macros can be defined.
All <i>name</i>'s found in the message body are replaced with a <i>value</i>.
</td>
</tr>
<tr>
<td bgcolor=yellow>System_message</td>
<td>Boolean value. Available from version >= 3.1.<p>
With this setting message is sent as a system message.
This kind of message has fixed values 0x40 for Protocol Identifier and 0xF4 for Digital Coding Scheme.
A message cannot have User Data Header.
Maximum length of a message is 140 bytes.
</td>
</tr>
</table>
<p>
Note: In case of boolean values you can use true, yes, on or 1 for positive values. All other words are interpreted as negative.
<p>
Available from >= 3.0.
After a message is sent, there will be automatically generated Message_id header line <b>if</b> a status report was requested.
With version >= 3.1 there will also be Sent timestamp:
<table border=1 bgcolor=lightgrey>
<tr><td bgcolor=yellow>Message_id</td><td>ID number of a sent message.</td></tr>
<tr><td bgcolor=yellow>Sent</td><td>Time when the message was sent by the program.</td></tr>
</table>
<p>
Available from >= 3.0.6.
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>Modem</td>
<td>Name of the modem which was used to send this message.</td>
</tr>
</table>
<p>
Available from >= 3.0.9.
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>IMSI</td>
<td>International Mobile Subscriber Identity from the SIM,
if this request is supported.</td>
</tr>
</table>
<p>
<h3>Binary data</h3>
<p>
The data begins after the empty line and goes until end of file. No conversion is applied to the data.
Data messages are limited to 140 bytes.
<p>
Example:
<p>
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
To: 491721234567<br>
Alphabet: binary<br>
UDH: true<br>
<br>
gs2389gnsakj92"Z/%$"($)$(%?))((HJHG&(()/&")(LJUFDZ)=W)==/685tgui<br>
3ge^!"$EGHWZFT&Z%8785ttghjjhdjkgfjsbfjwr793thruewgfh7328hgtwhg87324hf<br>
hwer32873g&%=)(/&%$%&/(/&%$%&hdsgrwwq(/&%$fgzw543t43g5jwht934zt743g
</font>
</TD></TR></table>
<p>
Another example, available from version >= 3.0:
<p>
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
To: 491721234567<br>
Alphabet: binary<br>
Hex: yes<br>
<br>
// This is a sample Wap Push message:<br>
<br>
06 : user Data Header Length (6 Octets)<br>
05 : Identifer Element (16 Bit port addressing)<br>
04 : Length of Parameter values (4 Octets)<br>
# WAP Push connectionless session service (client side), Protocol: WSP/Datagram:<br>
0B 84 : push dest port (2948)<br>
# WAP connectionless session service Protocol: WSP/Datagram:<br>
23 F0 : push originator port (9200)<br>
<br>
03 : Push Transaction Id<br>
06 : PDU Type Push, (WAP-230-WSP Table 34)<br>
<b>LENGTH</b> // Headers Length will be placed to this position<br>
// Content type: Encoding-Version 1.3<br>
03 AE8184 456E636F64696E672D56657273696F6E 00 312E33 00<br>
// Push headers:<br>
AF 82 B4 85<br>
<b>LENGTH</b> // This stops the counting and places the number<br>
<br>
02 : WBXML version 1.2<br>
05 : SL 1.0 Public Identifier<br>
04 : Charset = iso-8859-1<br>
00 : String table length<br>
45 : s1, with content<br>
C6 : indication, with content and attributes<br>
0D : Token for "href=http://www."<br>
### There should not be extra spaces after keyword:<br>
<b>INLINESTRING:</b>xyz<br>
85 : Token for ".com/"<br>
03 : Inline string follows<br>
<b>STRING:</b>ppaid/123/abc.wml<br>
00 : End of string<br>
11 : si-id<br>
INLINESTRING:1<br>
01 : close of indication attribute list<br>
INLINESTRING:Wap push demo from smstools3.<br>
01 : End of indication element<br>
01 : END of si element<br>
<br>
# Specifications can be found from here:<br>
# <a href="http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html" target="_blank">
http://www.openmobilealliance.org/tech/affiliates/wap/wapindex.html</a><br>
</font>
</TD></TR></table>
<p>
<h3>Received messages</h3>
<p>
The received SMS are stored in the same format as described above but they have some additional header lines. For example:
<p>
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
From: 491721234567<br>
From_SMSC: 491722270333<br>
Sent: 00-02-21 22:26:23<br>
Received: 00-02-21 22:26:29<br>
Subject: modem1<br>
Alphabet: ISO<br>
UDH: false<br>
<br>
This is the Text that I have sent with my mobile phone to the computer.<br>
</font>
</TD></TR></table>
<p>
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>From</td>
<td>Senders phone number.</td>
</tr>
<tr>
<td bgcolor=yellow>From_TOA</td>
<td>Available from >= 3.0.9. Type Of Address definition of senders phone number.<br>
For example: "91 international, ISDN/telephone".</td>
</tr>
<tr>
<td bgcolor=yellow>From_SMSC</td>
<td>The SMS service centre, that sent you this message.</td>
</tr>
<tr>
<td bgcolor=yellow>Subject</td>
<td>The name of the modem that received this message.</td>
</tr>
<tr>
<td bgcolor=yellow>IMSI</td>
<td>Available from >= 3.0.9. International Mobile Subscriber Identity from the SIM,
if this request is supported.</td>
</tr>
<tr>
<td bgcolor=yellow>Report</td>
<td>Available from >= 3.0.9. Tells if a status report is going to be returned to the SME.</td>
</tr>
<tr>
<td bgcolor=yellow>Replace</td>
<td>Available from >= 3.0.9. Replace Short Message Type 1..7 number, if defined.</td>
</tr>
<tr>
<td bgcolor=yellow>Sent</td>
<td>Time when the message was sent.</td>
</tr>
<tr>
<td bgcolor=yellow>Received</td>
<td>Time when the message was received by the program.</td>
</tr>
<tr>
<td bgcolor=yellow>Alphabet</td>
<td>Tells the character set of the message text.</td>
</tr>
<tr>
<td bgcolor=yellow>UDH</td>
<td>Boolean value. Tells if the message contains a user data header.</td>
</tr>
<tr>
<td bgcolor=yellow>UDH-DATA</td>
<td>This is the UDH in hex-dump format if the message contains an UDH. See <a href="udh.html">udh.html</a> and GSM 03.38.</td>
</tr>
<tr>
<td bgcolor=yellow>Length</td>
<td>Available from >= 3.1.
Length of text / data. With Unicode text number of Unicode characters.
If non-Unicode text message is stored using UTF-8, number of bytes may differ.
</td>
</tr>
<tr>
<td bgcolor=yellow>Flash</td>
<td>Available from >= 3.1.
Boolean value. This header exists if a message was received as a flash (immediate display).
Note that usually phone devices do not save flash messages, they can be saved manually if necessary.
</td>
</tr>
</table>
<br>
From version >= 3.0.9 there can be additional headers in case of some problems:
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>Error</td>
<td>Tells if there was fatal errors and a message was not decoded.<br>
Text part of message will tell more details and has no usual content.</td>
</tr>
<tr>
<td bgcolor=yellow>Warning</td>
<td>Tells if there was minor proglems in the message data.</td>
</tr>
</table>
<p>
The filenames of received messages look like <i>modem1.xyzxyz</i>. They begin with the name of the modem that received the message, followed by a dot, followed by six random characters.
<p>
<h3>Status Reports</h3>
<p>
You can request and receive status reports, if the SMSC and your modem support this feature. Example:
<p>
<table border=1 bgcolor=lightgrey><TR><TD>
<font face="Courier New, Courier, monospace">
From: 491721234567<br>
From_SMSC: 491722270333<br>
Sent: 00-02-21 22:26:23<br>
Received: 00-02-21 22:26:29<br>
Subject: modem1<br>
Alphabet: ISO<br>
UDH: false<br>
<br>
SMS STATUS REPORT<br>
Message_id: 117<br>
Discharge_timestamp: 00-02-21 22:27:01<br>
Status: 0,Ok,short message received by the SME
</font>
</TD></TR></table>
<p>
<p>
<table border=1 bgcolor=lightgrey>
<tr>
<td bgcolor=yellow>Message_id</td>
<td>This is the ID number of the previously sent message, where this status report belongs to.
The SMSC gives each sent message such a number.</td>
</tr>
<tr>
<td bgcolor=yellow>Discharge_timestamp</td>
<td>This is the time, when the message was successfully delivered or when it was discarded by the SMSC.</td>
</tr>
<tr>
<td bgcolor=yellow>Status</td>
<td>The status of the message. Please take a look into the source code <b>src/pdu.c</b> if you need a list of all possible status codes.</td>
</tr>
</table>
</body>
</html>
|