X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=interface.c;h=292c9aaf22f0108b26348911146d501a6cf939c7;hp=587fc62b656d8e12eddb12938322c2948f862a02;hb=034d3a91404addedc1c7a3494862c79532b0b878;hpb=f6aea744f84e702b3469393f007b9e1bf25f6737 diff --git a/interface.c b/interface.c index 587fc62..292c9aa 100644 --- a/interface.c +++ b/interface.c @@ -751,6 +751,22 @@ static int inter_nodtmf(struct interface *interface, char *filename, int line, c ifport->nodtmf = 1; return(0); } +static int inter_dtmf_threshold(struct interface *interface, char *filename, int line, char *parameter, char *value) +{ + struct interface_port *ifport; + + /* 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); + } + /* goto end of chain */ + ifport = interface->ifport; + while(ifport->next) + ifport = ifport->next; + ifport->dtmf_threshold = atoi(value); + return(0); +} static int inter_filter(struct interface *interface, char *filename, int line, char *parameter, char *value) { char *p, *q; @@ -906,6 +922,17 @@ static int inter_gsm_bs(struct interface *interface, char *filename, int line, c return(0); #endif } +static int inter_gsm_bs_hr(struct interface *interface, char *filename, int line, char *parameter, char *value) +{ +#ifndef WITH_GSM_BS + SPRINT(interface_error, "Error in %s (line %d): GSM BS side not compiled in.\n", filename, line); + return(-1); +#else + interface->gsm_bs_hr = 1; + + return(0); +#endif +} static int inter_gsm_ms(struct interface *interface, char *filename, int line, char *parameter, char *value) { #ifndef WITH_GSM_MS @@ -978,6 +1005,12 @@ static int inter_rtp_bridge(struct interface *interface, char *filename, int lin SPRINT(interface_error, "Error in %s (line %d): Interface does not support RTP\n", filename, line); return(-1); } + + if (interface->app != EAPP_TYPE_BRIDGE) { + SPRINT(interface_error, "Error in %s (line %d): '%s' requires previous 'bridge' parameter.\n", filename, line, parameter); + return(-1); + } + interface->rtp_bridge = 1; return(0); @@ -1064,11 +1097,17 @@ static int inter_ss5(struct interface *interface, char *filename, int line, char if (!strcasecmp(element, "delay")) ifport->ss5 |= SS5_FEATURE_DELAY; else - if (!strcasecmp(element, "starrelease")) - ifport->ss5 |= SS5_FEATURE_STAR_RELEASE; + if (!strcasecmp(element, "release")) + ifport->ss5 |= SS5_FEATURE_RELEASE; + else + if (!strcasecmp(element, "mute-rx")) + ifport->ss5 |= SS5_FEATURE_MUTE_RX; else - if (!strcasecmp(element, "suppress")) - ifport->ss5 |= SS5_FEATURE_SUPPRESS; + if (!strcasecmp(element, "mute-tx")) + ifport->ss5 |= SS5_FEATURE_MUTE_TX; + else + if (!strcasecmp(element, "quality")) + ifport->ss5 |= SS5_FEATURE_QUALITY; else { SPRINT(interface_error, "Error in %s (line %d): parameter '%s' does not allow value element '%s'.\n", filename, line, parameter, element); return(-1); @@ -1110,6 +1149,57 @@ static int inter_context(struct interface *interface, char *filename, int line, return(0); } +static int inter_pots_flash(struct interface *interface, char *filename, int line, char *parameter, char *value) +{ + struct interface_port *ifport; + + /* 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); + } + /* goto end of chain */ + ifport = interface->ifport; + while(ifport->next) + ifport = ifport->next; + + ifport->pots_flash = 1; + return(0); +} +static int inter_pots_ring(struct interface *interface, char *filename, int line, char *parameter, char *value) +{ + struct interface_port *ifport; + + /* 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); + } + /* goto end of chain */ + ifport = interface->ifport; + while(ifport->next) + ifport = ifport->next; + + ifport->pots_ring = 1; + return(0); +} +static int inter_pots_transfer(struct interface *interface, char *filename, int line, char *parameter, char *value) +{ + struct interface_port *ifport; + + /* 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); + } + /* goto end of chain */ + ifport = interface->ifport; + while(ifport->next) + ifport = ifport->next; + + ifport->pots_transfer = 1; + return(0); +} static int inter_shutdown(struct interface *interface, char *filename, int line, char *parameter, char *value) { interface->shutdown = 1; @@ -1243,6 +1333,10 @@ struct interface_param interface_param[] = { "Disables DTMF detection for this interface.\n" "This parameter must follow a 'port' parameter."}, + {"dtmf-threshold", &inter_dtmf_threshold, "", + "Set threshold value for minimum DTMF tone level.\n" + "This parameter must follow a 'port' parameter."}, + {"filter", &inter_filter, " ", "Adds/appends a filter. Filters are ordered in transmit direction.\n" "gain - Changes volume (-8 .. 8)\n" @@ -1260,6 +1354,8 @@ struct interface_param interface_param[] = { ""}, {"gsm-bs", &inter_gsm_bs, "", "Sets up GSM base station interface for using OpenBSC."}, + {"hr", &inter_gsm_bs_hr, "", + "Enable and prefer half rate for mobile terminating calls."}, {"gsm-ms", &inter_gsm_ms, "", "Sets up GSM mobile station interface for using Osmocom-BB.\n" "The name of the MS folows the interface name.\n" @@ -1270,7 +1366,8 @@ struct interface_param interface_param[] = { "Give SIP configuration file."}, {"rtp-bridge", &inter_rtp_bridge, "", "Enables RTP bridging directly from this interface.\n" - "This only works, if both ends support RTP. (like gsm-bs and sip)"}, + "This only works if both bridged interfaces use RTP, e.g. between gsm-bs and sip.\n" + "This parameter must follow a 'bridge' parameter.\n"}, #if 0 not needed, since ms defines what is supports and remote (sip) tells what is selected {"rtp-payload", &inter_rtp_payload, "", @@ -1299,8 +1396,9 @@ struct interface_param interface_param[] = { " bell - Allow releasing and pulse-dialing via 2600 Hz like old Bell systems.\n" " pulsedialing - Use pulse dialing on outgoing exchange. (takes long!)\n" " delay - Use on incomming exchange, to make you feel a delay when blueboxing.\n" - " starrelease - Pulse dialing a star (11 pulses per digit) clears current call.\n" - " suppress - Suppress received tones, as they will be recognized."}, + " release - Pulse dialing a star (11 pulses per digit) clears current call.\n" + " mutes-rx - Mute received 2600 and 2400 Hz tones when detected. (more realistic)\n" + " mutes-tx - Mute received 2600 and 2400 Hz tones while transmitting reply tone. (more hackable)"}, #endif {"remote", &inter_remote, "", @@ -1309,6 +1407,21 @@ struct interface_param interface_param[] = { {"context", &inter_context, "", "Give context for calls to application."}, + {"pots-flash", &inter_pots_flash, "", + "Allow flash button to hold an active call and setup a new call.\n" + "Ihis parameter only appies to POTS type of interfaces\n" + "This parameter must follow a 'port' parameter.\n"}, + {"pots-ring-after-hangup", &inter_pots_ring, "", + "Allow ringing of last hold call after hangup. Other calls on hold will not be\n" + "released.\n" + "Ihis parameter only appies to POTS type of interfaces\n" + "This parameter must follow a 'port' parameter.\n"}, + {"pots-transfer-after-hangup", &inter_pots_transfer, "", + "If two calls on hold, both are connected after hangup.\n" + "If one call is on hold and another one alerting, call on hold is tranfered.\n" + "Ihis parameter only appies to POTS type of interfaces\n" + "This parameter must follow a 'port' parameter.\n"}, + {"shutdown", &inter_shutdown, "", "Interface will not be loaded when processing interface.conf"},