adding src/peer port into xml config

This commit is contained in:
kapil 2012-06-11 18:45:56 +05:30
parent 69bada7025
commit 8102c1603c
4 changed files with 15 additions and 4 deletions

View File

@ -840,7 +840,7 @@ static int ftmod_m2ua_sctsap_config(int m2ua_inf_id, int sctp_id)
/* service provider ID */
cfg.t.cfg.s.sctSapCfg.spId = sctp_id;
/* source port number */
cfg.t.cfg.s.sctSapCfg.srcPort = 2904;
cfg.t.cfg.s.sctSapCfg.srcPort = sctp->port;
/* interface address */
/*For multiple IP address support */
#ifdef SCT_ENDP_MULTI_IPADDR
@ -925,7 +925,7 @@ static int ftmod_m2ua_peer_config1(int m2ua_inf_id, int peer_id)
cfg.t.cfg.s.peerCfg.assocCfg.dstAddrLst.nAddr[i].u.ipv4NetAddr = peer->destAddrList[i];
}
#ifdef MW_CFG_DSTPORT
cfg.t.cfg.s.peerCfg.assocCfg.dstPort = /* TODO */ 2904; /* Port on which M2UA runs */
cfg.t.cfg.s.peerCfg.assocCfg.dstPort = peer->port; /* Port on which M2UA runs */
#endif
cfg.t.cfg.s.peerCfg.assocCfg.srcAddrLst.nmb = sctp->numSrcAddr; /* source address list */
for (i=0; i <= (sctp->numSrcAddr-1); i++) {

View File

@ -71,6 +71,7 @@ typedef struct sng_m2ua_peer_cfg{
uint16_t selfAspId; /* Self ASP ID. ASP identifier for this ASP node if the aspIdFlag is TRUE. */
uint32_t numDestAddr; /* Number of destination address defined */
uint16_t sctpId; /* idx to sctp profile */
uint16_t port; /* port */
uint32_t destAddrList[SCT_MAX_NET_ADDRS+1]; /* Destination adddress list */
uint16_t locOutStrms; /*Number of outgoing streams supported by this association*/
int init_sctp_assoc; /* flag to tell if we need to initiate SCTP association */

View File

@ -387,6 +387,12 @@ static int ftmod_ss7_parse_m2ua_peer_interface(ftdm_conf_node_t *m2ua_peer_inter
SS7_DEBUG("Found an sng_m2ua_peer sctp_id = %d\n", sng_m2ua_peer.sctpId);
/**********************************************************************/
} else if (!strcasecmp(parm->var, "dest_port")) {
/**********************************************************************/
sng_m2ua_peer.port = atoi(parm->val);
SS7_DEBUG("Found an sng_m2ua_peer port = %d\n", sng_m2ua_peer.port);
/**********************************************************************/
} else if (!strcasecmp(parm->var, "dest_addr")) {
/**********************************************************************/
if (sng_m2ua_peer.numDestAddr < SCT_MAX_NET_ADDRS) {
@ -450,6 +456,7 @@ static int ftmod_ss7_fill_in_m2ua_peer_interface(sng_m2ua_peer_cfg_t *m2ua_peer_
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].locOutStrms = m2ua_peer_iface->locOutStrms;
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].numDestAddr = m2ua_peer_iface->numDestAddr;
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].sctpId = m2ua_peer_iface->sctpId;
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].port = m2ua_peer_iface->port;
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].init_sctp_assoc = m2ua_peer_iface->init_sctp_assoc;
for (k=0; k<m2ua_peer_iface->numDestAddr; k++) {
g_ftdm_sngss7_data.cfg.g_m2ua_cfg.m2ua_peer[i].destAddrList[k] = m2ua_peer_iface->destAddrList[k];
@ -677,6 +684,9 @@ static int ftmod_ss7_parse_sctp_link(ftdm_conf_node_t *node)
} else {
SS7_ERROR("SCTP - too many source address configured. dropping %s \n", param->val);
}
} else if (!strcasecmp(param->var, "src_port")) {
t_link.port = atoi(param->val);
SS7_DEBUG("SCTP - Parsing <sng_sctp_interface> with port = %s\n", param->val);
}
else {
SS7_ERROR("SCTP - Found an unknown parameter <%s>. Skipping it.\n", param->var);
@ -684,7 +694,7 @@ static int ftmod_ss7_parse_sctp_link(ftdm_conf_node_t *node)
}
g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].id = t_link.id;
g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].tuclId = t_link.id;
g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].port = t_link.port;
strncpy((char*)g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].name, t_link.name, strlen(t_link.name) );
g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].flags = 0;
g_ftdm_sngss7_data.cfg.sctpCfg.linkCfg[t_link.id].numSrcAddr = t_link.numSrcAddr;

View File

@ -462,7 +462,7 @@ typedef struct sng_sctp_link {
char name[MAX_NAME_LEN];
uint32_t flags;
uint32_t id;
uint32_t tuclId;
uint32_t port;
uint32_t numSrcAddr;
uint32_t srcAddrList[SCT_MAX_NET_ADDRS+1];
} sng_sctp_link_t;