<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 1cc51046c5b5b61e86394b97996a2d7833244f90 (commit)
from: beb829053945926447ba0f970faf1a3326d83981 (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Konrad Hammel
comments:
freetdm: ss7 - only unload layers when they are loaded freetdm: ss7 - configuration updated to allow a route to use multiple linksets...new configuration file
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c</span>
<span style="color: #000080; font-weight: bold">index 15fc1ef..01d1013 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c</span>
<span style="color: #800080; font-weight: bold">@@ -74,6 +74,7 @@ int ftmod_ss7_relay_chan_config(int id);</span>
int ft_to_sngss7_cfg_all(void)
{
        int x = 0;
<span style="color: #00A000">+        int ret = 0;</span>
        /* check if we have done gen_config already */
        if (!(g_ftdm_sngss7_data.gen_config)) {
<span style="color: #800080; font-weight: bold">@@ -289,15 +290,17 @@ int ft_to_sngss7_cfg_all(void)</span>
                /* check if this link has been configured already */
                if (!(g_ftdm_sngss7_data.cfg.nsap[x].flags & SNGSS7_CONFIGURED)) {
<span style="color: #A00000">-                        if (ftmod_ss7_mtp3_nsap_config(x)) {</span>
<span style="color: #A00000">-                                SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!\n", x);</span>
<span style="color: #00A000">+                        ret = ftmod_ss7_mtp3_nsap_config(x);</span>
<span style="color: #00A000">+                        if (ret) {</span>
<span style="color: #00A000">+                                SS7_CRITICAL("MTP3 NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));</span>
                                return 1;
                        } else {
                                SS7_INFO("MTP3 NSAP %d configuration DONE!\n", x);
                        }
<span style="color: #A00000">-                        if (ftmod_ss7_isup_nsap_config(x)) {</span>
<span style="color: #A00000">-                                SS7_CRITICAL("ISUP NSAP %d configuration FAILED!\n", x);</span>
<span style="color: #00A000">+                        ret = ftmod_ss7_isup_nsap_config(x);</span>
<span style="color: #00A000">+                        if (ret) {</span>
<span style="color: #00A000">+                                SS7_CRITICAL("ISUP NSAP %d configuration FAILED!(%s)\n", x, DECODE_LCM_REASON(ret));</span>
                                return 1;
                        } else {
                                SS7_INFO("ISUP NSAP %d configuration DONE!\n", x);
<span style="color: #800080; font-weight: bold">@@ -580,7 +583,7 @@ int ftmod_ss7_mtp3_gen_config(void)</span>
        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 */
<span style="color: #A00000">-        cfg.t.cfg.s.snGen.nmbNSap                = MAX_SN_VARIANTS;        /* number of Upper Layer Saps */</span>
<span style="color: #00A000">+        cfg.t.cfg.s.snGen.nmbNSap                = MAX_SN_ROUTES;        /* number of Upper Layer Saps */</span>
        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.nmbRteInst        = MAX_SN_ROUTES*16;        /* number of simultaneous Rte instances */
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c</span>
<span style="color: #000080; font-weight: bold">index 4ab4359..0298429 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c</span>
<span style="color: #800080; font-weight: bold">@@ -1131,45 +1131,56 @@ static ftdm_status_t handle_show_status(ftdm_stream_handle_t *stream, int span,</span>
                                        ss7_info = (sngss7_chan_data_t *)g_ftdm_sngss7_data.cfg.isupCkt[x].obj;
                                        ftdmchan = ss7_info->ftdmchan;
<span style="color: #A00000">-                                        /* grab the signaling_status */</span>
<span style="color: #A00000">-                                        ftdm_channel_get_sig_status(ftdmchan, &sigstatus);</span>
<span style="color: #A00000">-        </span>
<span style="color: #A00000">-                                        stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",</span>
<span style="color: #A00000">-                                                                                                        ckt->span,</span>
<span style="color: #A00000">-                                                                                                        ckt->chan,</span>
<span style="color: #A00000">-                                                                                                        ckt->cic,</span>
<span style="color: #A00000">-                                                                                                        ftdm_signaling_status2str(sigstatus),</span>
<span style="color: #A00000">-                                                                                                        ftdm_channel_state2str(ftdmchan->state));</span>
<span style="color: #A00000">-        </span>
<span style="color: #A00000">-                                        if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "l_mn=Y|");</span>
<span style="color: #A00000">-                                        }else {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "l_mn=N|");</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #A00000">-        </span>
<span style="color: #A00000">-                                        if((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) || (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "r_mn=Y|");</span>
<span style="color: #A00000">-                                        }else {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "r_mn=N|");</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #A00000">-        </span>
<span style="color: #A00000">-                                        if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "l_hw=Y|");</span>
<span style="color: #A00000">-                                        }else {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "l_hw=N|");</span>
<span style="color: #A00000">-                                        }</span>
<span style="color: #00A000">+                                        if (ftdmchan == NULL) {</span>
<span style="color: #00A000">+                                                /* this should never happen!!! */</span>
<span style="color: #00A000">+                                                stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|FTDMCHAN DOES NOT EXISTS",</span>
<span style="color: #00A000">+                                                                                                                ckt->span,</span>
<span style="color: #00A000">+                                                                                                                ckt->chan,</span>
<span style="color: #00A000">+                                                                                                                ckt->cic);</span>
<span style="color: #00A000">+                                                </span>
<span style="color: #00A000">+                                        } else {</span>
<span style="color: #00A000">+                                                /* grab the signaling_status */</span>
<span style="color: #00A000">+                                                ftdm_channel_get_sig_status(ftdmchan, &sigstatus);</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                                                stream->write_function(stream, "span=%2d|chan=%2d|cic=%4d|sig_status=%4s|state=%s|",</span>
<span style="color: #00A000">+                                                                                                                ckt->span,</span>
<span style="color: #00A000">+                                                                                                                ckt->chan,</span>
<span style="color: #00A000">+                                                                                                                ckt->cic,</span>
<span style="color: #00A000">+                                                                                                                ftdm_signaling_status2str(sigstatus),</span>
<span style="color: #00A000">+                                                                                                                ftdm_channel_state2str(ftdmchan->state));</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                                                if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_TX)) || </span>
<span style="color: #00A000">+                                                        (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_TX))) {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "l_mn=Y|");</span>
<span style="color: #00A000">+                                                }else {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "l_mn=N|");</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                                                if ((sngss7_test_ckt_flag(ss7_info, FLAG_CKT_MN_BLOCK_RX)) || </span>
<span style="color: #00A000">+                                                        (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_MN_BLOCK_RX))) {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "r_mn=Y|");</span>
<span style="color: #00A000">+                                                }else {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "r_mn=N|");</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                                                if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_TX)) {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "l_hw=Y|");</span>
<span style="color: #00A000">+                                                }else {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "l_hw=N|");</span>
<span style="color: #00A000">+                                                }</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                                                if (sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "r_hw=Y|");</span>
<span style="color: #00A000">+                                                }else {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "r_hw=N|");</span>
<span style="color: #00A000">+                                                }</span>
        
<span style="color: #A00000">-                                        if(sngss7_test_ckt_flag(ss7_info, FLAG_GRP_HW_BLOCK_RX)) {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "r_hw=Y|");</span>
<span style="color: #A00000">-                                        }else {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "r_hw=N|");</span>
<span style="color: #00A000">+                                                if (sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "relay=Y|");</span>
<span style="color: #00A000">+                                                }else {</span>
<span style="color: #00A000">+                                                        stream->write_function(stream, "relay=N|");</span>
<span style="color: #00A000">+                                                }</span>
                                        }
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                                        if(sngss7_test_ckt_flag(ss7_info, FLAG_RELAY_DOWN)) {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "relay=Y|");</span>
<span style="color: #A00000">-                                        }else {</span>
<span style="color: #A00000">-                                                stream->write_function(stream, "relay=N|");</span>
<span style="color: #A00000">-                                        }                </span>
        
                                        stream->write_function(stream, "flags=0x%X",ss7_info->ckt_flags);
        
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c</span>
<span style="color: #000080; font-weight: bold">index adee000..ad52827 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c</span>
<span style="color: #800080; font-weight: bold">@@ -1570,26 +1570,33 @@ static FIO_SIG_UNLOAD_FUNCTION(ftdm_sangoma_ss7_unload)</span>
        if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC)) {
                sng_isup_free_cc();
<span style="color: #00A000">+                sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_CC);</span>
        }
        if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP)) {
                ftmod_ss7_shutdown_isup();
                sng_isup_free_isup();
<span style="color: #00A000">+                sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_ISUP);</span>
        }
        if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3)) {
                ftmod_ss7_shutdown_mtp3();
                sng_isup_free_mtp3();
<span style="color: #00A000">+                sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP3);</span>
        }
        if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2)) {
                ftmod_ss7_shutdown_mtp2();
                sng_isup_free_mtp2();
                sng_isup_free_mtp1();
<span style="color: #00A000">+                sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_MTP2);</span>
        }
<span style="color: #A00000">-        ftmod_ss7_shutdown_relay();</span>
<span style="color: #A00000">-        sng_isup_free_relay();</span>
<span style="color: #00A000">+        if (sngss7_test_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY)) {</span>
<span style="color: #00A000">+                ftmod_ss7_shutdown_relay();</span>
<span style="color: #00A000">+                sng_isup_free_relay();</span>
<span style="color: #00A000">+                sngss7_clear_flag(&g_ftdm_sngss7_data.cfg, SNGSS7_RY);</span>
<span style="color: #00A000">+        }</span>
        sng_isup_free_sm();
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h</span>
<span style="color: #000080; font-weight: bold">index 5272aa8..fe291fb 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h</span>
<span style="color: #800080; font-weight: bold">@@ -219,13 +219,18 @@ typedef struct sng_link_set {</span>
        uint32_t                links[16];
} sng_link_set_t;
<span style="color: #00A000">+typedef struct sng_link_set_list {</span>
<span style="color: #00A000">+        uint32_t                                        lsId;</span>
<span style="color: #00A000">+        struct sng_link_set_list        *next;</span>
<span style="color: #00A000">+} sng_link_set_list_t;</span>
<span style="color: #00A000">+</span>
typedef struct sng_route {
        char                        name[MAX_NAME_LEN];
        uint32_t                flags;
        uint32_t                id;
        uint32_t                dpc;
        uint32_t                cmbLinkSetId;
<span style="color: #A00000">-        uint32_t                linkSetId;</span>
<span style="color: #00A000">+        struct sng_link_set_list        lnkSets;</span>
        uint32_t                linkType;
        uint32_t                switchType;
        uint32_t                ssf;
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c</span>
<span style="color: #000080; font-weight: bold">index d2fa973..dc6428d 100644</span>
<span style="color: #A00000">--- a/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c</span>
<span style="color: #800080; font-weight: bold">@@ -1268,9 +1268,9 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)</span>
        ftdm_conf_parameter_t        *parm = mtp_route->parameters;
        int                                                 num_parms = mtp_route->n_parameters;
        int                                                 i;
<span style="color: #00A000">+        sng_link_set_list_t                *lnkSet;</span>
        ftdm_conf_node_t                *linkset;
<span style="color: #A00000">-        int                                                ls_id;</span>
        int                                                numLinks;
        /* initalize the mtpRoute structure */
<span style="color: #800080; font-weight: bold">@@ -1383,42 +1383,50 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)</span>
        }
        /* fill in the rest of the values in the mtpRoute struct */
<span style="color: #A00000">-        mtpRoute.nwId = mtpRoute.id;</span>
<span style="color: #00A000">+        mtpRoute.nwId = 0;</span>
        mtpRoute.cmbLinkSetId = mtpRoute.id;
        /* parse in the list of linksets this route is reachable by */
        linkset = mtp_route->child->child;
<span style="color: #00A000">+        /* initalize the link-list of linkSet Ids */</span>
<span style="color: #00A000">+        lnkSet = &mtpRoute.lnkSets;</span>
<span style="color: #00A000">+</span>
        while (linkset != NULL) {
        /**************************************************************************/
                /* extract the linkset Id */
<span style="color: #A00000">-                ls_id = atoi(linkset->parameters->val);</span>
<span style="color: #00A000">+                lnkSet->lsId = atoi(linkset->parameters->val);</span>
<span style="color: #A00000">-                if (g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].id != 0) {</span>
<span style="color: #A00000">-                        SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",ls_id);</span>
<span style="color: #00A000">+                if (g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].id != 0) {</span>
<span style="color: #00A000">+                        SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",lnkSet->lsId);</span>
                } else {
<span style="color: #A00000">-                        SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",ls_id);</span>
<span style="color: #00A000">+                        SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",lnkSet->lsId);</span>
                        goto move_along;
                }
                /* pull up the linktype, switchtype, and SSF from the linkset */
<span style="color: #A00000">-                mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].linkType;</span>
<span style="color: #A00000">-                mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].switchType;</span>
<span style="color: #A00000">-                mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].ssf;</span>
<span style="color: #00A000">+                mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].linkType;</span>
<span style="color: #00A000">+                mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].switchType;</span>
<span style="color: #00A000">+                mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].ssf;</span>
                
                /* extract the number of cmbLinkSetId aleady on this linkset */
<span style="color: #A00000">-                numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks;</span>
<span style="color: #00A000">+                numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;</span>
                
                /* add this routes cmbLinkSetId to the list */
<span style="color: #A00000">-                g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].links[numLinks] = mtpRoute.cmbLinkSetId;</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[numLinks] = mtpRoute.cmbLinkSetId;</span>
                /* increment the number of cmbLinkSets on this linkset */
<span style="color: #A00000">-                g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks++;</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                /* update the linked list */</span>
<span style="color: #00A000">+                lnkSet->next = ftdm_malloc(sizeof(sng_link_set_list_t));</span>
<span style="color: #00A000">+                lnkSet = lnkSet->next;</span>
<span style="color: #00A000">+                lnkSet->lsId = 0;</span>
<span style="color: #00A000">+                lnkSet->next = NULL;</span>
move_along:
                /* move to the next linkset element */
                linkset = linkset->next;
<span style="color: #A00000">-</span>
        /**************************************************************************/
        } /* while (linkset != null) */
<span style="color: #800080; font-weight: bold">@@ -1465,6 +1473,7 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)</span>
{
        sng_isup_inf_t                        sng_isup;
        sng_isap_t                                sng_isap;
<span style="color: #00A000">+        sng_link_set_list_t                *lnkSet;</span>
        ftdm_conf_parameter_t        *parm = isup_interface->parameters;
        int                                                num_parms = isup_interface->n_parameters;
        int                                                i;
<span style="color: #800080; font-weight: bold">@@ -1500,7 +1509,6 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)</span>
                } else if (!strcasecmp(parm->var, "spc")) {
                /**********************************************************************/
                        sng_isup.spc = atoi(parm->val);
<span style="color: #A00000">-                        g_ftdm_sngss7_data.cfg.spc = sng_isup.spc;</span>
                        SS7_DEBUG("Found an isup SPC = %d\n", sng_isup.spc);
                /**********************************************************************/
                } else if (!strcasecmp(parm->var, "mtprouteId")) {
<span style="color: #800080; font-weight: bold">@@ -1747,17 +1755,14 @@ static int ftmod_ss7_parse_isup_interface(ftdm_conf_node_t *isup_interface)</span>
        sngss7_set_flag(&sng_isup, SNGSS7_PAUSED);
        /* trickle down the SPC to all sub entities */
<span style="color: #A00000">-        int        linkSetId;</span>
<span style="color: #00A000">+        lnkSet = &g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].lnkSets;</span>
<span style="color: #A00000">-        linkSetId = g_ftdm_sngss7_data.cfg.mtpRoute[sng_isup.mtpRouteId].linkSetId;</span>
<span style="color: #00A000">+        g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;</span>
<span style="color: #00A000">+        lnkSet = lnkSet->next;</span>
<span style="color: #A00000">-        i = 1;</span>
<span style="color: #A00000">-        while (g_ftdm_sngss7_data.cfg.mtp3Link[i].id != 0) {</span>
<span style="color: #A00000">-                if (g_ftdm_sngss7_data.cfg.mtp3Link[i].linkSetId == linkSetId) {</span>
<span style="color: #A00000">-                        g_ftdm_sngss7_data.cfg.mtp3Link[i].spc = g_ftdm_sngss7_data.cfg.spc;</span>
<span style="color: #A00000">-                }</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-                i++;</span>
<span style="color: #00A000">+        while (lnkSet->next != NULL) {</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtp3Link[lnkSet->lsId].spc = sng_isup.spc;</span>
<span style="color: #00A000">+                lnkSet = lnkSet->next;</span>
        }
        /* pull values from the lower levels */
<span style="color: #800080; font-weight: bold">@@ -2342,7 +2347,10 @@ static int ftmod_ss7_fill_in_mtpLinkSet(sng_link_set_t *mtpLinkSet)</span>
/******************************************************************************/
static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)
{
<span style="color: #A00000">-        int i = mtp3_route->id;</span>
<span style="color: #00A000">+        sng_link_set_list_t        *lnkSet = NULL;</span>
<span style="color: #00A000">+        int                                 i = mtp3_route->id;</span>
<span style="color: #00A000">+        int                                        tmp = 0;</span>
<span style="color: #00A000">+</span>
        /* check if this id value has been used already */
        if (g_ftdm_sngss7_data.cfg.mtpRoute[i].id == 0) {
<span style="color: #800080; font-weight: bold">@@ -2355,10 +2363,19 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)</span>
        }
        /* fill in the cmbLinkSet in the linkset structure */
<span style="color: #A00000">-        int tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks;</span>
<span style="color: #00A000">+        lnkSet = &mtp3_route->lnkSets;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;</span>
<span style="color: #00A000">+        g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;</span>
<span style="color: #00A000">+        g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        while (lnkSet->next != NULL) {</span>
<span style="color: #00A000">+                tmp = g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks;</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].links[tmp] = mtp3_route->cmbLinkSetId;</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[lnkSet->lsId].numLinks++;</span>
<span style="color: #A00000">-        g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].links[tmp] = mtp3_route->cmbLinkSetId;</span>
<span style="color: #A00000">-        g_ftdm_sngss7_data.cfg.mtpLinkSet[mtp3_route->linkSetId].numLinks++;</span>
<span style="color: #00A000">+                lnkSet = lnkSet->next;</span>
<span style="color: #00A000">+        }</span>
        strcpy((char *)g_ftdm_sngss7_data.cfg.mtpRoute[i].name, (char *)mtp3_route->name);
<span style="color: #800080; font-weight: bold">@@ -2369,7 +2386,7 @@ static int ftmod_ss7_fill_in_mtp3_route(sng_route_t *mtp3_route)</span>
        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].nwId                        = mtp3_route->nwId;
<span style="color: #A00000">-        g_ftdm_sngss7_data.cfg.mtpRoute[i].linkSetId        = mtp3_route->linkSetId;</span>
<span style="color: #00A000">+        g_ftdm_sngss7_data.cfg.mtpRoute[i].lnkSets                = mtp3_route->lnkSets;</span>
        g_ftdm_sngss7_data.cfg.mtpRoute[i].ssf                        = mtp3_route->ssf;
        if (mtp3_route->t6 != 0) {
                g_ftdm_sngss7_data.cfg.mtpRoute[i].t6                = mtp3_route->t6;
<span style="color: #800080; font-weight: bold">@@ -2439,8 +2456,7 @@ static int ftmod_ss7_fill_in_nsap(sng_route_t *mtp3_route)</span>
        i = 1;
        while (g_ftdm_sngss7_data.cfg.nsap[i].id != 0) {
                if ((g_ftdm_sngss7_data.cfg.nsap[i].linkType == mtp3_route->linkType) &&
<span style="color: #A00000">-                        (g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType) &&</span>
<span style="color: #A00000">-                        (g_ftdm_sngss7_data.cfg.nsap[i].ssf == mtp3_route->ssf)) {</span>
<span style="color: #00A000">+                        (g_ftdm_sngss7_data.cfg.nsap[i].switchType == mtp3_route->switchType)) {</span>
                        /* we have a match so break out of this loop */
                        break;
<span style="color: #800080; font-weight: bold">@@ -2789,6 +2805,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)</span>
        sngss7_chan_data_t        *ss7_info = NULL;
        int                                        x;
        int                                        count = 1;
<span style="color: #00A000">+        int                                        flag;</span>
        while (ccSpan->ch_map[0] != '\0') {
        /**************************************************************************/
<span style="color: #800080; font-weight: bold">@@ -2799,13 +2816,45 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)</span>
                        return FTDM_FAIL;
                }
<span style="color: #A00000">-                /* find the spot in master array for this circuit */</span>
<span style="color: #A00000">-                x = (ccSpan->procId * 1000) + count;</span>
<span style="color: #00A000">+                /* find a spot for this circuit in the global structure */</span>
<span style="color: #00A000">+                x = (ccSpan->procId * 1000);</span>
<span style="color: #00A000">+                flag = 0;</span>
<span style="color: #00A000">+                while (flag == 0) {</span>
<span style="color: #00A000">+                /**********************************************************************/</span>
<span style="color: #00A000">+                        /* check the id value ( 0 = new, 0 > circuit can be existing) */</span>
<span style="color: #00A000">+                        if (g_ftdm_sngss7_data.cfg.isupCkt[x].id == 0) {</span>
<span style="color: #00A000">+                                /* we're at the end of the list of circuitsl aka this is new */</span>
<span style="color: #00A000">+                                SS7_DEBUG("Found a new circuit %d, ccSpanId=%d, chan=%d\n",</span>
<span style="color: #00A000">+                                                        x, </span>
<span style="color: #00A000">+                                                        ccSpan->id, </span>
<span style="color: #00A000">+                                                        count);</span>
<span style="color: #A00000">-                /* check if this circuit has already been filled in */</span>
<span style="color: #A00000">-                if (g_ftdm_sngss7_data.cfg.isupCkt[x].id != 0) {</span>
<span style="color: #A00000">-                        SS7_DEVEL_DEBUG("Filling in circuit that already exists...%d\n", x);</span>
<span style="color: #A00000">-                }</span>
<span style="color: #00A000">+                                /* throw the flag to end the loop */</span>
<span style="color: #00A000">+                                flag = 1;</span>
<span style="color: #00A000">+                        } else {</span>
<span style="color: #00A000">+                                /* check the ccspan.id and chan to see if the circuit already exists */</span>
<span style="color: #00A000">+                                if ((g_ftdm_sngss7_data.cfg.isupCkt[x].ccSpanId == ccSpan->id) &&</span>
<span style="color: #00A000">+                                        (g_ftdm_sngss7_data.cfg.isupCkt[x].chan == count)) {</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        /* we are processing a circuit that already exists */</span>
<span style="color: #00A000">+                                        SS7_DEBUG("Found an existing circuit %d, ccSpanId=%d, chan%d\n",</span>
<span style="color: #00A000">+                                                                x, </span>
<span style="color: #00A000">+                                                                ccSpan->id, </span>
<span style="color: #00A000">+                                                                count);</span>
<span style="color: #00A000">+        </span>
<span style="color: #00A000">+                                        /* throw the flag to end the loop */</span>
<span style="color: #00A000">+                                        flag = 1;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                                        /* not supporting reconfig at this time */</span>
<span style="color: #00A000">+                                        SS7_DEBUG("Not supporting ckt reconfig at this time!\n");</span>
<span style="color: #00A000">+                                        goto move_along;</span>
<span style="color: #00A000">+                                } else {</span>
<span style="color: #00A000">+                                        /* this is not the droid you are looking for */</span>
<span style="color: #00A000">+                                        x++;</span>
<span style="color: #00A000">+                                }</span>
<span style="color: #00A000">+                        }</span>
<span style="color: #00A000">+                /**********************************************************************/</span>
<span style="color: #00A000">+                } /* while (flag == 0) */</span>
                /* prepare the global info sturcture */
                ss7_info = ftdm_calloc(1, sizeof(sngss7_chan_data_t));
<span style="color: #800080; font-weight: bold">@@ -2901,6 +2950,7 @@ static int ftmod_ss7_fill_in_ccSpan(sng_ccSpan_t *ccSpan)</span>
                                        g_ftdm_sngss7_data.cfg.isupCkt[x].cic,
                                        g_ftdm_sngss7_data.cfg.isupCkt[x].id);
<span style="color: #00A000">+move_along:</span>
                /* increment the span channel count */
                count++;
</pre></div>
========================================================================<pre>
Summary of changes:
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_cfg.c | 13 ++-
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_cli.c | 85 ++++++++------
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.c | 11 ++-
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_main.h | 7 +-
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c | 124 ++++++++++++++------
5 files changed, 158 insertions(+), 82 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>