freetdm: ss7 - only unload layers when they are loaded
freetdm: ss7 - configuration updated to allow a route to use multiple linksets...new configuration file
This commit is contained in:
parent
beb8290539
commit
1cc51046c5
|
@ -74,6 +74,7 @@ int ftmod_ss7_relay_chan_config(int id);
|
||||||
int ft_to_sngss7_cfg_all(void)
|
int ft_to_sngss7_cfg_all(void)
|
||||||
{
|
{
|
||||||
int x = 0;
|
int x = 0;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
/* check if we have done gen_config already */
|
/* check if we have done gen_config already */
|
||||||
if (!(g_ftdm_sngss7_data.gen_config)) {
|
if (!(g_ftdm_sngss7_data.gen_config)) {
|
||||||
|
@ -289,15 +290,17 @@ int ft_to_sngss7_cfg_all(void)
|
||||||
/* check if this link has been configured already */
|
/* check if this link has been configured already */
|
||||||
if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
|
if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
|
||||||
|
|
||||||
if (ftmod_ss7_mtp3_nsap_config(x)) {
|
ret = ftmod_ss7_mtp3_nsap_config(x);
|
||||||
SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!\n", x);
|
if (ret) {
|
||||||
|
SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SS7_INFO("MTP3 NSAP %d configuration DONE!\n", x);
|
SS7_INFO("MTP3 NSAP %d configuration DONE!\n", x);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ftmod_ss7_isup_nsap_config(x)) {
|
ret = ftmod_ss7_isup_nsap_config(x);
|
||||||
SS7_CRITICAL("ISUP NSAP %d configuration FAILED!\n", x);
|
if (ret) {
|
||||||
|
SS7_CRITICAL("ISUP NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
SS7_INFO("ISUP NSAP %d configuration DONE!\n", x);
|
SS7_INFO("ISUP NSAP %d configuration DONE!\n", x);
|
||||||
|
@ -580,7 +583,7 @@ int ftmod_ss7_mtp3_gen_config(void)
|
||||||
|
|
||||||
cfg.t.cfg.s.snGen.ssfValid = TRUE; /* ssf validation required */
|
cfg.t.cfg.s.snGen.ssfValid = TRUE; /* ssf validation required */
|
||||||
cfg.t.cfg.s.snGen.nmbDLSap = MAX_SN_LINKS; /* number of MTP Data Link SAPs */
|
cfg.t.cfg.s.snGen.nmbDLSap = MAX_SN_LINKS; /* number of MTP Data Link SAPs */
|
||||||
cfg.t.cfg.s.snGen.nmbNSap = MAX_SN_VARIANTS; /* number of Upper Layer Saps */
|
cfg.t.cfg.s.snGen.nmbNSap = MAX_SN_ROUTES; /* number of Upper Layer Saps */
|
||||||
cfg.t.cfg.s.snGen.nmbRouts = MAX_SN_ROUTES; /* maximum number of routing entries */
|
cfg.t.cfg.s.snGen.nmbRouts = MAX_SN_ROUTES; /* maximum number of routing entries */
|
||||||
cfg.t.cfg.s.snGen.nmbLnkSets = MAX_SN_LINKSETS; /* number of link sets */
|
cfg.t.cfg.s.snGen.nmbLnkSets = MAX_SN_LINKSETS; /* number of link sets */
|
||||||
cfg.t.cfg.s.snGen.nmbRteInst = MAX_SN_ROUTES*16; /* number of simultaneous Rte instances */
|
cfg.t.cfg.s.snGen.nmbRteInst = MAX_SN_ROUTES*16; /* number of simultaneous Rte instances */
|
||||||
|
|
|
@ -1131,46 +1131,57 @@ static ftdm_status_t handle_show_status(ftdm_stream_handle_t *stream, int span,
|
||||||
ss7_info = (sngss7_chan_data_t *)g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
|
ss7_info = (sngss7_chan_data_t *)g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
|
||||||
ftdmchan = ss7_info->ftdmchan;
|
ftdmchan = ss7_info->ftdmchan;
|
||||||
|
|
||||||
/* grab the signaling_status */
|
if (ftdmchan == NULL) {
|
||||||
ftdm_channel_get_sig_status(ftdmchan, &sigstatus);
|
/* this should never happen!!! */
|
||||||
|
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|FTDMCHAN DOES NOT EXISTS",
|
||||||
|
ckt->span,
|
||||||
|
ckt->chan,
|
||||||
|
ckt->cic);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* grab the signaling_status */
|
||||||
|
ftdm_channel_get_sig_status(ftdmchan, &sigstatus);
|
||||||
|
|
||||||
|
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",
|
||||||
|
ckt->span,
|
||||||
|
ckt->chan,
|
||||||
|
ckt->cic,
|
||||||
|
ftdm_signaling_status2str(sigstatus),
|
||||||
|
ftdm_channel_state2str(ftdmchan->state));
|
||||||
|
|
||||||
|
if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) ||
|
||||||
|
(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {
|
||||||
|
stream->write_function(stream, "l_mn=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "l_mn=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) ||
|
||||||
|
(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {
|
||||||
|
stream->write_function(stream, "r_mn=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "r_mn=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {
|
||||||
|
stream->write_function(stream, "l_hw=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "l_hw=N|");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {
|
||||||
|
stream->write_function(stream, "r_hw=Y|");
|
||||||
|
}else {
|
||||||
|
stream->write_function(stream, "r_hw=N|");
|
||||||
|
}
|
||||||
|
|
||||||
stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",
|
if (sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {
|
||||||
ckt->span,
|
stream->write_function(stream, "relay=Y|");
|
||||||
ckt->chan,
|
}else {
|
||||||
ckt->cic,
|
stream->write_function(stream, "relay=N|");
|
||||||
ftdm_signaling_status2str(sigstatus),
|
}
|
||||||
ftdm_channel_state2str(ftdmchan->state));
|
|
||||||
|
|
||||||
if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {
|
|
||||||
stream->write_function(stream, "l_mn=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "l_mn=N|");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {
|
|
||||||
stream->write_function(stream, "r_mn=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "r_mn=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {
|
|
||||||
stream->write_function(stream, "l_hw=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "l_hw=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {
|
|
||||||
stream->write_function(stream, "r_hw=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "r_hw=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {
|
|
||||||
stream->write_function(stream, "relay=Y|");
|
|
||||||
}else {
|
|
||||||
stream->write_function(stream, "relay=N|");
|
|
||||||
}
|
|
||||||
|
|
||||||
stream->write_function(stream, "flags=0x%X",ss7_info->ckt_flags);
|
stream->write_function(stream, "flags=0x%X",ss7_info->ckt_flags);
|
||||||
|
|
||||||
stream->write_function(stream, "\n");
|
stream->write_function(stream, "\n");
|
||||||
|
|
|
@ -1570,26 +1570,33 @@ static FIO_SIG_UNLOAD_FUNCTION(ftdm_sangoma_ss7_unload)
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC)) {
|
||||||
sng_isup_free_cc();
|
sng_isup_free_cc();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
|
||||||
ftmod_ss7_shutdown_isup();
|
ftmod_ss7_shutdown_isup();
|
||||||
sng_isup_free_isup();
|
sng_isup_free_isup();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3)) {
|
||||||
ftmod_ss7_shutdown_mtp3();
|
ftmod_ss7_shutdown_mtp3();
|
||||||
sng_isup_free_mtp3();
|
sng_isup_free_mtp3();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2)) {
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2)) {
|
||||||
ftmod_ss7_shutdown_mtp2();
|
ftmod_ss7_shutdown_mtp2();
|
||||||
sng_isup_free_mtp2();
|
sng_isup_free_mtp2();
|
||||||
sng_isup_free_mtp1();
|
sng_isup_free_mtp1();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2);
|
||||||
}
|
}
|
||||||
|
|
||||||
ftmod_ss7_shutdown_relay();
|
if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY)) {
|
||||||
sng_isup_free_relay();
|
ftmod_ss7_shutdown_relay();
|
||||||
|
sng_isup_free_relay();
|
||||||
|
sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY);
|
||||||
|
}
|
||||||
|
|
||||||
sng_isup_free_sm();
|
sng_isup_free_sm();
|
||||||
|
|
||||||
|
|
|
@ -219,13 +219,18 @@ typedef struct sng_link_set {
|
||||||
uint32_t links[16];
|
uint32_t links[16];
|
||||||
} sng_link_set_t;
|
} sng_link_set_t;
|
||||||
|
|
||||||
|
typedef struct sng_link_set_list {
|
||||||
|
uint32_t lsId;
|
||||||
|
struct sng_link_set_list *next;
|
||||||
|
} sng_link_set_list_t;
|
||||||
|
|
||||||
typedef struct sng_route {
|
typedef struct sng_route {
|
||||||
char name[MAX_NAME_LEN];
|
char name[MAX_NAME_LEN];
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
uint32_t dpc;
|
uint32_t dpc;
|
||||||
uint32_t cmbLinkSetId;
|
uint32_t cmbLinkSetId;
|
||||||
uint32_t linkSetId;
|
struct sng_link_set_list lnkSets;
|
||||||
uint32_t linkType;
|
uint32_t linkType;
|
||||||
uint32_t switchType;
|
uint32_t switchType;
|
||||||
uint32_t ssf;
|
uint32_t ssf;
|
||||||
|
|
|
@ -1268,9 +1268,9 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)
|
||||||
ftdm_conf_parameter_t *parm = mtp_route->parameters;
|
ftdm_conf_parameter_t *parm = mtp_route->parameters;
|
||||||
int num_parms = mtp_route->n_parameters;
|
int num_parms = mtp_route->n_parameters;
|
||||||
int i;
|
int i;
|
||||||
|
sng_link_set_list_t *lnkSet;
|
||||||
|
|
||||||
ftdm_conf_node_t *linkset;
|
ftdm_conf_node_t *linkset;
|
||||||
int ls_id;
|
|
||||||
int numLinks;
|
int numLinks;
|
||||||
|
|
||||||
/* initalize the mtpRoute structure */
|
/* initalize the mtpRoute structure */
|
||||||
|
@ -1383,42 +1383,50 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill in the rest of the values in the mtpRoute struct */
|
/* fill in the rest of the values in the mtpRoute struct */
|
||||||
mtpRoute.nwId = mtpRoute.id;
|
mtpRoute.nwId = 0;
|
||||||
mtpRoute.cmbLinkSetId = mtpRoute.id;
|
mtpRoute.cmbLinkSetId = mtpRoute.id;
|
||||||
|
|
||||||
/* parse in the list of linksets this route is reachable by */
|
/* parse in the list of linksets this route is reachable by */
|
||||||
linkset = mtp_route->child->child;
|
linkset = mtp_route->child->child;
|
||||||
|
|
||||||
|
/* initalize the link-list of linkSet Ids */
|
||||||
|
lnkSet = &mtpRoute.lnkSets;
|
||||||
|
|
||||||
while (linkset != NULL) {
|
while (linkset != NULL) {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* extract the linkset Id */
|
/* extract the linkset Id */
|
||||||
ls_id = atoi(linkset->parameters->val);
|
lnkSet->lsId = atoi(linkset->parameters->val);
|
||||||
|
|
||||||
if (g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].id != 0) {
|
if (g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].id != 0) {
|
||||||
SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",ls_id);
|
SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",lnkSet->lsId);
|
||||||
} else {
|
} else {
|
||||||
SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",ls_id);
|
SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",lnkSet->lsId);
|
||||||
goto move_along;
|
goto move_along;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pull up the linktype, switchtype, and SSF from the linkset */
|
/* pull up the linktype, switchtype, and SSF from the linkset */
|
||||||
mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].linkType;
|
mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].linkType;
|
||||||
mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].switchType;
|
mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].switchType;
|
||||||
mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].ssf;
|
mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].ssf;
|
||||||
|
|
||||||
/* extract the number of cmbLinkSetId aleady on this linkset */
|
/* extract the number of cmbLinkSetId aleady on this linkset */
|
||||||
numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks;
|
numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
|
|
||||||
/* add this routes cmbLinkSetId to the list */
|
/* add this routes cmbLinkSetId to the list */
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].links[numLinks] = mtpRoute.cmbLinkSetId;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[numLinks] = mtpRoute.cmbLinkSetId;
|
||||||
|
|
||||||
/* increment the number of cmbLinkSets on this linkset */
|
/* increment the number of cmbLinkSets on this linkset */
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks++;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
/* update the linked list */
|
||||||
|
lnkSet->next = ftdm_malloc(sizeof(sng_link_set_list_t));
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
lnkSet->lsId = 0;
|
||||||
|
lnkSet->next = NULL;
|
||||||
|
|
||||||
move_along:
|
move_along:
|
||||||
/* move to the next linkset element */
|
/* move to the next linkset element */
|
||||||
linkset = linkset->next;
|
linkset = linkset->next;
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
} /* while (linkset != null) */
|
} /* while (linkset != null) */
|
||||||
|
|
||||||
|
@ -1465,6 +1473,7 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
{
|
{
|
||||||
sng_isup_inf_t sng_isup;
|
sng_isup_inf_t sng_isup;
|
||||||
sng_isap_t sng_isap;
|
sng_isap_t sng_isap;
|
||||||
|
sng_link_set_list_t *lnkSet;
|
||||||
ftdm_conf_parameter_t *parm = isup_interface->parameters;
|
ftdm_conf_parameter_t *parm = isup_interface->parameters;
|
||||||
int num_parms = isup_interface->n_parameters;
|
int num_parms = isup_interface->n_parameters;
|
||||||
int i;
|
int i;
|
||||||
|
@ -1500,7 +1509,6 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
} else if (!strcasecmp(parm->var, "spc")) {
|
} else if (!strcasecmp(parm->var, "spc")) {
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
sng_isup.spc = atoi(parm->val);
|
sng_isup.spc = atoi(parm->val);
|
||||||
g_ftdm_sngss7_data.cfg.spc = sng_isup.spc;
|
|
||||||
SS7_DEBUG("Found an isup SPC = %d\n", sng_isup.spc);
|
SS7_DEBUG("Found an isup SPC = %d\n", sng_isup.spc);
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
} else if (!strcasecmp(parm->var, "mtprouteId")) {
|
} else if (!strcasecmp(parm->var, "mtprouteId")) {
|
||||||
|
@ -1747,17 +1755,14 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)
|
||||||
sngss7_set_flag(&sng_isup, SNGSS7_PAUSED);
|
sngss7_set_flag(&sng_isup, SNGSS7_PAUSED);
|
||||||
|
|
||||||
/* trickle down the SPC to all sub entities */
|
/* trickle down the SPC to all sub entities */
|
||||||
int linkSetId;
|
lnkSet = &g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].lnkSets;
|
||||||
|
|
||||||
linkSetId = g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].linkSetId;
|
g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
|
||||||
i = 1;
|
while (lnkSet->next != NULL) {
|
||||||
while (g_ftdm_sngss7_data.cfg.mtp3Link[i].id != 0) {
|
g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;
|
||||||
if (g_ftdm_sngss7_data.cfg.mtp3Link[i].linkSetId == linkSetId) {
|
lnkSet = lnkSet->next;
|
||||||
g_ftdm_sngss7_data.cfg.mtp3Link[i].spc = g_ftdm_sngss7_data.cfg.spc;
|
|
||||||
}
|
|
||||||
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pull values from the lower levels */
|
/* pull values from the lower levels */
|
||||||
|
@ -2342,7 +2347,10 @@ static int ftmod_ss7_fill_in_mtpLinkSet(sng_link_set_t *mtpLinkSet)
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
{
|
{
|
||||||
int i = mtp3_route->id;
|
sng_link_set_list_t *lnkSet = NULL;
|
||||||
|
int i = mtp3_route->id;
|
||||||
|
int tmp = 0;
|
||||||
|
|
||||||
|
|
||||||
/* check if this id value has been used already */
|
/* check if this id value has been used already */
|
||||||
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
|
if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
|
||||||
|
@ -2355,10 +2363,19 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill in the cmbLinkSet in the linkset structure */
|
/* fill in the cmbLinkSet in the linkset structure */
|
||||||
int tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks;
|
lnkSet = &mtp3_route->lnkSets;
|
||||||
|
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].links[tmp] = mtp3_route->cmbLinkSetId;
|
tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks++;
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
while (lnkSet->next != NULL) {
|
||||||
|
tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;
|
||||||
|
g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;
|
||||||
|
|
||||||
|
lnkSet = lnkSet->next;
|
||||||
|
}
|
||||||
|
|
||||||
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, (char *)mtp3_route->name);
|
strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, (char *)mtp3_route->name);
|
||||||
|
|
||||||
|
@ -2369,7 +2386,7 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].cmbLinkSetId = mtp3_route->cmbLinkSetId;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].cmbLinkSetId = mtp3_route->cmbLinkSetId;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].isSTP = mtp3_route->isSTP;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].isSTP = mtp3_route->isSTP;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].nwId = mtp3_route->nwId;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].nwId = mtp3_route->nwId;
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].linkSetId = mtp3_route->linkSetId;
|
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].ssf = mtp3_route->ssf;
|
||||||
if (mtp3_route->t6 != 0) {
|
if (mtp3_route->t6 != 0) {
|
||||||
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = mtp3_route->t6;
|
g_ftdm_sngss7_data.cfg.mtpRoute[i].t6 = mtp3_route->t6;
|
||||||
|
@ -2439,8 +2456,7 @@ static int ftmod_ss7_fill_in_nsap(sng_route_t *mtp3_route)
|
||||||
i = 1;
|
i = 1;
|
||||||
while (g_ftdm_sngss7_data.cfg.nsap[i].id != 0) {
|
while (g_ftdm_sngss7_data.cfg.nsap[i].id != 0) {
|
||||||
if ((g_ftdm_sngss7_data.cfg.nsap[i].linkType == mtp3_route->linkType) &&
|
if ((g_ftdm_sngss7_data.cfg.nsap[i].linkType == mtp3_route->linkType) &&
|
||||||
(g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType) &&
|
(g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType)) {
|
||||||
(g_ftdm_sngss7_data.cfg.nsap[i].ssf == mtp3_route->ssf)) {
|
|
||||||
|
|
||||||
/* we have a match so break out of this loop */
|
/* we have a match so break out of this loop */
|
||||||
break;
|
break;
|
||||||
|
@ -2789,6 +2805,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
sngss7_chan_data_t *ss7_info = NULL;
|
sngss7_chan_data_t *ss7_info = NULL;
|
||||||
int x;
|
int x;
|
||||||
int count = 1;
|
int count = 1;
|
||||||
|
int flag;
|
||||||
|
|
||||||
while (ccSpan->ch_map[0] != '\0') {
|
while (ccSpan->ch_map[0] != '\0') {
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
@ -2799,13 +2816,45 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
return FTDM_FAIL;
|
return FTDM_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find the spot in master array for this circuit */
|
/* find a spot for this circuit in the global structure */
|
||||||
x = (ccSpan->procId * 1000) + count;
|
x = (ccSpan->procId * 1000);
|
||||||
|
flag = 0;
|
||||||
|
while (flag == 0) {
|
||||||
|
/**********************************************************************/
|
||||||
|
/* check the id value ( 0 = new, 0 > circuit can be existing) */
|
||||||
|
if (g_ftdm_sngss7_data.cfg.isupCkt[x].id == 0) {
|
||||||
|
/* we're at the end of the list of circuitsl aka this is new */
|
||||||
|
SS7_DEBUG("Found a new circuit %d, ccSpanId=%d, chan=%d\n",
|
||||||
|
x,
|
||||||
|
ccSpan->id,
|
||||||
|
count);
|
||||||
|
|
||||||
/* check if this circuit has already been filled in */
|
/* throw the flag to end the loop */
|
||||||
if (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {
|
flag = 1;
|
||||||
SS7_DEVEL_DEBUG("Filling in circuit that already exists...%d\n", x);
|
} else {
|
||||||
}
|
/* check the ccspan.id and chan to see if the circuit already exists */
|
||||||
|
if ((g_ftdm_sngss7_data.cfg.isupCkt[x].ccSpanId == ccSpan->id) &&
|
||||||
|
(g_ftdm_sngss7_data.cfg.isupCkt[x].chan == count)) {
|
||||||
|
|
||||||
|
/* we are processing a circuit that already exists */
|
||||||
|
SS7_DEBUG("Found an existing circuit %d, ccSpanId=%d, chan%d\n",
|
||||||
|
x,
|
||||||
|
ccSpan->id,
|
||||||
|
count);
|
||||||
|
|
||||||
|
/* throw the flag to end the loop */
|
||||||
|
flag = 1;
|
||||||
|
|
||||||
|
/* not supporting reconfig at this time */
|
||||||
|
SS7_DEBUG("Not supporting ckt reconfig at this time!\n");
|
||||||
|
goto move_along;
|
||||||
|
} else {
|
||||||
|
/* this is not the droid you are looking for */
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**********************************************************************/
|
||||||
|
} /* while (flag == 0) */
|
||||||
|
|
||||||
/* prepare the global info sturcture */
|
/* prepare the global info sturcture */
|
||||||
ss7_info = ftdm_calloc(1, sizeof(sngss7_chan_data_t));
|
ss7_info = ftdm_calloc(1, sizeof(sngss7_chan_data_t));
|
||||||
|
@ -2901,6 +2950,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)
|
||||||
g_ftdm_sngss7_data.cfg.isupCkt[x].cic,
|
g_ftdm_sngss7_data.cfg.isupCkt[x].cic,
|
||||||
g_ftdm_sngss7_data.cfg.isupCkt[x].id);
|
g_ftdm_sngss7_data.cfg.isupCkt[x].id);
|
||||||
|
|
||||||
|
move_along:
|
||||||
/* increment the span channel count */
|
/* increment the span channel count */
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue