diff --git a/libpri.h b/libpri.h index 1eb2209..842c370 100644 --- a/libpri.h +++ b/libpri.h @@ -624,6 +624,9 @@ int pri_progress(struct pri *pri, q931_call *c, int channel, int info); /* Send call proceeding */ int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info); +/* Enable inband progress when a RELEASE is received */ +void pri_set_inbandrelease(struct pri *pri, unsigned int enable); + /* Enslave a PRI to another, so they share the same call list (and maybe some timers) */ void pri_enslave(struct pri *master, struct pri *slave); diff --git a/pri.c b/pri.c index 799e754..eb7dd50 100644 --- a/pri.c +++ b/pri.c @@ -782,6 +782,11 @@ void pri_set_overlapdial(struct pri *pri,int state) pri->overlapdial = state; } +void pri_set_inbandrelease(struct pri *pri, unsigned int enable) +{ + pri->acceptinbandrelease = (enable != 0); +} + int pri_fd(struct pri *pri) { return pri->fd; diff --git a/pri_internal.h b/pri_internal.h index 31573a7..038d65f 100644 --- a/pri_internal.h +++ b/pri_internal.h @@ -61,10 +61,11 @@ struct pri { int localtype; /* Local network type (unknown, network, cpe) */ int remotetype; /* Remote network type (unknown, network, cpe) */ - int bri; int sapi; int tei; int protodisc; + unsigned int bri:1; + unsigned int acceptinbandrelease:1; /* Should we allow inband progress after RELEASE? */ /* Q.921 State */ int q921_state; diff --git a/q931.c b/q931.c index 50f6506..c01f2cb 100644 --- a/q931.c +++ b/q931.c @@ -3782,7 +3782,7 @@ int q931_receive(struct pri *pri, q931_h *h, int len) /* wait for a RELEASE so that sufficient time has passed for the inband audio to be heard */ - if (c->progressmask & PRI_PROG_INBAND_AVAILABLE) + if (pri->acceptinbandrelease && (c->progressmask & PRI_PROG_INBAND_AVAILABLE)) break; /* Return such an event */