summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2005-05-12 15:05:25 +0000
committerMatthew Fredrickson <creslin@digium.com>2005-05-12 15:05:25 +0000
commitba736889bfa0b1b31ddab2700ae076151a92e3c9 (patch)
tree78c0a737fa18046b9b9d39681e3dd44f1d3e064b
parenteae699533a3ef1eb04bf9ea5eabcd6bf5ae013b2 (diff)
enable/disable facility ies
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xchannels/chan_zap.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 001d7f7ca..be8f010b1 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -57,7 +57,7 @@
#include <ctype.h>
#ifdef ZAPATA_PRI
#include <libpri.h>
-#ifndef PRI_AOC_UNITS
+#ifndef PRI_FACILITY_ENABLE
#error "You need newer libpri"
#endif
#endif
@@ -256,6 +256,7 @@ static int minidle = 0;
static char idleext[AST_MAX_EXTENSION];
static char idledial[AST_MAX_EXTENSION];
static int overlapdial = 0;
+static int facilityenable = 0;
static char internationalprefix[10] = "";
static char nationalprefix[10] = "";
static char localprefix[20] = "";
@@ -384,6 +385,7 @@ struct zt_pri {
int prilogicalspan; /* Logical span number within trunk group */
int numchans; /* Num of channels we represent */
int overlapdial; /* In overlap dialing mode */
+ int facilityenable; /* Enable facility IEs */
struct pri *dchans[NUM_DCHANS]; /* Actual d-channels */
int dchanavail[NUM_DCHANS]; /* Whether each channel is available */
struct pri *pri; /* Currently active D-channel */
@@ -1912,6 +1914,9 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
pri_sr_set_bearer(sr, p->digital ? PRI_TRANS_CAP_DIGITAL : ast->transfercapability,
(p->digital ? -1 :
((p->law == ZT_LAW_ALAW) ? PRI_LAYER_1_ALAW : PRI_LAYER_1_ULAW)));
+ if (p->pri->facilityenable)
+ pri_facility_enable(p->pri->pri);
+
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Requested transfer capability: 0x%.2x - %s\n", ast->transfercapability, ast_transfercapability2str(ast->transfercapability));
dp_strip = 0;
@@ -6655,6 +6660,7 @@ static struct zt_pvt *mkintf(int channel, int signalling, int radio, struct zt_p
pris[span].minunused = minunused;
pris[span].minidle = minidle;
pris[span].overlapdial = overlapdial;
+ pris[span].facilityenable = facilityenable;
strncpy(pris[span].idledial, idledial, sizeof(pris[span].idledial) - 1);
strncpy(pris[span].idleext, idleext, sizeof(pris[span].idleext) - 1);
strncpy(pris[span].internationalprefix, internationalprefix, sizeof(pris[span].internationalprefix)-1);
@@ -10154,7 +10160,9 @@ static int setup_zap(int reload)
ast_log(LOG_WARNING, "'%s' is not a valid ISDN timer configuration string\n", v->value);
#endif /* PRI_GETSET_TIMERS */
#endif /* ZAPATA_PRI */
-
+
+ } else if (!strcasecmp(v->name, "faclityenable")) {
+ facilityenable = ast_true(v->value);
} else if (!strcasecmp(v->name, "cadence")) {
/* setup to scan our argument */
int element_count, c[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};