LTEIMS is an IMS standalone simple server. It has a built-in P-CSCF, I-CSCF, S-CSCF, HSS. It also allows SMS handling including SMS over SG by connecting to the Amarisoft MME.
The Amarisoft IMS server has been tested with the following UE models:
Your system requires at least GLIBC 2.17.
The network access thru the Gigabit Ethernet port must be correctly configured.
LTEIMS can be run directly from the directory when it was unpacked. No need for explicit installation.
If you want to use SMS over SG with the Amarisoft MME or precondition with QoS, you need support of SCTP protocol for which the necessary packages are not usually installed. In order to install them, do as root user:
dnf install lksctp-tools kernel-modules-extra
sudo apt-get install lksctp-tools linux-image-extra-3.13.0-24-generic
Note that linux-image-extra package name may differ depending on your kernel version.
To verify that SCTP kernel module is running, do as root user:
checksctp
If it reports that the protocol is not supported,
Then reboot the PC in case the Linux kernel was upgraded too.
LTEIMS needs a LTEMME license key to run.
Please refer to the ltemme documentation.
./lteims config/ims.cfg
[The root access is only needed if you want IPsec support.]
help to get the list of commands and quit to stop the program.
users to list the user database and registering state.
Your UE must run at least Android 5.0 (Even if Android 5.0 is installed, try to update software
(several times) as a sub-release is necessary).
If not, please update it.
To check your UE is configured for VoLTE, please go to
Settings/More networks/Mobile networks of your handset
and check VoLTE Call is checked:
We assume you are using the system with Amarisoft MME and config/mme-ims.cfg config file.
As there are two PDN defined, you must add them to the UE.
The main configuration file uses a syntax very similar to the Javascript Object Notation (JSON) with few extensions.
13.4
1.2+3*I
"string"
true or false.
{ field1: value1, field2: value2, .... }
[ value1, value2, .... ]
+, -, * and / are
supported with numbers and complex numbers. + also concatenates
strings. The operators !, ||, &&, ==,
!=, <, <=, >=, > are supported too.
0 and 1 are accepted as synonyms for the
boolean values false and true.
{
value: "foo",
value: "bar",
sub: {
value: "foo"
},
sub: {
value: "bar"
}
}
Will be equivalent to:
{
value: "bar",
sub: {
value: "bar"
}
}
value: "foo",
include "file2.cfg",
foo: "foo"
And file2.cfg is:
value: "bar",
foo: "bar"
Final config will be:
{
value: "bar",
foo: "foo"
}
#define var exprDefine a new variable with value expr. expr must be a valid JSON expression. Note that unlike the standard C preprocessor, expr is evaluated by the preprocessor.
#undef varUndefine the variable var.
#include exprInclude the file whose filename is the evaluation of the string expression expr.
#if exprConsider the following text if expr is true.
#elseAlternative of #if block.
#elifComposition of #else and #if.
#endifEnd of #if block.
#ifdef varShortcut for #if defined(var)
#ifndef varShortcut for #if !defined(var)
In the JSON source, every occurrence of a defined preprocessor variable is replaced by its value.
${expr} syntax. Example: `abc${1+2}d` is evaluated as the string "abc3d". Preprocessor variables can be used inside the expression. Backquote strings may span several lines.
Merge overriding direction depends on context, i.e source may override destination or the opposite.
JSON merge is recursive for Objects and Arrays.
Example, merging
{
foo: { value: "bar" },
same: "one",
one: 1
}
with
{
foo: { value: "none", second: true },
same: "two",
two: 1
}
Will become:
{
foo: { value: "bar", second: true },
same: "one",
one: 1
two: 1
}
assuming first object overrides second one.
In case of Array merging, the final array length will be the maximum length of all merged arrays.
For each element of the final array, merge will be done considering defined elements only.
Ex:
{
array: [0, 1, 2, { foo: "bar" } ],
array: [3, 4],
array: [5, 6, 7, { bar: "foo" }, 8 ]
}
Will be merged to:
{
array: [5, 6, 7, { foo: "bar", bar: "foo" }, 8 ],
}
log_filenameString. Set the log filename. If no leading /, it is relative to the
configuration file path. See Log file format.
log_optionsString. Set the logging options as a comma separated list of assignments.
none, error, info or debug. In debug
level, the content of the transmitted data is logged.
n bytes are shown in hexa. For ASN.1, NAS or Diameter content, show the full content of the message if n > 0.
layer is ipsec, dump all packets filtering informations.
Available layers are: ims, sip, media, rx, cx, n5
log_syncOptional boolean (default = false). If true, logs will be synchronously dumped to file.
Warning, this may lead to performances decrease.
sip_addrArray. Each item is an object representing a SIP server socket defined as follow:
addrString. Set the IP address (and an optional port) on which IMS server will listen for SIP packets. The default port is 5060.
bind_addrOptional string. Defines network interface on which IMS will listen.
If not specified, the addr parameter is used.
port_minOptional integer (Default is 10000). Defines lower bound of UDP media socket.
port_maxOptional integer (Default is 20000). Defines upper bound of UDP media socket.
NB:
addr parameter and all other parameters will use default value.
sip_addr can be a single SIP socket (Object or String)
instead of an Array.
sctp_addrString. Set the IP address (and an optional port) for MME connection.
This is only necessary for SMS over SG feature.
cx_server_addrString. Set the IP address (and optional port) of Cx SCTP connection to the HSS. The default port is 3868.
cx_bind_addrOptional string. IP address and optional port on which the Cx SCTP
connection is bound. If not set, sctp_addr is used.
cx_origin_realmOptional string. Defines the string sent in the Origin-Realm AVP for
Cx messages. Default is set to amarisoft.com.
cx_origin_hostOptional string. Defines the string sent in the Origin-Host AVP for
Cx messages. Default is set to ims.amarisoft.com.
cx_watchdog_durationOptional integer (range 0 to 36000000, default = 0). Tw watchdog timer in milliseconds to send the Diameter Device Watchdog Request message. The value 0 deactives the watchdog.
rx_server_addrOptional string. Set the IP address (and optional port) of Rx SCTP
connection to the MME. The default port is 3868. If not set,
cx_server_addr is used.
rx_bind_addrOptional string. IP address and optional port on which the Rx SCTP
connection is bound. If not set, cx_bind_addr is used.
rx_origin_realmOptional string. Defines the string sent in the Origin-Realm AVP for
Rx messages. Default is set to amarisoft.com.
rx_origin_hostOptional string. Defines the string sent in the Origin-Host AVP for
Rx messages. Default is set to ims.amarisoft.com.
rx_watchdog_durationOptional integer (range 0 to 36000000, default = 0). Tw watchdog timer in milliseconds to send the Diameter Device Watchdog Request message. The value 0 deactives the watchdog.
use_n5Optional boolean (default = false). If set, the N5 interface is used instead of the Rx interface.
n5Optional object used to configure the N5 interface with the PCF.
api_rootString. apiRoot as defined in 3GPP TS 29.501: <scheme>://<host>:<port>, where <scheme> is "http" or "https".
transaction_timeoutOptional integer (range 1 to 15000, default = 4000). Defines the timeout in milliseconds for a transaction with the PCF.
bind_addrOptional string. IP address and optional port on which the N5 TCP
connection is bound. If not set, cx_bind_addr is used.
domainString. Global SIP domain used for IMPU and authentication. May be overriden at user level.
This parameter is not used to recover IMPU.
tcp_thresholdOptional integer (default = 1300). Set packet threshold in bytes to use TCP instead of UDP.
tcp_keepaliveOptional integer (default = 900). Time in seconds before sending keepalive on TCP connections. 0 means disabling keepalive.
tcp_keepcountOptional integer (default = 2). Number of TCP keepalive failure before releasing socket.
session_expiresOptional object. Defines session timer configuration.
Parameters are the following:
durationOptional integer (default = 1800). Session duration in seconds.
minOptional interger (default = 90). Minimum allowed session expires.
refresherOptional string (default = uac). Defines session refresher when it is up to the IMS to take this decision.
methodOptional string (default = update). Defines SIP method to use for session refresh when IMS is the refresher.
forceOptional boolean (default = true). If set to true, forces the refresher in IMS request with the refresher value.
For legacy purpose, session_expires can be an integer. If so, only duration is set and other
parameters are kept to their default value.
100relOptional Boolean (default = true). Enable/disable 100rel support.
preconditionOptional string (default = on). Values can be "on", "off" or "silent".
On: IMS will handled QoS according to the standard.
Off: no precondition and no dedicated bearer establishment.
Silent: dedicated bearers will be established regardless the SIP and SDP content.
Note that a Rx connection is necessary to allow dedicated bearer establishment.
p_called_party_idOptional boolean (default is false). Enable P-Called-Party-ID header for INVITE and MESSAGE requests.
ipsecOptional boolean (default is true). Enable/disable support of ipsec.
ipsec_aalg_listArray of strings. Each string represent IPsec authentication algorithm supported by IMS.
"null" may be used to indicate no authentication.
Supported algorithms are:
ipsec_ealg_listArray of strings. Each string represent IPsec encryption algorithm supported by IMS.
"null" may be used to indicate no encryption.
Supported algorithms are:
ipsec_mtuOptional integer (range 68 to 65535, default = 1400). MTU for IPsec network interface.
ipsec_ifnameOptional string. If set, use this interface for IPsec. In that case, ipsec_netns must be
set and interface must be added to the network namepsace.
In this mode, used to run lteims with non root privileges, it is up to the user to configure
the tun interface.
In particular:
sip_addr IP addresses to the interface
ipsec_mtu will be ignored)
Ex:
setcap cap_sys_admin,cap_net_raw=ep lteims ip tuntap add mode tun <ifname> ip link set dev <ifname> name <ifname> netns <netns> ip netns exec $netns ip addr add 192.168.4.1/0 dev <ifname> ip netns exec $netns ip addr add 192.168.0.103/0 dev <ifname> ip netns exec $netns ip link set <ifname> up mtu 1400 ip netns exec $netns ip route add default dev <ifname>
ipsec_netnsOptional string. Must be set if ipsec_ifname is set. Defines network namespace name
used for ipsec.
dialog_timeoutOptional integer (default = 30). Time in seconds of call session. Stop call if no activity has been detected during this time.
auth_on_register_onlyOptional boolean (default = true). If true, don’t try to authenticate other request than register (unless expires is set to 0).
trunkOptional object. If set, IMS will accept incoming calls from a SIP trunk and will forward
unknown calls to SIP trunk (https://tech-academy.amarisoft.com/how_to_run_volte_call_using_a_sip_trunk.wiki).
SIP trunk must accept non authenticated requests.
Parameters are the following:
addrString. IP address of the SIP trunk.
nameString. SIP trunk account user name.
domainOptional string (default = same as addr). If set, use this for SIP uri domain.
tcp_thresholdOptional integer (default = 0). If > 0, will override global tcp_threshold parameter.
com_addrOptional string. Address of the WebSocket server remote API. See Remote API.
If set, the WebSocket server for remote API will be enabled and bound to this address.
Default port is 9003.
Setting IP address to [::] will make remote API reachable through all network interfaces.
com_nameOptional string. Sets server name. IMS by default
com_ssl_certificateOptional string. If set, forces SSL for WebSockets. Defines CA certificate filename.
com_ssl_keyOptional string. Mandatory if com_ssl_certificate is set. Defines CA private key filename.
com_ssl_peer_verifyOptional boolean (default is false). If true, server will check client certificate.
com_ssl_caOptional string. Set CA certificate. In case of peer verification with self signed certificate, you should use the client certificate.
com_log_lockOptional boolean (default is false). If true, logs configuration can’t be changed
via config_set remote API.
com_log_usOptional boolean (default is false). If true, logs sent by log_get remote API
response will have a timestamp_us parameters instead of timestamp
com_authOptional object. If set, remote API access will require authentication.
Authentication mechanism is describe in Remote API Startup section.
passfileOptional string. Defines filename where password is stored (plaintext).
If not set, password must be set
passwordOptional string. Defines password.
If not set, passfile must be set.
unsecureOptional boolean (default false). If set, allow password to be sent plaintext.
NB: you should set it to true if you access it from a Web Browser (Ex: Amarisoft GUI)
without SSL (https) as your Web Browser may prevent secure access to work.
com_log_countOptional number (Default = 8192). Defines number of logs to keep in memory before dropping them.
Must be between 4096 and 2097152).
sim_eventsArray of object. Each element gives an event configuration to execute for
this UE.
Event configuration is exactly the same as for Remote API messages
except that message field must be event.
sim_events_loop_countIf set, will define loop_count for each event of sim_events, See loop_count.
sim_events_loop_delayIf set, will define loop_delay for each event of sim_events, See loop_delay.
license_serverConfiguration of the Amarisoft license server to use.
Object with following properties:
server_addrString. IP address of the license server.
nameOptional string. Text to be displayed inside server monitor or remote API.
tagOptional string. If set, server will only allow license with same tag.
Example:
license_server: {
server_addr: "192.168.0.20",
name: "My license"
}
sms_expiresInteger (default = 86400). Delay in seconds before SMS is removed from database. If a MO
SMS contains the TP-Validity-Period field, it will be used instead of sms_expires.
sms_hook_onlyOptional boolean (default = false). If set, when SMS is received and at least one
WebSocket client has registered to sms event, don’t process SMS internally
(Only CP/RP layer will be handled).
binding_expiresInteger (default = 3600, max = 864000). Default duration in seconds for registration.
subscribe_expiresInteger (default = 0, max = 864000). Subscription expiration. If set to 0, use value sent by UE.
user_agentOptional string (default = Amarisoft-IMS-2024-12-13). SIP user agent.
force_user_agentBoolean (default = true). If true, IMS user-agent will always be used, else remote peer’s one will be used.
pathOptional string (default = sip:ims.mnc001.mcc001.3gppnetwork.org).
SIP path. If registration supports path, defines content of the Path header in
registration response. If set to an empty string, Path header won’t be set.
timer_t1Optional number (default = 2). SIP T1 timer duration in seconds.
timer_t2Optional number (default = 16). SIP T2 timer duration in seconds.
timer_t4Optional number (default = 17). SIP T4 timer duration in seconds.
custom_headersArray of object. Each object represents a custom header to add to requests and/or responses, defined as follows:
nameHeader name
valueHeader value
codesNumber or array of numbers of the SIP responses on which to apply custom headers.
0 can be used for all codes.
methodsString or array of strings of the SIP method on which to apply custom headers.
* can be used for all methods.
If codes is set, the custom headers will be applied to the responses of
the associated request.
replaceOptional boolean (default = false). If set, allow only one occurence of the header.
sms_centre_addressOptional object used to configure the SMS centre address. Contains the following parameters:
type_of_numberOptional enumeration "unknown", "international", "national" (default = "unknown"). SMS centre address type of number.
numbering_planOptional enumeration "unknown", "national", "private" (default = "unknown"). SMS centre address numbering plan identification.
numberString. Contains optional ’+’ at first position followed by a maximum of 20 digits. SMS centre address number.
sms_retry_delayInteger. Time in s to retry SMS sending.
100relOptional boolean (default = true). Enable/disable support of provisional response
echoIMPU (See impu). If set, this defines the phone number(s) for echo service.
mt_call_sdp_fileString. File to use as SDP when using MT call.
sms_message_filterOptional object. Allows to define the IMS behavior for a list of SMS related messages.
Each property name represents a SMS message type. The ones currently supported are
cp_data, cp_ack, rp_data and rp_ack.
Each property value is an enum: treat (message is processed),
ignore (message is ignored) or reject (message is rejected).
By default all procedures are treated.
Example:
sms_message_filter: {
cp_data: "treat",
rp_ack: "reject"
}
sms_forced_cp_causeOptional integer (range 0 to 255). Allows to override the CP error cause selected by the IMS with the one configured. Set to 0 to deactivate the override.
sms_forced_rp_causeOptional integer (range 0 to 255). Allows to override the RP error cause selected by the IMS with the one configured. Set to 0 to deactivate the override.
mms_server_bind_addrDefines network interface on which MMS server will listen. It is used to configure the MMSC in the UE. MMS proxy is not supported and shall not be configured in the UE.
Example:
mms_server_bind_addr: "192.168.3.1:1111" MMSC: http://192.168.3.1:1111
mms_expiresOptional integer (default = 86400). Delay in seconds before MMS is removed from database.
ue_dbArray of objects. Configure the user database. Each element is an entry for one user. Note that this part can be shared between Amarisoft MME and IMS. The following properties are available:
imsiOptional string. Set the IMSI.
Shall be present if nai is absent.
naiOptional string. Network specific identifier-based SUPI.
Shall be present if imsi is absent.
multi_simOptional boolean (default = false). If true, allow several UEs to have the same IMSI (useful when using several identifical test SIM cards in different UEs at the same time). They are distinguished with their IMEI. Note: it is only allowed with the XOR authentication algorithm.
impiString. Defines user IMPI. Must be fully filled with hostname if necessary.
If you don’t know your IMPI, please look at IMS logs inside REGISTER
request. The IMPI must match the username argument inside
Authorization header.
impuArray of strings or array of objects.
Each string represent an IMPU and can be a sip URI or a telephone number.
Note that sip URI must not include hostname.
If IMPU does not start by a scheme, it is assumed to be a sip URI.
Ex:
If impu is an object, it has following members:
impuIMPU as defined above.
imeiIMEI associated to this IMPU. Allows to filter calls and SMS for
a specific UE.
Only relevant if multi_sim is set to true.
anonymousOptional boolean (default is false). If true, allow Anonymous connection (Emergency call) and mask impu in SIP headers.
anonymous_callbackOptional number (default is 0). If anonymous is set, defines how long in seconds after an anonymous call has been done,
the network can call back the caller. In that case, caller will be identified with an sip IMPU derived from its IMEI.
authenticationOptional boolean (default is true). If false, disable authentication.
ring_onlyOptional boolean (default is false). If true, IMS will go up to ringing state but not further.
preconditionOptional string. Values can be "on", "off" or "silent".
On mode: IMS will try to guess precondition from supported header, SDP content and/or VoLTE compatibility of client.
Off mode: no precondition and no dedicated bearer establishment.
Silent mode: dedicated bearers will be established whatever the SIP and SDP content.
100relOptional boolean (default = true). Enable/disable 100rel support for this IMPU.
preferredOptional boolean (default: false). If set, this impu will be used for preferred identity and for INVITE request URI.
assertedOptional boolean (default: false). If set, this impu will be used for asserted identity.
associatedOptional boolean (default: true). If set to false, this impu will not be used for associated URI.
display_nameOptional string. If set, SIP headers will use this field for display name.
domainOptional string. Used to override user or global config.
p_called_party_idOptional string. If set, forces P-Called-Party-ID header for INVITE and MESSAGE requests,
no matter if p_called_party_id global parameter is set or not.
answer_delayOptional number. If set, when doing a echo call on this IMPU, OK response to INVITE request
will be delayed by answer_delay in seconds.
sms_delayOptional number. If set, IMS will wait sms_delay seconds before sending SMS to this IMPU.
media_delayOptional number. Delay sending of media packet in seconds.
remote_controlOptional boolean. If set to true on a echo impu, the sending of final of INVITE request will be controled
by dialog_set remote API with answer action (The delay to send answer is defined by dialog_timeout
parameter.
A remote API invite event will be sent with dialog session_id.
sdp_fileOptional string. When used in echo mode, use the SDP file to force the media sent in server SDP response.
session_expiresOptional object. If set, will override global session timer parameters for that impu, See session_expires.
If IMS is the server (MO call and echo call), caller configuration will be used, else (MT call) callee’s one will
be used.
bitrate_factorOptional number (Default = 1). Media bitrate are estimated from SDP. When setting up the dedicated bearer via Rx interface, the bitrate is multiplied by this number.
videoOptional boolean (default = true). If set to false, video media will be rejected.
callflow_modifierOptional object or array of objects. This allows to modify IMS behavior and messages.
Each object will define a modification in the SIP callflow.
The modifier will be applied with following rules:
Each object is defined this way:
methodOptional string. Defines on which step to apply modifier (if not set, applies on any of the following). Modifier applies on reception or sending of
message depending on dir parameter
If set to INVITE.OK, modifier applies on final answer of INVITE request.
If set to INVITE.TRYING, modifier applies on 100 SIP responses.
If set to INVITE.RINGING, modifier applies on 180 SIP responses.
If set to INVITE.SESSION_PROGRESS, modifier applies on 183 SIP responses.
If set to INVITE, SUBSCRIBE, REGISTER, UPDATE, CANCEL, PRACK,
MESSAGE, modifier applies on received or sent requests.
If set to REGISTER.SOS, modifier applies on reception of emergency REGISTER.
If set to REINVITE, modifier applies on received or sent INVITE requests during an established dialog.
codeOptional number (between 100 and 699). If set, modifier will generate a SIP response with this code and
modifier will apply on this message.
If code is not set, no response wil be generated.
stopOptional boolean (default = true). If set to true and modifier applies within a dialog, dialog will be stopped. In that case, normal callflow will be stopped.
dirOptional string (default = both). Can be tx to apply modifier on sent messages, rx to apply modifier on received messages
or both for both type of messages.
transparentOptional boolean (default = false). If true, modifier will be applied without stopping the normal call flow.
contentOptional string. Response body will be filled with content file on generated message. If set to null,
any already set content with same content_type will be removed (Ex: use application/sdp to remove SDP).
content_typeOptional string. Mandatory if content is set, will define response content type.
access_networkOptional string (default = false). List of RAT separated by comma. If set the callflow will only be affected
if P-Access-Network-Info matches the selected RAT. Can be lte (3GPP-E-UTRA), nr (3GPP-NR),
or n3gpp (IEEE).
custom_headersOptional Array of object. Apply specific headers on the generated response as defined in custom_headers,
except that code and methods parameters are useless.
impuOptional string. Is set, modifier will be applied only if counterpart of the dialog matches this IMPU:
imeiOptional string. Is set, modifier will be applied only if counterpart (Cf impu) has same IMEI provided
during registration.
ttlOptional integer (> 0) (Time To Live). If set, callflow modifier will be removed after having being applied ttl times.
ttsOptional integer (default = 0) (Time To Start).
If set, callflow modifier will not be applied for the the tts times it has been triggered.
This will differ ttl decreasing.
send_delayOptional number (default = 0, max = 60). Delay in seconds of SIP message sending
codeDeprecated. See callflow_modifier
methodDeprecated. See callflow_modifier
contentDeprecated. See callflow_modifier
content_typeDeprecated. See callflow_modifier
transparentDeprecated. See callflow_modifier
authent_typeOptional string (default = AKAv1). Defines minimum authentication level.
If client does no specify authentication algo, server will use this value.
Else, server will allow authentication only if client provided algo is at
least the one specified by this parameter.
Values are (from lowest security to highest):
noneDisable authentication.
MD5MD5 digest authentication.
AKAv1AKAv1 authentication.
AKAv2AKAv2 with MD5 hash authentication.
AKAv2-SHA-256AKAv2 with SHA-256 hash authentication.
authent_qopOptional string (default = none). Defines authentication qop parameter and can be:
noneDon’t set qop.
authUse auth qop directive.
pwdOptional string. Password set for MD5 authentication. If set and authent_type is not set, authent_type is set to MD5.
mt_call_sdp_fileOptional string. File to use as SDP when using MT call. Overrides global parameter.
domainOptional string. If set, overrides global config.
auth_on_register_onlyOptional boolean. If set, overrides global config.
force_sms_over_sgOptional boolean. If set, forces use of SMS over SG.
ue_db_filenameOptional string. If present, store the current IMS state in a persistent file. The IMS state contains in particular the registration info and pending SMS.
You can access LTEIMS via a remote API.
Protocol used is WebSocket as defined in RFC 6455
(https://tools.ietf.org/html/rfc6455).
Note that Origin header is mandatory for the server to accept connections.
This behavior is determined by the use of nopoll library.
Any value will be accepted.
Messages exchanged between client and LTEIMS server are in strict JSON
format.
Each message is represented by an object. Multiple message can be sent to
server using an array of message objects.
Time and delay values are floating number in seconds.
There are 3 types of messages:
Message sent by client.
Common definition:
messageString. Represent type of message. This parameter is mandatory and depending
on its value, other parameters will apply.
message_idOptional any type. If set, response sent by the server to this message will have same message_id. This is used to identify response as WebSocket does not provide such a concept.
start_timeOptional float. Represent the delay before executing the message.
If not set, the message is executed when received.
absolute_timeOptional boolean (default = false). If set, start_time is interpreted as absolute.
You can get current clock of system using time member of any response.
standaloneOptional boolean (default = false). If set, message will survive WebSocket disconnection, else, if socket is disconnected before end of processing, the message will be cancelled.
loop_countOptional integer (default = 0, max = 1000000). If set, message will be repeated loop_count time(s)
after loop_delay (From message beginning of event).
Response will have a loop_index to indicate iteration number.
loop_delayOptional number (min = 0.1, max = 86400). Delay in seconds to repeat message from its start_time.
Mandatory when loop_count is set > 0.
Message sent by server after any request message as been processed.
Common definition:
messageString. Same as request.
message_idOptional any type. Same as in request.
timeNumber representing time in seconds since start of the process.
Usefull to send command with absolute time.
utcNumber representing UTC seconds.
Message sent by server on its own initiative.
Common definition:
messageString. Event name.
timeNumber representing time in seconds.
Usefull to send command with absolute time.
When WebSocket connections is setup, LTEIMS will send a first message with
name set to com_name and type set to IMS.
If authentication is not set, message will be ready:
{
"message": "ready",
"type": "IMS",
"name": <com_name>,
"version": <software version>,
"product": <Amarisoft product name (optional)>
}
If authentication is set, message will be authenticate :
{
"message": "authenticate",
"type": "IMS",
"name": <com_name>,
"challenge": <random challenge>
}
To authenticate, the client must answer with a authenticate message
and a res parameter where:
res = HMAC-SHA256( "<type>:<password>:<name>", "<challenge>" )
res is a string and HMAC-SHA256 refers to the standard algorithm
(https://en.wikipedia.org/wiki/HMAC)
If the authentication succeeds, the response will have a ready field
set to true.
{
"message": "authenticate",
"message_id": <message id>,
"ready": true
}
If authentication fails, the response will have an error field and will
provide a new challenge.
{
"message": "authenticate",
"message_id": <message id>,
"error": <error message>,
"type": "IMS",
"name: <name>,
"challenge": <new random challenge>
}
If any other message is sent before authentication succeeds,
the error "Authentication not done" will be sent as a response.
If a message produces an error, response will have an error string field representing the error.
You will find in this documentation a sample program: ws.js.
It is located in doc subdirectory.
This is a nodejs program that allow to send message to LTEIMS.
It requires nodejs to be installed:
dnf install nodejs npm npm install nodejs-websocket
Use relevant package manager instead of NPM depending on your Linux distribution.
Then simply start it with server name and message you want to send:
./ws.js 127.0.0.1:9003 '{"message": "config_get"}'
config_getRetrieve current config.
Response definition:
typeAlways "IMS"
nameString representing server name.
logsObject representing log configuration.
With following elements:
layersObject. Each member of the object represent a log layer configuration:
layer nameObject. The member name represent log layer name and parameters are:
levelSee log_options
max_sizeSee log_options
keySee log_options
cryptoSee log_options
payloadSee log_options
verboseOptional boolean. See log_options
countNumber. Number of bufferizer logs.
rotateOptional number. Max log file size before rotation.
pathOptional string. Log rotation path.
bcchBoolean. True if BCCH dump is enabled (eNB only).
mibBoolean. True if MIB dump is enabled (eNB only).
lockedOptional boolean. If true, logs configuration can’t be changed
with config_set API.
custom_headersArray. Current custom headers configuration See custom_headers.
config_setChange current config.
Each member is optional.
Message definition:
logsOptional object. Represent logs configuration. Same structure as config_get (See config_get logs member).
All elements are optional.
Layer name can be set to all to set same configuration for all layers.
If set and logs are locked, response will have logs property set to locked.
preconditionSee precondition
session_expiresSee session_expires
sms_retry_delaySee sms_retry_delay
sms_expiresSee sms_expires
sms_hook_onlySee sms_hook_only
binding_expiresSee binding_expires
subscribe_expiresauth_on_register_onlydialog_timeoutSee dialog_timeout
p_called_party_idsms_message_filtersms_forced_cp_causesms_forced_rp_causemms_expiresSee mms_expires
custom_headersOptional array. If set, will replace custom_headers as defined in config file (See custom_headers)
or previous call to config_set.
100relSee 100rel
tcp_thresholdSee tcp_threshold
tcp_keepaliveSee tcp_keepalive
tcp_keepcountSee tcp_keepcount
log_getGet logs.
This API has a per connection behavior. This means that the response will depend on previous calls
to this API within the same WebSocket connection.
In practice, logs that have been provided in a response won’t be part of subsequent request unless
connection is reestablished. To keep on receiving logs, client should send a new log_get request
as soon as the previous response has been received.
If a request is sent before previous request has been replied, previous request will be replied right now
without considering specific min/max/timeout conditions.
Message definition:
minOptional number (default = 1). Minimum amount of logs to retrieve.
Response won’t be sent until this limit is reached (Unless timeout occurs).
maxOptional number (default = 4096). Maximum logs sent in a response.
timeoutOptional number (default = 1). If at least 1 log is available and no more logs have been generated for this time, response will be sent.
allow_emptyOptional boolean (default = false). If set, response will be sent after timeout, event if no logs are available.
rntiOptional number. If set, send only logs matching rnti.
ue_idOptional number. If set, send only logs with matching ue_id.
layersOptional Object. Each member name represents a log layer and values must be
string representing maximum level. See log_options.
If layers is not set, all layers level will be set to debug,
else it will be set to none.
Note also the logs is also limited by general log level. See log_options.
shortOptional boolean (default = false). If set, only first line of logs will be dumped.
headersOptional boolean. If set, send log file headers.
start_timestampOptional number. Is set, filter logs older than this value in milliseconds.
end_timestampOptional number. Is set, filter logs more recent than this value in milliseconds.
max_sizeOptional number (default = 1048576, i.e. 1MB). Maximum size in bytes of the generated JSON message. If the response exceeds this size, the sending of logs will be forced independently from other parameters.
Response definition:
logsArray. List of logs. Each item is a an object with following members:
dataArray. Each item is a string representing a line of log.
timestampNumber. Milliseconds since January 1st 1970. Not present if com_log_us is set in configuration.
timestamp_usNumber. Microseconds since January 1st 1970. Only present if com_log_us is set in configuration.
layerString. Log layer.
levelString. Log level: error, warn, info or debug.
dirOptional string. Log direction: UL, DL, FROM or TO.
ue_idOptional number. UE_ID.
cellOptional number (only for PHY layer logs). Cell ID.
rntiOptional number (only for PHY layer logs). RNTI.
frameOptional number (only for PHY layer logs). Frame number (Subframe is decimal part).
channelOptional string (only for PHY layer logs). Channel name.
srcString. Server name.
idxInteger. Log index.
headersOptional array. Array of strings.
discontinuityOptional number. If set, this means some logs have been discarded due to log buffer overflow.
microsecondsOptional boolean. Present and set to true if com_log_us is set in configuration file.
log_setAdd log.
Message definition:
logOptional string. Log message to add. If set, layer and level are mandatory.
layerString. Layer name. Only mandatory if log is set.
levelString. Log level: error, warn, info or debug. Only mandatory if log is set.
dirOptional string. Log direction: UL, DL, FROM or TO.
ue_idOptional number. UE_ID.
flushOptional boolean (default = false). If set, flushes fog file.
rotateOptional boolean (default = false). If set, forces log file rotation.
cutOptional boolean (default = false). If set, forces log file reset.
log_resetResets logs buffer.
licenseRetrieves license file information.
quitTerminates lteims.
helpProvides list of available messages in messages array of strings
and events to register in events array of strings.
statsReport statistics for LTEIMS.
Every time this message is received by server, statistics are reset.
Warning, calling this message from multiple connections simultaneously will modify the
statistics sampling time.
Response definition:
cpuObject. Each member name defines a type and its value cpu load in % of one core.
instance_idNumber. Constant over process lifetime. Changes on process restart.
countersObject. List of counters, with following sub members:
messagesObject. Each member name is the message name and its value is its occurence.
To get list of message, type cevent help msg in LTEIMS monitor.
errorsObject. Each member name is the error name and its value is its occurence.
To get list of message, type cevent help error in LTEIMS monitor.
registerRegister client to message generated by server. Message definition:
registerString or array of string. List of message to register to.
Can be users_update, sms
unregisterString or array of string. List of message to unregister.
Can be users_update, sms
ipsecReport ipsec SAs.
Response definition:
SAsArray. List of object representing a security association witth following definition:
typeString. IP version, can be IPv4 or IPv6.
dirString. Direction, can be in or out.
spiNumber. SPI.
ue_idNumber. Associated ue_id.
modeString. ESP type, can be tunnel or transport
srcString. Source IP address.
dstString. Destination IP address.
tun_srcOptional string. Tunnel source IP address.
tun_dstOptional string. Tunnel destination IP address.
src_prefixNumber. Source network prefix.
dst_prefixNumber. Destination network prefix.
authent_keyString. Authentication key in hexadecimal form (Empty string authentication is disabled).
cipher_keyString. Ciphering key in hexadecimal form (Empty string ciphering is disabled).
users_getGet users state.
Message definition:
registered_only.Optional boolean (default = false). If set, only registered user will be dumped.
Response definition:
usersArray of object. Each item represents a user with following parameters:
impiString. IMPI of user (IP Multimedia Private identity).
force_sms_over_sgOptional boolean. Current SMS over SG forcing state.
bindingsArray of object. One for each contact binding:
uriString. Contact URI.
impuArray of strings. List of associated IMPUs.
qNumber. Contact priority.
videoOptional boolean. Video support.
smsOptional boolean. SMS pending.
imeiOptional string. IMEI.
expiresInteger. Number of seconds before binding expiration.
dialogsArray of object. One for each current dialog:
remoteString. IMPI of remote user.
smsInteger. Number of pending SMS.
users_addAdd users.
Message definition:
users.Array of object. Same as info in configuration file: See ue_db.
user_setConfigure user.
Message definition:
impiString. IMPI of user to configure.
force_sms_over_sgOptional boolean. Set/unset forcing of SMS over SG.
impu_setConfigure impu.
Message definition:
impuString. IMPU to configure.
*Same parameters as impu configuration object. See impu configuration.
impu_addAdd impu.
Message definition:
impuString or object. IMPU to add See impu configuration.
impiString. User for which to add IMPU. Can be set to echo to add it to the echo list.
impu_delRemove impu.
Message definition:
impuString or object. IMPU to add See impu configuration.
impiString. User for which to remove IMPU. Can be set to echo to remove it from the echo list.
smsSend SMS.
Message definition:
impiOptional string. IMPI of user (IP Multimedia Private identity).
impuOptional string. If IMPI is not set, try to get user from IMPU (IP Multimedia Public identity).
textString. SMS text to send.
senderOptional string. Sets SMS sender.
validityOptional integer (Default = 86400). Validity period in seconds.
binaryOptional string. If set (and text is not set), must be a base64 string representing binary data
of the TP-User-Data.
binary_hexOptional string. If set (and text is not set), must be an hexadecimal string representing binary data
of the TP-User-Data.
tp_udlOptional integer. Used when binary is set. If present, it sets the TP-User-Data-Length field.
If not present, the TP-User-Data-Length field is set to the number of octets of the binary field.
tp_udhi_presentOptional boolean (default is false). When binary is set, indicates if TP-User-Data start with
a user-data header or not.
pidOptional integer (default is 0). Defines protocol identifier.
dcsOptional integer (default is 4). Defines data coding scheme. If the text parameter was provided,
it’s up to the user to ensure that the dcs value is coherent with the encoding automatically
selected (7 bit default GSM alphabet or UCS2).
sosOptional boolean (default = false). If set, will only try to reach emergency registered UEs.
sms_flushFlush pending SMS.
Message definition:
impiString. IMPI of user (IP Multimedia Private identity).
mmsSend MMS.
Message definition:
filenameString. File name to send. Extensions jpg, jpeg, png, gif and txt are supported.
fromString. Sender phone number.
toString. Receiver phone number.
sosOptional boolean (default = false). If set, will only try to reach emergency registered UEs.
mt_callInitiate a mobile terminating call.
Message definition:
impiString. IMPI (IP Multimedia Private identity) of user to call.
impuString. IMPU (IP Multimedia Public identity) of user to call.
contactString. Contact SIP uri of user to call.
sip_fileOptional string. Define file to use as sdp. Will override mt_call_sdp_file parameter.
callerOptional string. Use it to force caller IMPU. If IMPU is in user database, the P-Asserted-Identity header will be added.
sosOptional boolean (default = false). If set, will only try to reach emergency registered UEs.
durationOptional number. If set, call duration in seconds (The server will close the dialog).
Response definition:
session_idString. If call has started, provides its session ID.
dialog_getGet list of current pending dialogs.
Dialog will persist 30s after being stopped.
Message definition:
session_idOptional string. If set, filter on session ID.
Response definition:
dialogsArray of object representing dialogs as follow:
session_idString. Dialog session ID.
stateString. Dialog state, can be init, ringing, start, hold or stop.
typeString. Dialog type, can be server, echo or mt call
toCallee IMPU.
fromCaller IMPU.
mt_dialogOptional string. In case of server dialog, session id of associated MT dialog.
mo_dialogOptional string. In case of client dialog, session id of associated MO dialog.
dateInteger. Dialog creation time in seconds since 1st January 1970.
durationNumber. Number of seconds since dialog has started.
event_listArray of object representing events that has occurred during dialog lifetime.
Each element have the following definition:
typeString. Event type, can be state, when a state change occurs,
send and recv when receiving or sending message.
timestampNumber. Event time in seconds since dialog creation.
stateString. Dialog state when event has occurred as defined above.
mediasArray of object representing media state.
Each media is an object having following definition:
typeString. Media type, can be audio or video.
qosString. QoS state, can be:
dirString. Media current direction, can be sendrecv, sendonly, recvonly or inactive.
rtp_addrString. RTP packets destination address.
rtp_recv_countInteger. Number of RTP packets received.
rtp_send_countInteger. Number of RTP packets sent.
rtcp_addrString. RTCP packets destination address.
rtcp_recv_countInteger. Number of RTCP packets received.
rtcp_send_countInteger. Number of RTCP packets sent.
dialog_setPerform action on dialog Message definition:
session_idString. Session ID of dialog to stop.
actionString. Action to perform.
| Action | Description |
|---|---|
| stop | Forces termination of the dialog. |
| answer | Triggers INVITE final answer of an echo called configured with remote_control option. |
| reinvite | Forces sending of INVITE if the dialog is started. |
| hold | If call is not held locally, hold it, unhold it. Applies on MT and ECHO calls only. |
| downgrade | Downgrades call by removing one media. |
| media | Modify media behavior. |
| ecall-info | In case eCall has been set during INVITE, forces sending of SIP INFO message to trigger MSD report. |
codeOptional integer. If action is answer, forces SIP code.
It action is stop, set protocol cause of SIP reason header.
reasonOptional string. If action is stop, set reason text of SIP reason header.
reason_protocolOptional string. If action is stop, set protocol of SIP reason header.
sdp_fileOptional string. Applicable on MT call dialogs only. Forces a new SDP to be sent.
mediaOptional string. If action is downgrade, defines media to remove (Can be audio or video).
If action is hold, hold/unhold only applies to this type of media
rtpOptional boolean (default = false). If action is media, set it to false to block rtp packet streaming or true to re-enable it.
rtcpOptional boolean (default = false). If action is media, set it to false to block rtcp packet streaming or true to re-enable it.
unregisterForce a network deregistration of a binding. Message definition:
uriString. Binding URI (Address of Record)
Following events are sent by IMS if they have been registered on WebSocket.
smsGenerated by SMS reception:
senderString. SMS originator.
destinationString. SMS destination.
textString. SMS text.
binaryString. If text is not set, base64 encoded string of SMS data.
dcsInteger. Data coding scheme.
dateInteger. SMS sending date in seconds since January 1st 1970.
users_updateEvent generated when a change occurs on a user (Registration, call, sms...).
users_updateArray of object. Each item represents a user (See users_get).
dialogGenerated when a dialog’s state has changed.
dialogObject. Same as dialog_get
{
"message": "config_get",
"message_id": "foo"
}
{
"message_id": "foo",
"message": "config_get",
"name": "UE",
"logs": {
"phy": {
"level": "error",
"max_size": 0
},
...
"rrc": {
"level": "debug",
"max_size": 1
}
}
}
{
"message": "bar",
"message_id": "foo"
}
{
"message_id": "foo",
"message": "bar",
"error": "Unknown message: bar"
}
The following commands are available:
helpDisplay the help. Use help command to have a more
detailed help about a command.
log [log_options]Display the current log state. If log_options are given, change
the log options. The syntax is the same as the log_options
configuration property.
mmeLists MME connections
sms impi or impu textSend a SMS to the user identified by impi or impu if impi has not been found.
sms_flush impiFlush pending SMS.
mms filename from toSend a MMS to the user identified by to. Extensions jpg, jpeg, png, gif and txt are supported. For any other extension value, the content type is interpreted as octet stream.
mt_call callee [-d duration] [sip_file] [caller]Initiate a mobile terminating call.
callee can be IMPI, IMPU or contact URI.
sip_file Define file to use as sdp. Will override mt_call_sdp_file parameter.
caller can be used to force caller IMPU. If IMPU is in user database,
the P-Asserted-Identity header will be added.
duration duration of the call in seconds before server closes it.
dialogLists all dialogs.
dialog_set dialog-index actionPerform action on dialog.
Can be stop, hold or reinvite (Cf dialog_set).
quitStop the program and exit.
When a message is dumped, the format is:
time layer dir id message
timeTime using the selected format.
layerIndicate the layer.
dirFROM or TO or - (No direction associated).
idFor IMS, represents a unique ID associated with a UE binding.
For SIP, represents a unique ID associated to a SIP dialog.
messageLog message.
When a message is dumped, the format is:
time layer dir addr message
timeTime using the selected format.
layerIndicate the layer.
dirFROM or TO or - (No direction associated).
addrSource IP address for incoming messages.
Destination IP address for outgoing messages.
messageLog message.
When a message is dumped, the format is:
time layer id dir protocol/media message
timeTime using the selected format.
layerIndicate the layer.
dirFROM or TO or - (No direction associated).
idSIP associated dialog id.
protocolCan be either RTP or RTCP.
mediaMedia type: audio, video or text.
messageLog message.
anonymous_callback IMPU parameter
send_delay to callflow modifier
ecall-info to dialog_set remote API
bitrate_factor parameter to impu configuration
video parameter to impu configuration
action_set/hold remote API to hold a specific media only
license remote API
tts parameter to callflow_modifier object
com_logs_lock parameter is renamed to com_log_lock. com_logs_lock is still supported for backward compatibility
com_log_us parameter
reason to dialog_stop monitor command
sos parameter to sms remote API
eCall support
ipsec_ifname and ipsec_netns parameters to allow IPsec with non root privileges
AKAv2-SHA-256 authentication scheme
AES-GCM IPsec cipher
AES-GMAC IPsec authentication
ttl parameter to callflow_modifier object
reason_protocol parameter to dialog_set.stop remote API
sms_delay parameter to impu configuration
sms_centre_address
ipsec_mtu parameter
loop_count and loop_delay to remote API messages
sim_events, sim_events_loop_count and sim_events_loop_delay
com_ssl_ca parameter for SSL verification
dialog remote API event
session_expires parameter to impu object
duration, min, refresher, method and force to session_expires object
media action to dialog_set remote API to allow blocking or not rtp and/or rtcp streams
sms_centre_address parameter is added
ipsec remote API added
tcp_threshold can now be changed during runtime with config_set remote API
sms_flush remote API added
impu_add and impu_del remote API
echo monitor command
auth qop parameter
com_logs_lock parameter added to disable logs configuration change via remote API
com_addr parameter now uses [::] address instead of 0.0.0.0 in the delivered configuration file to allow IPv6 connection
media_delay to callflow modifier
auth_on_register_only default value is changed to true instead of false
REGISTER.SOS callflow modifier
INVITE.RINGING callflow modifier
INVITE.SESSION_PROGRESS callflow modifier
REINVITE callflow modifier
code and reason parameters for dialog_set/action stop remote API
downgrade action and media parameter to dialog_set remote API
custom_headers for callflow_modifier
path parameter for registration
dialog_set remote API and monitor command. Replaces dialog_stop, reinvite and dialog_answer APIs
hold action on dialog_set remote API and monitor command
imei and impu filters on callflow_modifier
sdp_file to dialog_set/reinvite remote API
utc parameter to remote API response messages
callflow_modifier is added to impu definition and allows multiple modifiers
callflow_modifier based on P-Access-Network-Info header
tcp_keepalive default value changed to 15 minutes
tcp_keepcount parameter is added
custom_headers parameter is added to config_get and config_set remote API
date parameter is added to sms remote API event
code parameter in impu objet now accepts the value -1 to ignore an incoming SIP message
tcp_keepalive is added to control keepalive on TCP sockets
sos option is added to mt_call and sms remote APIs
start_timestamp and end_timestamp are added to log_get API
binding_expires parameter maximum value is increased from 3600 to 864000
sdp_file parameter is added to force the SDP used in echo mode
answer_delay parameter is added to IMPU configuration
to delay final answer to INVITE request
INVITE.OK option has been added to method parameter of
IMPU configuration to apply code on final answer to INVITE request.
remote_control option has been added to IMPU configuration. It can be handled via
a new invite remote API event and a new dialog_answer remote API.
transparent option has been added to IMPU configuration to avoid affecting normal callflow.
impu_set remote API is added to dynamically update impu configurations.
REGISTER handling has been added to impu method parameter.
INVITE.TRYING handling has been added to impu method parameter.
license monitor command is added
precondition global parameter syntax is updated. Legacy boolean values are still available but we recommend to use on and off instead
force_user_agent parameter is added to avoid overriding the UE user-agent string when forwarding SIP packets between UEs
prefered parameter is renamed to preferred. Legacy name is still supported
lteims is copyright (C) 2012-2024 Amarisoft. Its redistribution
without authorization is prohibited.
lteims is available without any express or implied warranty. In
no event will Amarisoft be held liable for any damages arising from
the use of this software.
For more information on licensing, please refer to license.pdf file.
Access Point Name
IP Multimedia Public Identity
IP Multimedia Private Identity