Project DiaStar™ Server - User's Guide
From ProjectDiaStar
Contents |
DiaStar™ Server Command Line Options
v2.0
-h, --help display this information --version display this applications's version -v, --verbose run with maximum logging -c, --console run as a console application --log-dir directory used to store log files -p, --probe probe hardware and generate configuration data --isdn generate configuration data for isdn devices (default) --ss7 generate configuration data for ss7 devices instead of isdn --sip generate configuration data for sip devices --conf configuration file --woomera-port tcp port that the server listens on
- Note, the options --isdn and --ss7 are mutually exclusive.
See man diastar for the more information.
Configuring the DiaStar™ Server
If the DiaStar™ Server does not have a configuration, every time it runs it will auto detect and use all available Dialogic devices in the system.
This auto detection can be time consuming so it is recommended that a configuration file is used.
The --probe option is used to automatically generate a device configuration file.
The preferred method of generating a config file is to use the service tool:
# service diastar config
This creates the file /etc/diastar/diastar.conf and starts the service.
The default configuration file is suitable for an ISDN gateway application. Other configurations (v2.0) may be generated by passing further options.
- --isdn (default)
- --ss7 (mutually exclusive with isdn)
- --sip
Examples
SIP gateway / Multimedia server
# service diastart config --sip
ISDN gateway / SIP gateway & Multimedia server
# service diastart config --isdn --sip
SS7 gateway
# service diastart config --ss7
Note: The number of SS7 circuit groups found in the config.txt file must match the number of dti E1 spans in the DiaStar config file. If you are using fewer circuit groups than spans, only channels on those accounted for in config.txt will open. Unwanted dti spans can be deleted or commented out in the DiaStar config file. You also need to adjust the "group" parameter to account for the dti channels that were eliminated. For example, "default=1-120" becomes "default=1-60" if 2 E1 spans are eliminated.
Alternatively, the following examples show how to invoke the probe directly:
v1.0
# diastar --probe --conf=diastar.conf or # diastar --probe > diastar.conf
v2.0
# diastar --probe --isdn --sip --conf=diastar.conf or # diastar --probe --isdn --sip > diastar.conf
Custom Tone Detection (v2.0)
As part of the Call Progress Analysis feature DiaStar can detect single tones and dual tones, with optional cadences.
The tones are defined using templates that are read in from files stored in a dedicated directory, the default location being /etc/diastar/tones.d. DiaStar reads in all files with a .conf extension. Each file may define multiple templates defined by familiar ini file style syntax.
The section name uniquely identifies the a template and is used to identify the tone in CPA results.
Template parameters (vary depending on mode):
freq1 frequency 1 in Hz fq1dev frequency 1 deviation in Hz freq2 frequency 2 in Hz fq2dev frequency 2 deviation in Hz ontime tone-on time in milliseconds ontdev tone-on time deviation in milliseconds offtime tone-off time in milliseconds offtdev tone-off time deviation in milliseconds repcnt number of repetitions of the cadence
- Frequencies must be in the range 300Hz to 3k5Hz.
- Dual tones with frequency components closer than approximately 63Hz cannot be detected, for these cases a single tone definition should be used.
- The minimum ontime and offtime for cadence detection is 40ms on and 40ms off.
Example
; This file defines tone detector templates for use with DiaStar. ; ; Single tone [1kHz] freq1 = 1000 fq1dev = 20 ; Dual tone [C5A5] freq1 = 523 fq1dev = 20 freq2 = 794 fq2dev = 20 ; Single tone, cadenced. [1kHz-cadenced-500-500] freq1 = 1000 fq1dev = 20 ontime = 500 ontdev = 50 offtime = 500 offtdev = 50 ; Dual tone, cadenced [C5A5-cadenced-500-500] freq1 = 523 fq1dev = 20 freq2 = 794 fq2dev = 20 ontime = 500 ontdev = 50 offtime = 500 offtdev = 50
Media Files (v2.0)
DiaStar uses a special directory layout to manage media files. The base of the directory structure is /var/lib/diastar/media, which may be changed using the path parameter within the media section of the diastar.conf file. The directory structure contains directories for different codecs and in the case of video codecs, directories for different formats (sizes). When playing a media file DiaStar will choose the file that most closely matches the call's codec.
Language support
The directory structure includes a language component. The default language is defined as en_US, which may be changed using the lang parameter within the media section of the diastar.conf file. The default language is used when the Woomera client does not specify a language in a play / record request, in the case of Asterisk the channel driver will always pass the channel's language variable.
File Management
When running DiaStar as an appliance it may useful to provide users with remote access to the media files. It is recommended that such access is limited to authenticated users with file system access restricted to the media directories only. One possible solution to this to use WebDAV.
Apache WebDAV confguration.
Edit /etc/httpd/conf/httpd.conf
Ensure the web dav modules have been enabled:
LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so
Make files available under the /media uri.
Alias /media /var/lib/diastar/media
<Location /media> DAV On AuthType Basic AuthName "diastar" AuthUserFile /var/www/webdav/passwd.dav Require valid-user </Location>
Ensure /var/lib/diastar/media can be written by the apache user.
$ chown -R root:apache /var/lib/diastar/media $ chmod -R 770 /var/lib/diastar/media
Create the WebDAV password file: /var/www/webdav/passwd.dav with the user diastar
$ htpasswd -c /var/www/webdav/passwd.dav diastar
You will be prompted to enter a password for the user diastar. [opendialogic]
Change the permissions of the passwd.dav file so that only root and the members of the apache group can access it:
$ chown root:apache /var/www/webdav/passwd.dav $ chmod 640 /var/www/webdav/passwd.dav
Restart the server:
$ service httpd restart
Running the DiaStar™ Server
The DiaStar™ Server can be run as either a console application or as a daemon.
As a console application
# diastar --console --conf=diastar.conf
Additional examples:
# diastar --console -v --conf=diastar.conf # diastar --console -v --logdir=/var/log/diastar --conf=diastar.conf # diastar --console
As a daemon
# diastar --conf=diastar.conf
Additional examples:
# diastar --verbose --logdir=/var/log/diastar--conf=diastar.conf # diastar
