/******************************************************************************/
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) {
/**************************************************************************/
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;
/******************************************************************/
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],
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;