- Fixed VBox, also added trace debugging.
- Nice 'Beep' after the announcement.
- Special announcement recording without beep.
-
+- Filters now work for interface.conf
+- Fixed minor audio gain bug.
+- Moved timeout setting from extension to interface.conf.
memset(&e_ext, 0, sizeof(struct extension));
// *************** NOTE: also change value in read_extension() **************
e_ext.rights = 4; /* international */
- e_ext.tout_setup = 120;
- e_ext.tout_dialing = 120;
- e_ext.tout_proceeding = 120;
- e_ext.tout_alerting = 120;
- e_ext.tout_disconnect = 120;
-// e_ext.tout_hold = 900;
-// e_ext.tout_park = 900;
e_ext.rxvol = e_ext.txvol = 0;
e_state = EPOINT_STATE_IDLE;
e_ext.number[0] = '\0';
SCPY(port_settings.tones_dir, e_ext.tones_dir);
else
SCPY(port_settings.tones_dir, options.tones_dir);
- port_settings.tout_setup = e_ext.tout_setup;
- port_settings.tout_dialing = e_ext.tout_dialing;
- port_settings.tout_proceeding = e_ext.tout_proceeding;
- port_settings.tout_alerting = e_ext.tout_alerting;
- port_settings.tout_disconnect = e_ext.tout_disconnect;
-// port_settings.tout_hold = e_ext.tout_hold;
-// port_settings.tout_park = e_ext.tout_park;
port_settings.no_seconds = e_ext.no_seconds;
/* NOTE: currently the try_card feature is not supported. it should be used later to try another card, if the outgoing call fails on one port */
# Example of an ISDN interface that runs in NT-mode, but provides tones during
# setup. Also we provide tones during setup also.
# This is usefull to interconnect to another PBX.
+# Additinally the timeout values for the different call states are adjusted to 60 seconds.
+# They are: setup, dialing, proceeding, alerting, disconnect
#[PBX]
#nt
#port 5
#earlyb yes
#tones yes
+#timeouts 60 60 60 60 60
# Hint: Enter "lcr interface" for quick help on interface options.
class Endpoint *epoint;
/* set timeout */
- epoint = find_epoint_id(ACTIVE_EPOINT(p_epointlist));
- if (epoint && p_m_d_ntmode)
+ if (state == PORT_STATE_IN_OVERLAP)
+ {
+ p_m_timeout = p_m_mISDNport->ifport->tout_dialing;
+ time(&p_m_timer);
+ }
+ if (state != p_state)
{
- if (state == PORT_STATE_IN_OVERLAP)
+ if (state == PORT_STATE_IN_SETUP
+ || state == PORT_STATE_OUT_SETUP
+ || state == PORT_STATE_IN_OVERLAP
+ || state == PORT_STATE_OUT_OVERLAP)
{
- p_m_timeout = p_settings.tout_dialing;
+ p_m_timeout = p_m_mISDNport->ifport->tout_setup;
time(&p_m_timer);
}
- if (state != p_state)
+ if (state == PORT_STATE_IN_PROCEEDING
+ || state == PORT_STATE_OUT_PROCEEDING)
{
- if (state == PORT_STATE_IN_SETUP
- || state == PORT_STATE_IN_OVERLAP)
- {
- p_m_timeout = p_settings.tout_setup;
- time(&p_m_timer);
- }
- if (state == PORT_STATE_IN_PROCEEDING
- || state == PORT_STATE_OUT_PROCEEDING)
- {
- p_m_timeout = p_settings.tout_proceeding;
- time(&p_m_timer);
- }
- if (state == PORT_STATE_IN_ALERTING
- || state == PORT_STATE_OUT_ALERTING)
- {
- p_m_timeout = p_settings.tout_alerting;
- time(&p_m_timer);
- }
- if (state == PORT_STATE_CONNECT
- || state == PORT_STATE_CONNECT_WAITING)
- {
- p_m_timeout = 0;
- }
- if (state == PORT_STATE_IN_DISCONNECT
- || state == PORT_STATE_OUT_DISCONNECT)
- {
- p_m_timeout = p_settings.tout_disconnect;
- time(&p_m_timer);
- }
+ p_m_timeout = p_m_mISDNport->ifport->tout_proceeding;
+ time(&p_m_timer);
+ }
+ if (state == PORT_STATE_IN_ALERTING
+ || state == PORT_STATE_OUT_ALERTING)
+ {
+ p_m_timeout = p_m_mISDNport->ifport->tout_alerting;
+ time(&p_m_timer);
+ }
+ if (state == PORT_STATE_CONNECT
+ || state == PORT_STATE_CONNECT_WAITING)
+ {
+ p_m_timeout = 0;
+ }
+ if (state == PORT_STATE_IN_DISCONNECT
+ || state == PORT_STATE_OUT_DISCONNECT)
+ {
+ p_m_timeout = p_m_mISDNport->ifport->tout_disconnect;
+ time(&p_m_timer);
}
}
* we may only release during incomming disconnect state.
* this means that the endpoint doesnt require audio anymore
*/
- if (p_state == PORT_STATE_IN_DISCONNECT)
+ if (p_state == PORT_STATE_IN_DISCONNECT
+ || p_state == PORT_STATE_OUT_DISCONNECT)
{
/* sending release */
dmsg = create_l3msg(CC_RELEASE | REQUEST, MT_RELEASE, p_m_d_l3id, sizeof(RELEASE_t), p_m_d_ntmode);
SCPY(ext->number, number);
// ********** NOTE: also change value in apppbx constructor
ext->rights = 4; /* international */
- ext->tout_setup = 120;
- ext->tout_dialing = 120;
- ext->tout_proceeding = 120;
- ext->tout_alerting = 120;
- ext->tout_disconnect = 120;
-// ext->tout_hold = 900;
-// ext->tout_park = 900;
ext->cfnr_delay = 20;
ext->vbox_codec = CODEC_MONO;
PDEBUG(DEBUG_CONFIG, "transmit volume: %d\n",ext->txvol);
} else
- if (!strcmp(option,"tout_setup"))
- {
- ext->tout_setup = atoi(param);
- if (ext->tout_setup < 0)
- ext->tout_setup = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout setup: %d\n",ext->tout_setup);
- } else
- if (!strcmp(option,"tout_dialing"))
- {
- ext->tout_dialing = atoi(param);
- if (ext->tout_dialing < 0)
- ext->tout_dialing = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout dialing: %d\n",ext->tout_dialing);
- } else
- if (!strcmp(option,"tout_proceeding"))
- {
- ext->tout_proceeding = atoi(param);
- if (ext->tout_proceeding < 0)
- ext->tout_proceeding = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout proceeding: %d\n",ext->tout_proceeding);
- } else
- if (!strcmp(option,"tout_alerting"))
- {
- ext->tout_alerting = atoi(param);
- if (ext->tout_alerting < 0)
- ext->tout_alerting = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout alerting: %d\n",ext->tout_alerting);
- } else
- if (!strcmp(option,"tout_disconnect"))
- {
- ext->tout_disconnect = atoi(param);
- if (ext->tout_disconnect < 0)
- ext->tout_disconnect = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout disconnect: %d\n",ext->tout_disconnect);
- } else
-#if 0
- if (!strcmp(option,"tout_hold"))
- {
- ext->tout_hold = atoi(param);
- if (ext->tout_hold < 0)
- ext->tout_hold = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout hold: %d\n",ext->tout_hold);
- } else
- if (!strcmp(option,"tout_park"))
- {
- ext->tout_park = atoi(param);
- if (ext->tout_park < 0)
- ext->tout_park = 0;
-
- PDEBUG(DEBUG_CONFIG, "timeout park: %d\n",ext->tout_park);
- } else
-#endif
if (!strcmp(option,"own_setup"))
{
i=0;
fprintf(fp,"# (see txvol)\n");
fprintf(fp,"rxvol %d\n\n",ext->rxvol);
- fprintf(fp,"# Timeout values\n# The keywords specify the following timeouts:\n");
- fprintf(fp,"# tout_setup: after pickup before dialing anything. (default 60 seconds)\n");
- fprintf(fp,"# tout_dialing: after dialing last digit of uncomplete number (default 15)\n");
- fprintf(fp,"# tout_proceeding: after start proceeding (default 120)\n");
- fprintf(fp,"# tout_alerting: after start ringing (default 120)\n");
- fprintf(fp,"# tout_disconnect: after disconnect (default 120)\n");
-// fprintf(fp,"# tout_hold: maximum time to hold a call (default 900)\n");
-// fprintf(fp,"# tout_park: maximum time to park a call (default 900)\n");
- fprintf(fp,"# All timeouts may be disabled by using keyword 'off' instead of seconds.\n");
- fprintf(fp,"# All timeouts refer to internal ports only. External timeouts are controlled\n");
- fprintf(fp,"# by external line.\n");
- if (ext->tout_setup)
- fprintf(fp,"tout_setup %d\n",ext->tout_setup);
- else
- fprintf(fp,"tout_setup off\n");
- if (ext->tout_dialing)
- fprintf(fp,"tout_dialing %d\n",ext->tout_dialing);
- else
- fprintf(fp,"tout_dialing off\n");
- if (ext->tout_proceeding)
- fprintf(fp,"tout_proceeding %d\n",ext->tout_proceeding);
- else
- fprintf(fp,"tout_proceeding off\n");
- if (ext->tout_alerting)
- fprintf(fp,"tout_alerting %d\n",ext->tout_alerting);
- else
- fprintf(fp,"tout_alerting off\n");
- if (ext->tout_disconnect)
- fprintf(fp,"tout_disconnect %d\n\n",ext->tout_disconnect);
- else
- fprintf(fp,"tout_disconnect off\n\n");
-// if (ext->tout_hold)
-// fprintf(fp,"tout_hold %d\n",ext->tout_hold);
-// else
-// fprintf(fp,"tout_hold off\n");
-// if (ext->tout_park)
-// fprintf(fp,"tout_park %d\n\n",ext->tout_park);
-// else
-// fprintf(fp,"tout_park off\n\n");
fprintf(fp,"# Force to use tones and announcements generated by the pbx.\n");
fprintf(fp,"# For internal calls always own tones are used. You may specify own tones for\n");
int vbox_email_file; /* set, if also the audio fille will be attached */
int vbox_free; /* if vbox shall connect after announcment */
- int tout_setup;
- int tout_dialing;
- int tout_proceeding;
- int tout_alerting;
- int tout_disconnect;
-// int tout_hold;
-// int tout_park;
int own_setup;
int own_proceeding;
int own_alerting;
memset(&ext, 0, sizeof(ext));
ext.rights = 4;
- ext.tout_setup = 120;
- ext.tout_dialing = 120;
- ext.tout_proceeding = 120;
- ext.tout_alerting = 120;
- ext.tout_disconnect = 120;
-// ext.tout_hold = 900;
-// ext.tout_park = 900;
ext.cfnr_delay = 20;
ext.vbox_codec = CODEC_MONO;
UCPY(ext.interfaces, argv[2]);
}
return(0);
}
+static int inter_timeouts(struct interface *interface, char *filename, int line, char *parameter, char *value)
+{
+ struct interface_port *ifport;
+ struct select_channel *selchannel, **selchannelp;
+ int val;
+ char *p, *el;
+
+ /* 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;
+ p = value;
+ if (!*p)
+ {
+ nofive:
+ SPRINT(interface_error, "Error in %s (line %d): parameter '%s' expects five timeout values.\n", filename, line, parameter);
+ return(-1);
+ }
+ el = p;
+ p = get_seperated(p);
+ ifport->tout_setup = atoi(el);
+ if (!*p)
+ goto nofive;
+ el = p;
+ p = get_seperated(p);
+ ifport->tout_dialing = atoi(el);
+ if (!*p)
+ goto nofive;
+ el = p;
+ p = get_seperated(p);
+ ifport->tout_proceeding = atoi(el);
+ if (!*p)
+ goto nofive;
+ el = p;
+ p = get_seperated(p);
+ ifport->tout_alerting = atoi(el);
+ if (!*p)
+ goto nofive;
+ el = p;
+ p = get_seperated(p);
+ ifport->tout_disconnect = atoi(el);
+ return(0);
+}
static int inter_msn(struct interface *interface, char *filename, int line, char *parameter, char *value)
{
struct interface_msn *ifmsn, **ifmsnp;
" <number>[,...] - List of channels to accept.\n"
" free - Accept any free channel"},
+ {"timeouts", &inter_timeouts, "<setup> <dialing> <proceeding> <alerting> <disconnect>",
+ "Timeout values for call states. They are both for incomming and outgoing states.\n"
+ "The default is 120 seconds for all states. Use 0 to disable.\n"
+ "This parameter must follow a 'port' parameter.\n"},
+
{"msn", &inter_msn, "<default MSN>,[<additional MSN>[,...]]",
"Incomming caller ID is checked against given MSN numbers.\n"
"If the caller ID is not found in this list, it is overwritten by the first MSN"},
struct select_channel *out_channel; /* list of channels to select */
struct select_channel *in_channel; /* the same for incoming channels */
int block; /* set if interface is blocked */
+ int tout_setup;
+ int tout_dialing;
+ int tout_proceeding;
+ int tout_alerting;
+ int tout_disconnect;
+// int tout_hold;
+// int tout_park;
};
struct interface_msn {
/* structure of port settings */
struct port_settings {
char tones_dir[256]; /* directory of current tone */
- int tout_setup;
- int tout_dialing;
- int tout_proceeding;
- int tout_alerting;
- int tout_disconnect;
-// int tout_hold;
-// int tout_park;
- int no_seconds; /* don't send seconds with time information element */
+ int no_seconds;
};
/* generic port class */
fuer asterisk: dejitter tx_buffer in dsp.o
+doku: tout in interface.conf
layer-2-hold interface feature