]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: ss7 - increase mtp2 T7 default value, printing link name now for mtp2 Alarms
authorKonrad Hammel <konrad@sangoma.com>
Fri, 10 Sep 2010 15:35:43 +0000 (11:35 -0400)
committerKonrad Hammel <konrad@sangoma.com>
Fri, 10 Sep 2010 15:35:43 +0000 (11:35 -0400)
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_logger.c
libs/freetdm/src/ftmod/ftmod_sangoma_ss7/ftmod_sangoma_ss7_xml.c

index b666f726a1953e9618e7e547850b6696d8ed163c..1179ed9035229951e64054b95595ee0101cad0d6 100644 (file)
@@ -109,6 +109,10 @@ void handle_sng_mtp1_alarm(Pst *pst, L1Mngmt *sta)
 /******************************************************************************/
 void handle_sng_mtp2_alarm(Pst *pst, SdMngmt *sta)
 {
+       char    buf[50];
+       int             x = 1;
+
+       memset(buf, '\0', sizeof(buf));
 
        switch (sta->t.usta.alarm.category) {
        /**************************************************************************/
@@ -126,23 +130,39 @@ void handle_sng_mtp2_alarm(Pst *pst, SdMngmt *sta)
                case (LSD_EVENT_REMOTE_CONG_END):
                case (LSD_EVENT_RX_REMOTE_SIPO):
 
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+                                       
+
                        switch (sta->t.usta.alarm.cause) {
                        /******************************************************************/
                        case (LCM_CAUSE_UNKNOWN):
-                               ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s\n",
-                                                                                       sta->t.usta.evntParm[0],
+                               ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s\n",
+                                                                                       buf,
                                                                                        DECODE_LSD_EVENT(sta->t.usta.alarm.event));
                                break;
                        /******************************************************************/
                        case (LCM_CAUSE_MGMT_INITIATED):
-                               ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d][MGMT] %s\n",
-                                                                                       sta->t.usta.evntParm[0],
+                               ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s[MGMT] %s\n",
+                                                                                       buf,
                                                                                        DECODE_LSD_EVENT(sta->t.usta.alarm.event));
                                break;
                        /******************************************************************/
                        default:
-                               ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s (***unknown cause***)\n",
-                                                                                       sta->t.usta.evntParm[0],
+                               ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s (***unknown cause***)\n",
+                                                                                       buf,
                                                                                        DECODE_LSD_EVENT(sta->t.usta.alarm.event));
                                break;
                        /******************************************************************/
@@ -150,23 +170,71 @@ void handle_sng_mtp2_alarm(Pst *pst, SdMngmt *sta)
                        break;
                /**********************************************************************/
                case (LSD_EVENT_PROT_ERR):
-                       ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s : %s\n",
-                                                                               sta->t.usta.evntParm[0],
+                       
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+
+                       ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s : %s\n",
+                                                                               buf,
                                                                                DECODE_LSD_EVENT(sta->t.usta.alarm.event),
                                                                                DECODE_LSD_CAUSE(sta->t.usta.alarm.cause));
                        break;
                /**********************************************************************/
                case (LSD_EVENT_ALIGN_LOST):
-                       ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s : %s\n",
-                                                                               sta->t.usta.evntParm[0],
+                       
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+
+                       ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s : %s\n",
+                                                                               buf,
                                                                                DECODE_LSD_EVENT(sta->t.usta.alarm.event),
                                                                                DECODE_DISC_REASON(sta->t.usta.evntParm[1]));
                        break;
                /**********************************************************************/
                case (LSD_EVENT_RTB_FULL):
                case (LSD_EVENT_RTB_FULL_OVER):
-                       ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s : RTB Queue Len(%d)|Oldest BSN(%d)|Tx Queue Len(%d)|Outstanding Frames(%d)\n",
-                                                                               sta->t.usta.evntParm[0],
+
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+
+                       ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s : RTB Queue Len(%d)|Oldest BSN(%d)|Tx Queue Len(%d)|Outstanding Frames(%d)\n",
+                                                                               buf,
                                                                                DECODE_LSD_EVENT(sta->t.usta.alarm.event),
                                                                                sta->t.usta.evntParm[1],
                                                                                sta->t.usta.evntParm[2],
@@ -175,15 +243,47 @@ void handle_sng_mtp2_alarm(Pst *pst, SdMngmt *sta)
                        break;
                /**********************************************************************/
                case (LSD_EVENT_NEG_ACK):
-                       ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s : RTB Queue Len(%d)\n",
-                                                                               sta->t.usta.evntParm[0],
+
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+
+                       ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s : RTB Queue Len(%d)\n",
+                                                                               buf,
                                                                                DECODE_LSD_EVENT(sta->t.usta.alarm.event),
                                                                                sta->t.usta.evntParm[1]);
                        break;
                /**********************************************************************/
                case (LSD_EVENT_DAT_CFM_SDT):
-                       ftdm_log(FTDM_LOG_ERROR,"[MTP2][SAPID:%d] %s : %d\n",
-                                                                               sta->t.usta.evntParm[0],
+
+                       /* find the name for the sap in question */
+                       x = 1;
+                       while (g_ftdm_sngss7_data.cfg.mtpLink[x].id != 0) {
+                               if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == sta->t.usta.evntParm[0]) {
+                                       break;
+                               }
+                               x++;
+                       }
+
+                       if (g_ftdm_sngss7_data.cfg.mtpLink[x].id == 0) {
+                               sprintf(buf, "[SAPID:%d]", sta->t.usta.evntParm[0]);
+                       } else {
+                               sprintf(buf, "[%s]", g_ftdm_sngss7_data.cfg.mtpLink[x].name);
+                       }
+
+                       ftdm_log(FTDM_LOG_ERROR,"[MTP2]%s %s : %d\n",
+                                                                               buf,
                                                                                DECODE_LSD_EVENT(sta->t.usta.alarm.event),
                                                                                DECODE_DISC_REASON(sta->t.usta.evntParm[1]));
                        break;
index 4c1832d8125f4399eefe09da64723ed0b981bc93..cf0bf7caae99bcf583ade59df1e200827ce6efa6 100644 (file)
@@ -965,7 +965,7 @@ static int ftmod_ss7_fill_in_mtpLink(sng_mtp_link_t *mtpLink)
        if ( mtpLink->mtp2.t7 != 0 ) {
                g_ftdm_sngss7_data.cfg.mtpLink[i].mtp2.t7               = mtpLink->mtp2.t7;
        }else {
-               g_ftdm_sngss7_data.cfg.mtpLink[i].mtp2.t7               = 20;
+               g_ftdm_sngss7_data.cfg.mtpLink[i].mtp2.t7               = 40;
        }
 
        if (mtpLink->mtp3.t1 != 0) {