www.nordicmessaging.se

EMG 3.0.17 - User's Guide

Table of ContentsPreviousNextIndex

A. Command reference

The client utilities described below can be run from the command-line prompt in the operating system. They check EMGDIR/client.cfg for information about host, port, username and password. If all or part of this information is missing from the configuration file it has to be specified on the command-line.

All command utilities display help information when executed with "-help" as argument.

# emgsend -help

The utilities will return exit codes as follows:

0
Successful
1
Unknown or unspecified error
3
Invalid login
5
Invalid argument
10
Access denied

When using Bourne shell you can display the exit code by running "echo $?" after executing a command.

Example:

# emgsend 12345 "Test"
758901
# echo $?
0

A.1 emgclient

Interactive utility that enables a user to operate on messages, display queues and more. It uses the MGP protocol to communicate with the server. To be able to perform all available tasks and display all queue and orphan entries the user needs to be defined as an administrator in the user file.

Options:

-host <host name | IP address>
Use specified hostname when connecting to server.
-port <port number>
Use specified port when connecting to server.
-username <username>
Username for server authentication.
-password <password>
Password for server authentication.

A.2 emgd

The EMG server.

When the server is stopped all connector queues are flushed to file. In EMG 1.0h and later this file is named EMGDIR/queues.dat, in earlier versions EMGDIR/flush.dat. Also the routing log is flushed to disk as EMGDIR/routelog.dat.

In EMG 3 when using the persistence option all messages, DLRs and SAT entries are persisted in the spool directory specified by general option SPOOLDIR which defaults to /var/spool/emg.

Options:

-debug
Set log level to DEBUG and display information on stdout.
-debug2
Set log level to DEBUG2 (even more debug info) and display information on stdout.
-fg
Run in foreground, do not detach from tty.
-hostid
Display hostid as emgd reads it.
-refresh
Refresh running server.
-reload
Refresh running server without terminating current sessions.
-stop
Stop running server.
-threadcount
Count the number of threads can can be created. This gives a hint on the total maximum number of instances the EMG server can handle since each connector instance requires 1 or 2 threads depending on protocol used.
-upgradedb
Upgrade the database schema. If the number of records are large this may take several hours when altering existing tables.
-upgradesql
Print the SQL commands that would be executed to upgrade the database schema without actually executing them.
-v
Display version and license information.
-verify
Parse the configuration file and report found configuration errors (without starting the server).

Examples:

# emgd
# emgd -debug

A.3 emgsend

Used to send messages using the MGP protocol.

By default the newly assigned message id is displayed when the message has been successfully sent to the server.

Options:

-host <host name | IP address>
Use specified hostname when connecting to server.
-port <port number>
Use specified port when connecting to server.
-username <username>
Username for server authentication.
-password <password>
Password for server authentication.
-b <filename>
Read recipients from the specified file. Format of file is one recipient per line.
-file <filename>
Read the message body from the specified file.
-hex
Message is hex encoded.
-o
Specify message options.
-q
Do not display message id.
-url
URL to use for HTTP based protocols.

Examples:

# emgsend 101010 "Test message"
# emgsend -hex 414243
# emgsend -o ROUTE=cimd2-1 101010 "Test message"

A.4 emgstat

Display information about connectors and connector states

Options:

-host <host name | IP address>
Use specified hostname when connecting to server.
-port <port number>
Use specified port when connecting to server.
-username <username>
Username for server authentication.
-password <password>
Password for server authentication.
-db
Show database instance information.
-x
Display detailed information.

Output will be in 11 columns with the following information:

NAME
Connector name
INDEX
Connector index or position server.cfg file
TYPE
IN for incoming, OUT for outgoing connector
PROTO
Protocol
INST
Number of instances
USED
Maximum number of instances that is or has been in use since system start
STATE
Connector state
QSIZE
Connector queue size
AVG 1M
Number of messages per sec processed during the last minute
AVG 5M
Number of messages per sec processed during the last 5 minutes
AVG 15M
Number of messages per sec processed during the last 15 minutes

Example:

# emgstat
NAME             INDEX TYPE PROTO INST USED STATE  QSIZE  AVG 1M  AVG 5M AVG 15M
mgp-in1              0 IN   MGP      1    1 BOUND      0  0.00    0.00   0.00  
smpp-in1             1 IN   SMPP     7    1 BOUND      0  0.00    0.00   0.00  
smtp1                2 OUT  SMTP     0    0 DEAD       0  0.00    0.00   0.00  
ucp-andrew           3 OUT  UCP      1    0 IDLE       0  0.00    0.00   0.00  
ucp-d2               4 OUT  UCP      1    0 IDLE       0  0.00    0.00   0.00  
cimd2-euro           5 OUT  CIMD2    1    0 IDLE       0  0.01    0.01   0.00

A.5 mmscomp

Compile/decompile a MMS message into/from binary form.

Options:

-type <value>
Type of MMS:

Allowed values:
get
send (default)
-from <text>
Sender
-fromtype <text>
Sender type (PLMN, IPV4, IPV6, EMAIL)
-to <text>
Recipient
-totype <text>
Recipient type (PLMN, IPV4, IPV6, EMAIL)
-subject <text>
Message subject
-headers <filename>
Specified a file that contains extra message headers to be added
-protocol <text>
Output protocol (EAIF, MM1, MM7, PAP)
Default MM1
-transaction <text>
Transaction
-o <filename>
Output file
-d <filename>
Decompile the specified MMS file
-debug
Display debug information on stdout
-debug2
Display even more debug information on stdout

A.6 pushtohex

Encode a WAP push PDU according to WAP-167 and WAP-168.
The output will be hex encoded and can be used with emgsend as shown below.

Options:

-type <value>
Type of WAP push:

Allowed values:
SI - Service Indication
SL - Service Loading
-href <URL>
URL or href to use. http:// will be inserted automatically.
-hrefs <URL>
URL or href to use. https:// will be inserted automatically.
-id <si-id>
Only used for type SI.
-text <string>
Push text.
Only used for type SI.
-created <YYYYMMDD>
Creation date.
Only used for type SI.
-expires <YYYYMMDD>
Date for expiration.
Only used for type SI.
-action <value>
Allowed values (SI):
signal-low
signal-medium (default)
signal-high
signal-none
delete

Allowed values (SL):
execute-low (default)
execute-high
cache

Example (sending a WAP push to MSISDN 012345678):

# pushtohex -type SI -href wap.domain.com -text "Test link"

01060403AE81EA02056A0045C60C037761702E646F6D61696E2E636F6D00010
35465737420646F6D61696E000101

# emgsend -o DESTPORT=2948 -o SOURCEPORT=9200 -o CHARCODE=2 \
-hex 012345678 01060403AE81EA02056A0045C60C037761702E646F6D6\
1696E2E636F6D0001035465737420646F6D61696E000101

A.7 rttltohex

Encode a RTTL file as a Nokia Smart Message PDU.
The output will be hex encoded and can be used with emgsend as shown below.

Please note that the receiving phone must support Nokia Smart Messaging.

Example (sending a ringtone to MSISDN 012345678):

# rttltohex abdelazer.rttl

0C0106050415811581024A3A6505899195B185E995C80400E4D90413220B110
6889268495624B31261892CC4956249B124889348493624B31269892CC49342
4D112610922C495624C312558922849A224B210718926C4966249B107109304
495420D31249892AC491620D21258892AC496624AB124D89248496424AB1259
892AC493620D2124D0924C493624AB124D8926400001

# emgsend -o DESTPORT=5505 -o SOURCEPORT=0 -o CHARCODE=2 -hex \
012345678 0C0106050415811581024A3A6505899195B185E995C80400E4D90\
413220B1106889268495624B31261892CC4956249B124889348493624B31269\
892CC493424D112610922C495624C312558922849A224B210718926C4966249\
B107109304495420D31249892AC491620D21258892AC496624AB124D8924849\
6424AB1259892AC493620D2124D0924C493624AB124D8926400001

Table of ContentsPreviousNextIndex