summaryrefslogtreecommitdiffstats
path: root/interface.c
diff options
context:
space:
mode:
authorAndreas Eversberg2009-09-23 10:07:00 +0200
committerAndreas Eversberg2009-09-23 10:07:00 +0200
commitfeea42c7f7f2e171c1490bd0d3af09beba629f21 (patch)
tree9a3dfc15ae995a73d6269b81ce6de59cbe7ca5c0 /interface.c
parentFixed bad bug in joining calls. Please update, if you have changed to version... (diff)
downloadlcr-feea42c7f7f2e171c1490bd0d3af09beba629f21.tar.gz
lcr-feea42c7f7f2e171c1490bd0d3af09beba629f21.tar.xz
lcr-feea42c7f7f2e171c1490bd0d3af09beba629f21.zip
Added 'extern' flag to interface.conf.
If no specific interface is given for the 'extern' rule in the routing.conf, or if call is forwarded (settings), then only interfaces marked with 'extern' flag are used. You need to set this flag when upgrading to this version. See default/interface.conf for hint. modified: README modified: apppbx.cpp modified: default/interface.conf modified: interface.c modified: interface.h
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/interface.c b/interface.c
index 24bc731..df39b78 100644
--- a/interface.c
+++ b/interface.c
@@ -114,6 +114,10 @@ static int inter_block(struct interface *interface, char *filename, int line, ch
}
static int inter_extension(struct interface *interface, char *filename, int line, char *parameter, char *value)
{
+ if (interface->external) {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s' not allowed, because interface is external interface.\n", filename, line, parameter);
+ return(-1);
+ }
if (value[0]) {
SPRINT(interface_error, "Error in %s (line %d): parameter '%s' expects no value.\n", filename, line, parameter);
return(-1);
@@ -121,6 +125,19 @@ static int inter_extension(struct interface *interface, char *filename, int line
interface->extension = 1;
return(0);
}
+static int inter_extern(struct interface *interface, char *filename, int line, char *parameter, char *value)
+{
+ if (interface->extension) {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s' not allowed, because interface is an extension.\n", filename, line, parameter);
+ return(-1);
+ }
+ if (value[0]) {
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s' expects no value.\n", filename, line, parameter);
+ return(-1);
+ }
+ interface->external = 1;
+ return(0);
+}
static int inter_ptp(struct interface *interface, char *filename, int line, char *parameter, char *value)
{
struct interface_port *ifport;
@@ -907,6 +924,12 @@ static int inter_gsm(struct interface *interface, char *filename, int line, char
struct interface_param interface_param[] = {
{ "extension", &inter_extension, "",
"If keyword is given, calls to interface are handled as internal extensions."},
+
+ { "extern", &inter_extern, "",
+ "If keyword is given, this interface will be used for external calls.\n"
+ "Calls require an external interface, if the routing action 'extern' is used\nwithout specific interface given.\n"
+ "Calls forwarded by extension's 'settings' also require an external interface."},
+
{"tones", &inter_tones, "yes | no",
"Interface generates tones during call setup and release, or not.\nBy default only NT-mode ports generate tones."},