SMS options

From GnokiiWiki
Jump to: navigation, search
Command Line Options
         gnokii --getsms memory_type start [end] [-f file] [-F file] [-d]
         gnokii --deletesms memory_type start [end]
         gnokii --sendsms destination [--smsc message_center_number |
                --smscno message_center_index] [-r] [-C n] [-v n]
                [--long n] [-i]
         gnokii --savesms [--sender from] [--smsc message_center_number |
                --smscno message_center_index] [--folder folder_id]
                [--location number] [--sent | --read] [--deliver]
                [--datetime YYMMDDHHMMSS]
         gnokii --getsmsc [start_number [end_number]] [-r|--raw]
         gnokii --setsmsc
         gnokii --createsmsfolder name
         gnokii --deletesmsfolder number
         gnokii --showsmsfolderstatus
         gnokii --smsreader

Contents

--getsms

      --getsms memory_type start [end] [-f file] [-F file] [-a file] [-d]

gets SMS messages from specified memory type starting at entry start and ending at end. For the memory types you usually use SM for the SIM card and ME for the phone memory. The exception are the phones supported by nk7110 (Nokia 7110/6210/6250) and nk6510 (Nokia 6310/6510/8310) drivers. For these you should use IN for the Inbox, OU for the Outbox, AR for the Archive, TE for the Templates and F1, F2, ... for your own folders.

If end is not specified only one location - start is read. Messages are dumped to stdout. Additionally if -f file is used messages are saved in file in mbox format. If the file already exists, user is prompted whether to overwrite the file. -F option forces gnokii to overwrite the file without asking. -a option makes it to be appended to the file. If -d switch is used, a message is deleted after reading.

Saved messages contain the following headers:

  • From
  • Date
  • X-GSM-SMSC
  • X-GSM-Status
  • X-GSM-Memory
  • X-GSM-Location
  • Subject (as the beginning of the text message)

Saving messages to the file has the following limitations:

  • No Content-type header
  • It doesn't handle well concatenated messages (they are saved as separate ones)
  • It handles just text messages

--deletesms

      --deletesms memory_type start [end]

Deletes SMS messages from specified memory type starting at entry start and ending at end. If end is not specified only one location - start is deleted.

Note: when using this command on Series 40 3rd and later with gnokii 0.6.27 the phone doesn't update its status and user interface. Trying to read a deleted SMS from phone menus can cause error messages or a reboot of the phone, power cycle the phone to avoid this.

--sendsms

      --sendsms destination [--smsc message_center_number | --smscno message_center_index]
                [-r|--report] [-8|--8bit]
                [-C|--class n] [-v|--validity n] [-l|--long n]
                [-i|--imelody] [-a|--animation file;file;file;file]
                [-o|--concat this;total;serial] [-w|--wappush url]

sends an SMS message to destination via message_center_number or SMSC number taken from phone memory from address message_center_index. If this argument is omitted SMSC number is taken from location 1 of phone memory as if --smscno 1 was given. Message text is taken from STDIN.

Sent message isn't stored on phone (see --savesms if you want to save it).

Meaning of other optional parameters is:

[-r|--report] - request for delivery report

[-8|--8bit] - set 8bit coding

[-C|--class n] - Class Message n, where n can be 0, 1, 2 or 3

[-v|--validity n] - validity in minutes

[-l|--long n] - send no more then n characters, default is 160

[-i|--imelody] - send iMelody within SMS

[-a|--animation file;file;file;file] - send animation message

[-o|--concat this;total;serial] - send this part of all total parts identified by serial

[-w|--wappush url] - send wappush to the given url

Sample usage:

             echo "This is a test message" | gnokii --sendsms +48501123456 --report

Tip: if you have trouble getting the right text encoding on Windows platforms when using echo try writing a file with Notepad and then use input redirection:

             "C:\path_to_gnokii\gnokii.exe" --sendsms +48501123456 --report < "C:\path_to_textfile\file.txt"

Don't forget to add a CR in your text file.

On Linux you can use iconv to convert between character sets.

Using [-r|--report] when sending concatenated messages with [-l|--long n] results in a delivery report request for each part (you can use [-o|--concat this;total;serial] to send each part separately and use [-r|--report] only on the last, but this doesn't guarantee that previous parts were received.)

--savesms

      --savesms  [--sender  from]  [--smsc  message_center_number  |  --smscno   message_center_index]
      [--folder folder_id] [--location number] [--sent | --read] [--deliver] [--datetime YYMMDDHHMMSS]

saves SMS messages to phone. Messages are read from STDIN. You can specify the following optional arguments:

--sender - set the sender number (only --deliver)

--smsc message_center_number - set the SMSC number (only --deliver)

--smscno message_center_index - SMSC number taken from phone memory from address message_center_index (only --deliver)

--folder folder_id - folder ID where to save the SMS to (only valid for newer phones, i.e. 6210/6510 series). For legal values see --getsms.

--location number - save the message to location number

--sent | --read - mark the message saved/read depending on --deliver

--deliver - set the message type to SMS_Deliver

--datetime YYMMDDHHMMSS - sets datetime of delivery, i.e. 031123185713 would set message delivery time to 23rd November 2003, 6:57:13 PM

--getsmsc

      --getsmsc number [start_number [end_number]] [-r|--raw]

show SMSC parameters from specified location(s). --raw output can be used as input for --setsmsc

--setsmsc

      --setsmsc

set SMSC parameters read from STDIN. See --getsmsc number --raw output for syntax.

--createsmsfolder

      --createsmsfolder name

create SMS folder with name name.

--deletesmsfolder

      --deletesmsfolder number

delete folder # number of 'My Folders'.

--showsmsfolderstatus

      --showsmsfolderstatus

show information about SMS folders. Note: each part of a multipart message counts as one

Example:

         gnokii --showsmsfolderstatus
         GNOKII Version 0.6.32
         No. Name                             Id #Msg
         ============================================
           0 SMS Inbox                        SM   42

--smsreader

      --smsreader

keeps reading incoming SMS and saves them into a mailbox under /tmp/sms/* (actual filename varies). If everything works as expected, incoming SMS are never saved in phone.

Note: if the method used to get notification of incoming SMS isn't supported by your phone, try smsd which uses a different method and also supports sending SMS.

Example:

         gnokii --smsreader