<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, &quot;mtp_routes&quot;, &quot;mtp_route&quot;, NULL, NULL)) {</span>
<span style="color: #00A000">+        if (add_config_list_nodes(isup, rootnode, &quot;mtp_routes&quot;, &quot;mtp_route&quot;, &quot;linksets&quot;, &quot;linkset&quot;)) {</span>
                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;failed to process mtp_routes for sng_isup config %s\n&quot;, 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-&gt;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(&amp;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-&gt;val);
                         SS7_DEBUG(&quot;Found an mtpRoute dpc = %d\n&quot;, mtpRoute.dpc);
                 /**********************************************************************/
<span style="color: #A00000">-                } else if (!strcasecmp(parm-&gt;var, &quot;linksetId&quot;)) {</span>
<span style="color: #A00000">-                /**********************************************************************/</span>
<span style="color: #A00000">-                        mtpRoute.linkSetId = atoi(parm-&gt;val);</span>
<span style="color: #A00000">-                        SS7_DEBUG(&quot;Found an mtpRoute linkset = %s\n&quot;, parm-&gt;val);</span>
<span style="color: #A00000">-                /**********************************************************************/</span>
                 } else if (!strcasecmp(parm-&gt;var, &quot;isSTP&quot;)) {
                 /**********************************************************************/
                         if (!strcasecmp(parm-&gt;val, &quot;no&quot;)) {
<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-&gt;child-&gt;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-&gt;parameters-&gt;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(&quot;Found mtpRoute linkset id = %d that is valid\n&quot;,ls_id);</span>
<span style="color: #00A000">+                } else {</span>
<span style="color: #00A000">+                        SS7_ERROR(&quot;Found mtpRoute linkset id = %d that is invalid\n&quot;,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-&gt;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(&amp;mtpRoute);
 
         ftmod_ss7_fill_in_nsap(&amp;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>