From feea42c7f7f2e171c1490bd0d3af09beba629f21 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 23 Sep 2009 10:07:00 +0200 Subject: 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 --- interface.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'interface.c') 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."}, -- cgit v1.2.3-55-g7522