EMG 3.1.5 - User's Guide
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:
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:
Use specified hostname when connecting to server.
Use specified port when connecting to server.
Username for server authentication.
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:
Set log level to DEBUG and display information on stdout.
Set log level to DEBUG2 (even more debug info) and display information on stdout.
Run in foreground, do not detach from tty.
Display hostid as emgd reads it.
Refresh running server.
Refresh running server without terminating current sessions.
Stop running server.
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.
Upgrade the database schema. If the number of records are large this may take several hours when altering existing tables.
Print the SQL commands that would be executed to upgrade the database schema without actually executing them.
Display version and license information.
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:
Use specified hostname when connecting to server.
Use specified port when connecting to server.
Username for server authentication.
Password for server authentication.
Read recipients from the specified file. Format of file is one recipient per line.
Read the message body from the specified file.
Message is hex encoded.
Specify message options.
Do not display message id.
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:
Use specified hostname when connecting to server.
Use specified port when connecting to server.
Username for server authentication.
Password for server authentication.
Show database instance information.
Display detailed information.
Output will be in 11 columns with the following information:
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 of MMS:
Allowed values:
get
send (default)
Sender
Sender type (PLMN, IPV4, IPV6, EMAIL)
Recipient
Recipient type (PLMN, IPV4, IPV6, EMAIL)
Message subject
Specified a file that contains extra message headers to be added
Output protocol (EAIF, MM1, MM7, PAP)
Default MM1
Transaction
Output file
Decompile the specified MMS file
Display debug information on stdout
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 of WAP push:
Allowed values:
SI - Service Indication
SL - Service Loading
URL or href to use. http:// will be inserted automatically.
URL or href to use. https:// will be inserted automatically.
Only used for type SI.
Push text.
Only used for type SI.
Creation date.
Only used for type SI.
Date for expiration.
Only used for type SI.
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



