SMS messages manipulation.
type udh
=
Types of UDH (User Data Header).
type udh_header
=
{
udh : udh; | (** UDH type. *) |
udh_text : string; | (** UDH text. *) |
id8bit : int; | (** 8-bit ID, when required (<= 0 otherwise). *) |
id16bit : int; | (** 16-bit ID, when required (<= 0 otherwise). *) |
part_number : int; | (** Number of current part. *) |
all_parts : int; | (** Total number of parts. *) |
}
Structure for User Data Header.
type smsc
=
{
smsc_location : int; | (** Number of the SMSC on SIM *) |
smsc_name : string; | (** Name of the SMSC *) |
smsc_number : string; | (** SMSC phone number *) |
validity : validity; | (** Validity of SMS messges. *) |
format : format; | (** Format of sent SMS messages. *) |
default_number : string; | (** Default recipient number. In old DCT3 ignored. *) |
}
SMSC (SMS Center)
type message
=
{
replace : char; | (** Message to be replaced. *) |
reject_duplicates : bool; | (** Whether to reject duplicates. *) |
udh_header : udh_header; | (** UDH (User Data Header) *) |
number : string; | (** Sender or recipient number. *) |
other_numbers : string array; | |
smsc : smsc; | (** SMS Center *) |
memory : memory_type; | (** For saved SMS: where exactly it's saved (SIM/phone). *) |
message_number : int; | (** For saved SMS: location of SMS in memory. *) |
folder : int; | (** For saved SMS: number of folder, where SMS is saved. *) |
inbox_folder : bool; | (** For saved SMS: whether SMS is really in Inbox. *) |
state : state; | (** Status (read, unread,...) of SMS message. *) |
nokia_name : string; | (** Name in Nokia with SMS memory (6210/7110, etc.) Ignored in other. *) |
text : string; | (** Text for SMS. May be encoded as plain
8bit ASCII or as UTF8 according to the
|
pdu : message_type; | (** Type of message. *) |
coding : coding; | (** Type of coding. *) |
date_time : DateTime.t; | (** Date and time, when SMS was saved or sent. *) |
smsc_time : DateTime.t; | (** Date of SMSC response in DeliveryReport messages. *) |
delivery_status : char; | (** In delivery reports: status. *) |
reply_via_same_smsc : bool; | (** Indicates whether "Reply via same center" is set. *) |
sms_class : char; | (** SMS class (0 is flash SMS, 1 is normal one). *) |
message_reference : char; | (** Message reference. *) |
}
val fold : t ‑> ?folder:int ‑> ?n:int ‑> ?retries:int ‑> ?on_err:(int ‑> error ‑> unit) ‑> ('a ‑> multi_sms ‑> 'a) ‑> 'a ‑> 'a
fold s f a
fold SMS messages through the function f
with a
as
initial value, iterating trough SMS' *and* folders).
This function uses the GSM_GetNextSMS function from libGammu. This might be faster for some phones than using Gammu.SMS.get for each message.
Please note that this command may not mark the messages as read in the phone. To make sure they are, call Gammu.SMS.get.
UNKNOWN
or
CORRUPTED
. TODO: On some phones (symbian/gnapgen), it may just loop
forever (since the location argument is ignored in their
driver). (default = 2)UNKNOWN
or CORRUPTED
. The
location of the SMS message for which the next one failed to be read and
the error are given (default: does nothing).set s sms
sets sms
at the specified location and folder (given in
SMS.message representation). And returns a couple for folder and
location really set (after transformation).
add s sms
adds sms
to the folder specified in the folder
field of sms
and returns the couple folder and location where
the message was stored (folder may be transformed). The location
fields of sms
are ignored when adding SMS, put whatever you
want there.
type folder
=
{
box : folder_box; | (** Whether it is inbox or outbox. *) |
folder_memory : memory_type; | (** Where exactly it's saved. *) |
name : string; | (** Name of the folder. *) |
}
type memory_status
=
{
}
Status of SMS memory.
val get_status : t ‑> memory_status
Get information about SMS memory (read/unread/size of memory for both SIM and phone).
val delete : t ‑> folder:int ‑> message_number:int ‑> unit
Deletes SMS (SMS location and folder must be set).
type encode_part_type_id
=
ID during packing SMS for Smart Messaging 3.0, EMS and other
type info
=
{
id : encode_part_type_id; |
nbr : int; |
protected : bool; |
buffer : string; |
left : bool; |
right : bool; |
center : bool; |
large : bool; |
small : bool; |
bold : bool; |
italic : bool; |
underlined : bool; |
strikethrough : bool; |
ringtone_notes : int; |
}
SMS information, like type, text, text properties, etc...
type multipart_info
=
{
unicode_coding : bool; |
info_class : int; |
replace_message : char; |
unknown : bool; |
entries : info array; |
}
Multipart SMS Information
val decode_multipart : ?debug:Debug.info ‑> ?ems:bool ‑> multi_sms ‑> multipart_info
decode_multipart sms
Decode the multi part SMS sms
to
"readable" format. sms
is modified. Return a
Gammu.SMS.multipart_info associated.
di
. If not
specified, use the one returned by Gammu.Debug.global.