<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: a382990d9f23096d04812cea6d66f6c3f3994e89 (commit)
from: becb94052ac619290e6825c4f985917134c6bce2 (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Konrad Hammel
comments:
chlog: freetdm: ss7 - bug fix: a route now supports multiple linksets
<span style="color: #000080; font-weight: bold">diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #000080; font-weight: bold">index d972cd7..92cf9e5 100755</span>
<span style="color: #A00000">--- a/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #00A000">+++ b/libs/freetdm/mod_freetdm/mod_freetdm.c</span>
<span style="color: #800080; font-weight: bold">@@ -2462,7 +2462,7 @@ static ftdm_conf_node_t *get_ss7_config_node(switch_xml_t cfg, const char *confn</span>
        }
        /* add mtp routes */
<span style="color: #A00000">-        if (add_config_list_nodes(isup, rootnode, "mtp_routes", "mtp_route", NULL, NULL)) {</span>
<span style="color: #00A000">+        if (add_config_list_nodes(isup, rootnode, "mtp_routes", "mtp_route", "linksets", "linkset")) {</span>
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "failed to process mtp_routes for sng_isup config %s\n", confname);
                ftdm_conf_node_destroy(rootnode);
                return NULL;
<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 277951c..93f2678 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">@@ -1269,6 +1269,10 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)</span>
        int                                                 num_parms = mtp_route->n_parameters;
        int                                                 i;
<span style="color: #00A000">+        ftdm_conf_node_t                *linkset;</span>
<span style="color: #00A000">+        int                                                ls_id;</span>
<span style="color: #00A000">+        int                                                numLinks;</span>
<span style="color: #00A000">+</span>
        /* initalize the mtpRoute structure */
        memset(&mtpRoute, 0x0, sizeof(mtpRoute));
<span style="color: #800080; font-weight: bold">@@ -1299,11 +1303,6 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)</span>
                        mtpRoute.dpc = atoi(parm->val);
                        SS7_DEBUG("Found an mtpRoute dpc = %d\n", mtpRoute.dpc);
                /**********************************************************************/
<span style="color: #A00000">-                } else if (!strcasecmp(parm->var, "linksetId")) {</span>
<span style="color: #A00000">-                /**********************************************************************/</span>
<span style="color: #A00000">-                        mtpRoute.linkSetId = atoi(parm->val);</span>
<span style="color: #A00000">-                        SS7_DEBUG("Found an mtpRoute linkset = %s\n", parm->val);</span>
<span style="color: #A00000">-                /**********************************************************************/</span>
                } else if (!strcasecmp(parm->var, "isSTP")) {
                /**********************************************************************/
                        if (!strcasecmp(parm->val, "no")) {
<span style="color: #800080; font-weight: bold">@@ -1383,15 +1382,47 @@ static int ftmod_ss7_parse_mtp_route(ftdm_conf_node_t *mtp_route)</span>
                parm = parm + 1;
        }
<span style="color: #A00000">-        /* pull up the linktype, switchtype, and SSF from the linkset */</span>
<span style="color: #A00000">-        mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtpRoute.linkSetId].linkType;</span>
<span style="color: #A00000">-        mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtpRoute.linkSetId].switchType;</span>
<span style="color: #A00000">-        mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[mtpRoute.linkSetId].ssf;</span>
<span style="color: #A00000">-</span>
        /* fill in the rest of the values in the mtpRoute struct */
        mtpRoute.nwId = mtpRoute.id;
        mtpRoute.cmbLinkSetId = mtpRoute.id;
<span style="color: #00A000">+        /* parse in the list of linksets this route is reachable by */</span>
<span style="color: #00A000">+        linkset = mtp_route->child->child;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        while (linkset != NULL) {</span>
<span style="color: #00A000">+        /**************************************************************************/</span>
<span style="color: #00A000">+                /* extract the linkset Id */</span>
<span style="color: #00A000">+                ls_id = atoi(linkset->parameters->val);</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                if (g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].id != 0) {</span>
<span style="color: #00A000">+                        SS7_DEBUG("Found mtpRoute linkset id = %d that is valid\n",ls_id);</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        SS7_ERROR("Found mtpRoute linkset id = %d that is invalid\n",ls_id);</span>
<span style="color: #00A000">+                        goto move_along;</span>
<span style="color: #00A000">+                }</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                /* pull up the linktype, switchtype, and SSF from the linkset */</span>
<span style="color: #00A000">+                mtpRoute.linkType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].linkType;</span>
<span style="color: #00A000">+                mtpRoute.switchType = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].switchType;</span>
<span style="color: #00A000">+                mtpRoute.ssf = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].ssf;</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                /* extract the number of cmbLinkSetId aleady on this linkset */</span>
<span style="color: #00A000">+                numLinks = g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks;</span>
<span style="color: #00A000">+                </span>
<span style="color: #00A000">+                /* add this routes cmbLinkSetId to the list */</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].links[numLinks] = mtpRoute.cmbLinkSetId;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+                /* increment the number of cmbLinkSets on this linkset */</span>
<span style="color: #00A000">+                g_ftdm_sngss7_data.cfg.mtpLinkSet[ls_id].numLinks++;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+move_along:</span>
<span style="color: #00A000">+                /* move to the next linkset element */</span>
<span style="color: #00A000">+                linkset = linkset->next;</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+        /**************************************************************************/</span>
<span style="color: #00A000">+        } /* while (linkset != null) */</span>
<span style="color: #00A000">+</span>
<span style="color: #00A000">+</span>
        ftmod_ss7_fill_in_mtp3_route(&mtpRoute);
        ftmod_ss7_fill_in_nsap(&mtpRoute);
</pre></div>
========================================================================<pre>
Summary of changes:
libs/freetdm/mod_freetdm/mod_freetdm.c | 2 +-
.../ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c | 51 ++++++++++++++++----
2 files changed, 42 insertions(+), 11 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>