Local paths

The system is distributed, but different logical roles running on different servers require access to the same files. For example, role ws has saved a file to the IVR script, the ivr role executes the playback component and checks for the file, and the mg role performs the playback component. There are tons of examples like this, and they all require file system unity between servers.

Fundamentally, there are several different kinds of catalogs in the "Incoplax" system:

  • A synchronization folder from which files are automatically distributed to servers according to their destination.

  • A network storage folder on a site, posting to which makes a file accessible from other servers on that site.

  • A network folder of global storage, placing it in which makes the file accessible from other servers of all sites.

  • A local temporary folder for the node, placing it in which is temporary and makes the file inaccessible to other servers, is cleared when the node starts.

  • A write folder used by media gateways to store RTP traffic.

  • Network storage folders of call recordings, which can be either global or site specific, there can be many of them and each mixer is configured to save to a specific one.

The root directories for the above categories are configured in configuration for each server separately.

Absolute and relative direct paths of OS

An absolute or relative path is a level 1 reference to a file.

Working with level 1 paths in scripts is prohibited.

Root keys set in the config

Root folders by type are level 2 references to a file.

Working with level 2 paths in scripts is prohibited.

Types of pathways:

prefix Description

:SYNC

Path to the synchronization directory.

  • Root: get_sync_root_path()

:SITESHARE

Path to the directory for storing files on the network drive available at the site.

  • Root: get_siteshare_path()

  • Requires rshare.sign for system services to work

:GLOBALSHARE

Path to a directory for storing files on a network drive accessible to the entire system.

  • Root: get_globalshare_path()

  • Requires rshare.sign to run system services

:RECORD

Path to the directory for recording calls on the Media Gateway (excluded from public use). This is a local folder.

  • Root: get_record_path(Addr, Postfix)

:RECSTORE

Path to the directory for storing recorded calls on the system (excluded from public use), if storage within the domain is not configured to external storage. This can be an NFS folder, or a local folder.

  • Root: get_recstore_path()

  • get_recstore_path_by_id(RecStoreId)

  • RecStoreId - alias of a particular storage, of which there may be many. Each mixer writes to a specific one, and the web server can access all of them.

  • Requires rshare.sign to run system services

:LOCAL

Path to the directory for storing temporary node files

  • Root: get_local_path()

  • To use: get_node_temp_path()get_local_path() + get_current_node_name()

rshare.sign

A service file whose presence indicates to the "Incoplax" system that the network directory is connected.

  • Necessary for operation of system services with catalogs :SITESHARE and :GLOBALSHARE.

  • The file must be created on a connected NAS. If there is no network connection, the file disappears, the system realizes that the directory is not available.

  • If NAS is not used, a file is created directly in the :SITESHARE or :GLOBALSHARE directory of the server.

File contents:
rshare

To test execute:

hd rshare.sign

Result:

 00000000  72 73 68 61 72 65  |rshare|
 00000006

Working with the file system in scenarios

All dynamic file designations must use one of the specialized prefixes (level 3).

Only level 3 paths are allowed in scripts.

No backtracking allowed (/..).

DFSync (domain file sync)

Static information synchronized across all servers of all sites within 10-20 seconds. It is divided into generic and domain-specific. Directories with domains are synchronized on servers owned by the sites where the domain is served.

Table 1. Structure DFSync:
prefix Description

:SYNC_COMMON

  • Storage of standard media files and downloaded data.

  • Access from scripts: reading for all.

  • Access from API: full access to sections (waitonhold, conf, custom, …​)

  • Main users: Playing standard sounds in calls, conferences, and IVR.

  • Synonym: :SYN_MEDIA

  • Expression: syn_media()

 :SYNC + get_subpath_common()
 :SYNC/common/
 /home/era/media/ + common/

.

:SYNC_DOMAIN_COMMON

  • Storing media files that overlap the standard set of :SYNC_COMMON.

  • Access from scripts: read for this domain, full deny for the rest.

  • Access from API: not implemented.

  • Main users: playback of standard sounds in calls, conferences, and IVR.

  • Synonym: :SYN_DOM_MEDIA

  • Expression: syn_dom_media()

 :SYNC + get_subpath_domain(Domain) + get_subpath_common()
 :SYNC/domains/[domain]/common/
 /home/era/media/ + domains/domain.org/common/

.

:SYNC_DOMAIN_DATA

  • Storage of various information available in a given domain

  • Access from scripts: read and write in a given domain.

  • API access: none.

  • Main users: different scenarios of this domain

  • Synonym: :SYN_DOM

  • Expression: syn_domain()

 :SYNC + get_subpath_domain(Domain) + get_subpath_data()
 :SYNC/domains/[domain]/data/
 /home/era/media/ + domains/domain.org/data/

.

:SYNC_SCRIPT_STATIC

  • Storage of media information attached to the script

  • Access from scenarios: read for the given scenario.

  • Access from API: full (ivr, svc)

  • Main users: scenarios IVR

  • Synonym: :SYN_SCR_MEDIA

  • Expression: syn_script_media()

 :SYNC + get_subpath_script_static(Domain, ScriptType, ScriptId)
 :SYNC/domains/[domain]/scripts/<SCRIPT_TYPE>/<SCRIPT_ID>/static/
 /home/era/media/ + domains/domain.org/ + scripts/ivr/1233-43223-43213411234/static/

.

:SYNC_SCRIPT_DATA

  • Storing various information attached to the scenario

  • Access from scripts: read and write for a given script.

  • API access: none.

  • Main users: scenarios IVR.

  • Synonym: :SYN_SCR

  • Expression: syn_script()

 :SYNC + get_subpath_script_data(Domain, ScriptType, ScriptId),
 :SYNC/domains/[domain]/scripts/<SCRIPT_TYPE>/<SCRIPT_ID>/data/
 /home/era/media/ + domains/domain.org/ + scripts/ivr/1233-43223-43213411234/data/

.

NFS

Shared network directories. Categorized into intra-site and global.

Table 2. Structure NFS:
prefix Description

:GLOBALSHARE_PUBLIC

  • Storage of various information with full access for all

  • Access from scripts: full for all domains and scripts.

  • Access from API: not implemented.

  • Main users: all users

  • synonym: :GS_PUB

  • Expression: gs_public()

 :GLOBALSHARE + get_subpath_public()
 :GLOBALSHARE/public/
 /home/era/globals/ + public

.

:GLOBALSHARE_DOMAIN_DATA

  • Storing various information available in a given domain throughout the system.

  • Access from scripts: Current domain has full access, others are denied.

  • Access from API: not implemented.

  • Basic users: scripts for manipulating various files.

  • What is stored: documents, faxes, generated media files.

  • Synonym: :GS_DOM

  • Expression: gs_domain()

 :GLOBALSHARE + get_subpath_domain(Domain) + get_subpath_data()
 :GLOBALSHARE/domains/[Domain]/data/
 /home/era/globals/ + domains/domain.org/data/

.

:GLOBALSHARE_SCRIPT_DATA

  • Storing various scenario information in a given domain throughout the system.

  • Access from scripts: The current script has full access, other scripts in the current domain and other domains are denied.

  • Access from API: not yet implemented.

  • Basic users: scripts for manipulating various files

  • What is stored: documents, faxes, generated media files

  • Synonym: :GC_SCR

  • Expression: gs_script()

 :GLOBALSHARE + get_subpath_script_data(Domain, ScriptType, ScriptId)
 :GLOBALSHARE/domains/[Domain]/scripts/[ScriptType]/[ScriptId]/data/
 /home/era/globals/ + domains/domain.org/scripts/ivr/1233-43223-43213411234/data/

.

:SITESHARE_PUBLIC

  • Storing various information available with full access to all on this site.

  • Access from scripts: full for all domains and scripts.

  • Access from ws-api: not yet implemented.

  • Primary users: -

  • What is stored: documents, faxes, media files, etc.

  • Synonym: :SS_PUB

  • Expression: ss_public()

 :SITESHARE + get_subpath_public()
 :SITESHARE/public/
 /home/era/nfs/ + public

.

:SITESHARE_DOMAIN_DATA

  • Storage of various information available in this domain on this site.

  • Access from scripts: Current domain has full access, others are denied.

  • Access from API: not yet implemented.

  • Basic users: scripts for manipulating various files.

  • What is stored: documents, faxes, media files, voicemail.

  • Synonym: :SS_DOM

  • Expression: ss_domain()

 :SITESHARE + get_subpath_domain(Domain) + get_subpath_data()
 :SITESHARE/domains/[Domain]/data/
 /home/era/nfs/ + domains/domain.org/data/

.

:SITESHARE_SCRIPT_DATA

  • Storing various script information in a given domain at a given site.

  • Access from scripts: The current script has full access, other scripts in the current domain and other domains are denied.

  • Access from API: not yet implemented.

  • Main users: scripts for manipulating various files, sending recordings for playback.

  • What is stored: documents, faxes, media files.

  • Synonym: :SS_SCR

  • Expression: ss_script()

 :SITESHARE + get_subpath_script_data(Domain, ScriptType, ScriptId)
 :SITESHARE/domains/[Domain]/scripts/[ScriptType]/[ScriptId]/data/
 /home/era/nfs/ + domains/domain.org/scripts/ivr/1233-43223-43213411234/data/

.

LFS

Local intra-server directories.

Table 3. Structure LFS:
prefix Description

:TEMP

  • Placing and collecting call recordings from media gateways to users, temporary web server file dump.

  • Access from scripts: Current instance of the script has full access, others are denied.

  • API access: none.

  • Features:

    • The folder is self-cleaning when the scenario is terminated/collapsed.

    • When the node is restarted, the entire node folder is deleted.

  • Main users: IVR (recording and mixer, receiving fax, receiving e-mail, speech recognition and synthesis), local file work, web server file dump.

  • Synonym: none.

  • Expression: temp()

 :LOCAL + ScriptId + Pid
 :LOCAL/[ScriptId]/[Pid]/
 /home/temp/era/ + temp/nodename/ + 12341234-1234-1234-1234-123412341234/0.123.0/

.