--- asterisk/channels/chan_zap.c 2004-06-25 17:17:08.000000000 -0400 +++ asterisk.new/channels/chan_zap.c 2004-06-26 00:24:06.000000000 -0400 @@ -316,6 +316,7 @@ int minidle; /* Min # of "idling" calls to keep active */ int nodetype; /* Node type */ int switchtype; /* Type of switch to emulate */ + int nsf; /* Network-Specific Facilities */ int dialplan; /* Dialing plan */ int dchannels[NUM_DCHANS]; /* What channel are the dchannels on */ int trunkgroup; /* What our trunkgroup is */ @@ -355,6 +356,7 @@ } static int switchtype = PRI_SWITCH_NI2; +static int nsf = PRI_NSF_NONE; static int dialplan = PRI_NATIONAL_ISDN + 1; #else @@ -5910,6 +5912,7 @@ } pris[span].nodetype = pritype; pris[span].switchtype = myswitchtype; + pris[span].nsf = nsf; pris[span].dialplan = dialplan; pris[span].pvts[pris[span].numchans++] = tmp; pris[span].minunused = minunused; @@ -7594,7 +7597,7 @@ pri->fds[i] = -1; return -1; } - pri->dchans[i] = pri_new(pri->fds[i], pri->nodetype, pri->switchtype); + pri->dchans[i] = pri_new(pri->fds[i], pri->nodetype, pri->switchtype, pri->nsf); /* Force overlap dial if we're doing GR-303! */ if (pri->switchtype == PRI_SWITCH_GR303_TMC) pri->overlapdial = 1; @@ -8832,6 +8835,19 @@ ast_mutex_unlock(&iflock); return -1; } + } else if (!strcasecmp(v->name, "nsf")) { + if (!strcasecmp(v->value, "sdn")) + nsf = PRI_NSF_SDN; + else if (!strcasecmp(v->value, "megacom")) + nsf = PRI_NSF_MEGACOM; + else if (!strcasecmp(v->value, "accunet")) + nsf = PRI_NSF_ACCUNET; + else if (!strcasecmp(v->value, "none")) + nsf = PRI_NSF_NONE; + else { + ast_log(LOG_WARNING, "Unknown network-specific facility '%s'\n", v->value); + nsf = PRI_NSF_NONE; + } } else if (!strcasecmp(v->name, "minunused")) { minunused = atoi(v->value); } else if (!strcasecmp(v->name, "idleext")) { @@ -9289,6 +9305,19 @@ ast_mutex_unlock(&iflock); return -1; } + } else if (!strcasecmp(v->name, "nsf")) { + if (!strcasecmp(v->value, "sdn")) + nsf = PRI_NSF_SDN; + else if (!strcasecmp(v->value, "megacom")) + nsf = PRI_NSF_MEGACOM; + else if (!strcasecmp(v->value, "accunet")) + nsf = PRI_NSF_ACCUNET + else if (!strcasecmp(v->value, "none")) + nsf = PRI_NSF_NONE; + else { + ast_log(LOG_WARN, "Unknown network-specific facility '%s'\n", v->value); + nsf = PRI_NSF_NONE; + } } else if (!strcasecmp(v->name, "jitterbuffers")) { numbufs = atoi(v->value); } else if (!strcasecmp(v->name, "minunused")) {