freetdm: ss7 - bug fix for SPC no longer being part sng_gen config
This commit is contained in:
parent
946ec62893
commit
1ee94c11c7
|
@ -352,22 +352,6 @@ int ft_to_sngss7_cfg_all(void)
|
|||
x++;
|
||||
} /* while (g_ftdm_sngss7_data.cfg.mtpRoute[x].id != 0) */
|
||||
|
||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[1].id != 0) {
|
||||
if (!(g_ftdm_sngss7_data.cfg.mtpRoute[0].flags & SNGSS7_CONFIGURED)) {
|
||||
|
||||
if (ftmod_ss7_mtp3_route_config(0)) {
|
||||
SS7_CRITICAL("MTP3 ROUTE 0 configuration FAILED!\n");
|
||||
return 1;
|
||||
} else {
|
||||
SS7_INFO("MTP3 ROUTE 0 configuration DONE!\n");
|
||||
}
|
||||
|
||||
/* set the SNGSS7_CONFIGURED flag */
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].flags |= SNGSS7_CONFIGURED;
|
||||
} /* if !SNGSS7_CONFIGURED */
|
||||
}
|
||||
|
||||
|
||||
x = 1;
|
||||
while (g_ftdm_sngss7_data.cfg.isap[x].id != 0) {
|
||||
/* check if this link has been configured already */
|
||||
|
@ -1161,7 +1145,7 @@ int ftmod_ss7_mtp3_route_config(int id)
|
|||
cfg.t.cfg.s.snRout.swtchType = k->linkType; /* switch type */
|
||||
cfg.t.cfg.s.snRout.upSwtch = k->switchType; /* user part switch type */
|
||||
cfg.t.cfg.s.snRout.cmbLnkSetId = k->cmbLinkSetId; /* combined link set ID */
|
||||
if (k->id == 0) {
|
||||
if (k->dir == SNG_RTE_UP) {
|
||||
cfg.t.cfg.s.snRout.dir = LSN_RTE_UP; /* direction */
|
||||
} else {
|
||||
cfg.t.cfg.s.snRout.dir = LSN_RTE_DN; /* direction */
|
||||
|
|
|
@ -82,6 +82,11 @@ typedef enum {
|
|||
HOLE
|
||||
} sng_ckt_type_t;
|
||||
|
||||
typedef enum {
|
||||
SNG_RTE_UP = 0,
|
||||
SNG_RTE_DN
|
||||
} sng_route_direction_t;
|
||||
|
||||
typedef enum {
|
||||
SNGSS7_LPA_FOR_COT = (1 << 0), /* send LPA when COT arrives */
|
||||
SNGSS7_ACM_OBCI_BITA = (1 << 10) /* in-band indication */
|
||||
|
@ -236,6 +241,7 @@ typedef struct sng_route {
|
|||
uint32_t ssf;
|
||||
uint32_t nwId;
|
||||
uint32_t isSTP;
|
||||
uint32_t dir;
|
||||
uint32_t t6;
|
||||
uint32_t t8;
|
||||
uint32_t t10;
|
||||
|
|
|
@ -2383,6 +2383,7 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
|||
g_ftdm_sngss7_data.cfg.mtpRoute[i].nwId = mtp3_route->nwId;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].lnkSets = mtp3_route->lnkSets;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].ssf = mtp3_route->ssf;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].dir = SNG_RTE_DN;
|
||||
if (mtp3_route->t6 != 0) {
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = mtp3_route->t6;
|
||||
} else {
|
||||
|
@ -2442,6 +2443,52 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static int ftmod_ss7_fill_in_self_route(int spc, int linkType, int switchType, int ssf)
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
while (g_ftdm_sngss7_data.cfg.mtpRoute[i].id != 0) {
|
||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].dpc == spc) {
|
||||
/* we have a match so break out of this loop */
|
||||
break;
|
||||
}
|
||||
/* move on to the next one */
|
||||
i++;
|
||||
}
|
||||
|
||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].id = i;
|
||||
SS7_DEBUG("found new mtp3 self route\n");
|
||||
} else {
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].id = i;
|
||||
SS7_DEBUG("found existing mtp3 self route\n");
|
||||
}
|
||||
|
||||
strncpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, "self-route", MAX_NAME_LEN-1);
|
||||
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].id = i;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].dpc = spc;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].linkType = linkType;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].switchType = switchType;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].cmbLinkSetId = i;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].isSTP = 0;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].ssf = ssf;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].dir = SNG_RTE_UP;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = 8;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t8 = 12;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t10 = 300;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t11 = 300;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t15 = 30;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t16 = 20;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t18 = 200;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t19 = 690;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t21 = 650;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t25 = 100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static int ftmod_ss7_fill_in_nsap(sng_route_t *mtp3_route)
|
||||
{
|
||||
|
@ -2754,45 +2801,6 @@ static int ftmod_ss7_fill_in_isap(sng_isap_t *sng_isap)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static int ftmod_ss7_fill_in_self_route(int spc, int linkType, int switchType, int ssf)
|
||||
{
|
||||
|
||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[0].dpc == 0){
|
||||
SS7_DEBUG("found new mtp3 self route\n");
|
||||
} else if (g_ftdm_sngss7_data.cfg.mtpRoute[0].dpc == spc) {
|
||||
SS7_DEBUG("found existing mtp3 self route\n");
|
||||
return FTDM_SUCCESS;
|
||||
} else {
|
||||
SS7_ERROR("found new mtp3 self route but it does not match the route already configured (dpc=%d:spc=%d)\n",
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].dpc,
|
||||
spc);
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
strncpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[0].name, "self-route", MAX_NAME_LEN-1);
|
||||
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].id = 0;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].dpc = spc;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].linkType = linkType;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].switchType = switchType;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].cmbLinkSetId = 0;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].isSTP = 0;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].ssf = ssf;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t6 = 8;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t8 = 12;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t10 = 300;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t11 = 300;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t15 = 30;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t16 = 20;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t18 = 200;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t19 = 690;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t21 = 650;
|
||||
g_ftdm_sngss7_data.cfg.mtpRoute[0].t25 = 100;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue