Make tones-dir option available for all interface (interface.conf)
This commit is contained in:
parent
07c94b7319
commit
b2261c3f5c
|
@ -144,14 +144,14 @@
|
||||||
#dialmax 20
|
#dialmax 20
|
||||||
|
|
||||||
|
|
||||||
# Example of an ISDN interface on port 1, with alternate tones_dir to use.
|
# Example of an ISDN interface on port 1, with alternate tones-dir to use.
|
||||||
# In this case, the tones are "german" tones generated by mISDN_dsp.ko.
|
# In this case, the tones are "german" tones generated by mISDN_dsp.ko.
|
||||||
# It is possible to give different sample sets, like "tones_german".
|
# It is possible to give different sample sets, like "tones_german".
|
||||||
|
|
||||||
#[Int]
|
#[Int]
|
||||||
#extension
|
#extension
|
||||||
#msn 201,202,203
|
#msn 201,202,203
|
||||||
#tones_dir german
|
#tones-dir german
|
||||||
#portnum 1
|
#portnum 1
|
||||||
#nt
|
#nt
|
||||||
|
|
||||||
|
|
17
interface.c
17
interface.c
|
@ -880,18 +880,12 @@ static int inter_dialmax(struct interface *interface, char *filename, int line,
|
||||||
}
|
}
|
||||||
static int inter_tones_dir(struct interface *interface, char *filename, int line, char *parameter, char *value)
|
static int inter_tones_dir(struct interface *interface, char *filename, int line, char *parameter, char *value)
|
||||||
{
|
{
|
||||||
struct interface_port *ifport;
|
if (!value || !value[0]) {
|
||||||
|
SPRINT(interface_error, "Error in %s (line %d): Missing tones directory.\n", filename, line);
|
||||||
/* port in chain ? */
|
|
||||||
if (!interface->ifport) {
|
|
||||||
SPRINT(interface_error, "Error in %s (line %d): parameter '%s' expects previous 'port' definition.\n", filename, line, parameter);
|
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
/* goto end of chain */
|
SCPY(interface->tones_dir, value);
|
||||||
ifport = interface->ifport;
|
|
||||||
while(ifport->next)
|
|
||||||
ifport = ifport->next;
|
|
||||||
SCPY(ifport->tones_dir, value);
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
static int inter_gsm(struct interface *interface, char *filename, int line, char *parameter, char *value)
|
static int inter_gsm(struct interface *interface, char *filename, int line, char *parameter, char *value)
|
||||||
|
@ -1354,6 +1348,9 @@ struct interface_param interface_param[] = {
|
||||||
{"tones_dir", &inter_tones_dir, "<path>",
|
{"tones_dir", &inter_tones_dir, "<path>",
|
||||||
"Overrides the given tone_dir in options.conf.\n"
|
"Overrides the given tone_dir in options.conf.\n"
|
||||||
"To used kernel tones in mISDN_dsp.ko, say 'american', 'german', or 'oldgerman'."},
|
"To used kernel tones in mISDN_dsp.ko, say 'american', 'german', or 'oldgerman'."},
|
||||||
|
{"tones-dir", &inter_tones_dir, "<path>",
|
||||||
|
"Overrides the given tone_dir in options.conf.\n"
|
||||||
|
"To used kernel tones in mISDN_dsp.ko, say 'american', 'german', or 'oldgerman'."},
|
||||||
|
|
||||||
{"gsm", &inter_gsm, "",
|
{"gsm", &inter_gsm, "",
|
||||||
""},
|
""},
|
||||||
|
|
|
@ -66,7 +66,6 @@ struct interface_port {
|
||||||
// int tout_hold;
|
// int tout_hold;
|
||||||
// int tout_park;
|
// int tout_park;
|
||||||
int dialmax; /* maximum number of digits to dial */
|
int dialmax; /* maximum number of digits to dial */
|
||||||
char tones_dir[128];
|
|
||||||
int nonotify; /* blocks outgoing notify messages */
|
int nonotify; /* blocks outgoing notify messages */
|
||||||
int pots_flash; /* allow flash button / keypulse to hold active call */
|
int pots_flash; /* allow flash button / keypulse to hold active call */
|
||||||
int pots_ring; /* after hangup let calls on hold ring the phone */
|
int pots_ring; /* after hangup let calls on hold ring the phone */
|
||||||
|
@ -105,6 +104,7 @@ struct interface {
|
||||||
struct interface_screen *ifscreen_in; /* link to screening list */
|
struct interface_screen *ifscreen_in; /* link to screening list */
|
||||||
struct interface_screen *ifscreen_out; /* link to screening list */
|
struct interface_screen *ifscreen_out; /* link to screening list */
|
||||||
int tx_gain, rx_gain; /* filter gain */
|
int tx_gain, rx_gain; /* filter gain */
|
||||||
|
char tones_dir[128];
|
||||||
char pipeline[256]; /* filter pipeline */
|
char pipeline[256]; /* filter pipeline */
|
||||||
unsigned char bf_key[56]; /* filter blowfish */
|
unsigned char bf_key[56]; /* filter blowfish */
|
||||||
int bf_len; /* filter length of blowfish */
|
int bf_len; /* filter length of blowfish */
|
||||||
|
|
|
@ -1226,9 +1226,9 @@ void PmISDN::set_tone(const char *dir, const char *tone)
|
||||||
|
|
||||||
/* if no directory is given (by extension), we use interface.conf or options.conf */
|
/* if no directory is given (by extension), we use interface.conf or options.conf */
|
||||||
if (!dir || !dir[0]) {
|
if (!dir || !dir[0]) {
|
||||||
if (p_m_mISDNport->ifport->tones_dir[0])
|
if (p_tones_interface[0])
|
||||||
dir = p_m_mISDNport->ifport->tones_dir;
|
dir = p_tones_interface;
|
||||||
else if (options.tones_dir[0])
|
else
|
||||||
dir = options.tones_dir;
|
dir = options.tones_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
port.cpp
10
port.cpp
|
@ -159,8 +159,10 @@ Port::Port(int type, const char *portname, struct port_settings *settings, struc
|
||||||
memset(&p_settings, 0, sizeof(p_settings));
|
memset(&p_settings, 0, sizeof(p_settings));
|
||||||
}
|
}
|
||||||
SCPY(p_name, portname);
|
SCPY(p_name, portname);
|
||||||
if (interface)
|
if (interface) {
|
||||||
SCPY(p_interface_name, interface->name);
|
SCPY(p_interface_name, interface->name);
|
||||||
|
SCPY(p_tones_interface, interface->tones_dir);
|
||||||
|
}
|
||||||
p_tone_dir[0] = '\0';
|
p_tone_dir[0] = '\0';
|
||||||
p_type = type;
|
p_type = type;
|
||||||
p_serial = port_serial++;
|
p_serial = port_serial++;
|
||||||
|
@ -323,8 +325,12 @@ void Port::set_tone(const char *dir, const char *name)
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
name = "";
|
name = "";
|
||||||
|
|
||||||
if (!dir || !dir[0])
|
if (!dir || !dir[0]) {
|
||||||
|
if (p_tones_interface[0])
|
||||||
|
dir = p_tones_interface;
|
||||||
|
else
|
||||||
dir = options.tones_dir; /* just in case we have no PmISDN instance */
|
dir = options.tones_dir; /* just in case we have no PmISDN instance */
|
||||||
|
}
|
||||||
|
|
||||||
/* no counter, no eof, normal speed */
|
/* no counter, no eof, normal speed */
|
||||||
p_tone_counter = 0;
|
p_tone_counter = 0;
|
||||||
|
|
1
port.h
1
port.h
|
@ -207,6 +207,7 @@ class Port
|
||||||
char p_interface_name[64];
|
char p_interface_name[64];
|
||||||
|
|
||||||
/* tone */
|
/* tone */
|
||||||
|
char p_tones_interface[256]; /* directory of tones of interface */
|
||||||
char p_tone_dir[256]; /* name of current directory */
|
char p_tone_dir[256]; /* name of current directory */
|
||||||
char p_tone_name[256]; /* name of current tone */
|
char p_tone_name[256]; /* name of current tone */
|
||||||
char p_tone_fh; /* file descriptor of current tone or -1 if not open */
|
char p_tone_fh; /* file descriptor of current tone or -1 if not open */
|
||||||
|
|
17
todo.txt
17
todo.txt
|
@ -21,4 +21,21 @@ doku:
|
||||||
- aufzeichnung der ansage mit 0 ohne beep beenden
|
- aufzeichnung der ansage mit 0 ohne beep beenden
|
||||||
- gain, pipeline, crypt
|
- gain, pipeline, crypt
|
||||||
- polling
|
- polling
|
||||||
|
- sip
|
||||||
|
|
||||||
|
sip:
|
||||||
|
|
||||||
|
- blockiert der prozess beim lookup? (also invite oder register bei dns-unerreichbarkeit)
|
||||||
|
- feste ip statt stun
|
||||||
|
- ankommende registrierung
|
||||||
|
- earlyb testen (siehe interface.conf)
|
||||||
|
- callerid als display-info
|
||||||
|
|
||||||
|
routing:
|
||||||
|
- ersetzten-operator
|
||||||
|
- bei einem sending-complete muss ein timeout als abgelaufen behandelt werden
|
||||||
|
|
||||||
|
lcradmin:
|
||||||
|
- mncc status (socket-connection) anzeigen
|
||||||
|
- sip status (register) anzeigen
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue