chlog: freetdm: ISDN - Support for chan-id-invert-extend-bit

This commit is contained in:
David Yat Sin 2011-06-10 11:52:57 -04:00
parent 346f11f81e
commit 269595ec60
3 changed files with 22 additions and 1 deletions

View File

@ -324,6 +324,11 @@ typedef struct ftdm_sngisdn_data {
uint8_t num_dchan;
sngisdn_dchan_data_t dchans[MAX_L1_LINKS+1];
sngisdn_span_data_t *spans[MAX_L1_LINKS+1]; /* spans are indexed by link_id */
#ifdef SANGOMA_ISDN_CHAN_ID_INVERT_BIT
/* Since this is a global configuration, place it here instead of sngisdn_span_data_t */
uint8_t chan_id_invert_extend_bit;
#endif
}ftdm_sngisdn_data_t;
typedef struct ftdm2trillium

View File

@ -393,6 +393,12 @@ ftdm_status_t ftmod_isdn_parse_cfg(ftdm_conf_parameter_t *ftdm_parameters, ftdm_
if (parse_early_media(val, span) != FTDM_SUCCESS) {
return FTDM_FAIL;
}
} else if (!strcasecmp(var, "chan-id-invert-extend-bit")) {
#ifdef SANGOMA_ISDN_CHAN_ID_INVERT_BIT
parse_yesno(var, val, &g_sngisdn_data.chan_id_invert_extend_bit);
#else
ftdm_log(FTDM_LOG_WARNING, "chan-id-invert-extend-bit is not supported in your version of libsng_isdn\n");
#endif
} else {
ftdm_log(FTDM_LOG_WARNING, "Ignoring unknown parameter %s\n", ftdm_parameters[paramindex].var);
}

View File

@ -624,7 +624,7 @@ ftdm_status_t sngisdn_stack_cfg_q931_dlsap(ftdm_span_t *span)
cfg.t.cfg.s.inDLSAP.tCbCfg = TRUE;
cfg.t.cfg.s.inDLSAP.tCbId = signal_data->cc_id;
if (signal_data->facility == SNGISDN_OPT_TRUE) {
cfg.t.cfg.s.inDLSAP.facilityHandling = IN_FACILITY_STANDRD;
} else {
@ -720,6 +720,16 @@ ftdm_status_t sngisdn_stack_cfg_q931_dlsap(ftdm_span_t *span)
}
cfg.t.cfg.s.inDLSAP.useSubAdr = 0; /* call routing on subaddress */
#ifdef SANGOMA_ISDN_CHAN_ID_INVERT_BIT
if (signal_data->switchtype == SNGISDN_SWITCH_DMS100 &&
g_sngisdn_data.chan_id_invert_extend_bit == SNGISDN_OPT_TRUE) {
/* Since this feature is not standard, we modified Trillium to check
the useSubAdr field and remove the extended bit if this is set, this
is a global configuration and once set, applies to all spans configured
as DMS 100 */
cfg.t.cfg.s.inDLSAP.useSubAdr = PRSNT_NODEF;
}
#endif
cfg.t.cfg.s.inDLSAP.adrPref = 0; /* use of prefix for international calls */
cfg.t.cfg.s.inDLSAP.nmbPrefDig = 0; /* number of digits used for prefix */
for (i = 0; i < IN_MAXPREFDIG; i++)