static void handle_entsi_alarm(sng_alrm_t alarm) { switch (alarm.event) { /**************************************************************************/ case (LCM_EVENT_TIMEOUT): /* this event always has the circuit value embedded */ SS7_WARN("[ISUP] Timer %d expired on CIC %d\n", alarm.eventParm[8], g_ftdm_sngss7_data.cfg.isupCircuit[alarm.eventParm[0]].cic); break; /**************************************************************************/ case (LSI_EVENT_REMOTE): SS7_WARN("[ISUP] %s received on CIC %d\n", DECODE_LSI_CAUSE(alarm.cause), g_ftdm_sngss7_data.cfg.isupCircuit[alarm.eventParm[0]].cic); break; /**************************************************************************/ case (LSI_EVENT_LOCAL): SS7_WARN("[ISUP] %s transmitted on CIC %d\n", DECODE_LSI_CAUSE(alarm.cause), g_ftdm_sngss7_data.cfg.isupCircuit[alarm.eventParm[0]].cic); break; /**************************************************************************/ case (LSI_EVENT_MTP): SS7_WARN("[ISUP] Received %s on %d\n", DECODE_LSI_CAUSE(alarm.cause), g_ftdm_sngss7_data.cfg.mtp3_isup[alarm.eventParm[2]].id); break; /**************************************************************************/ case (LCM_EVENT_UI_INV_EVT): switch (alarm.cause) { /**********************************************************************/ case (LSI_CAUSE_INV_CIRCUIT): SS7_WARN("[ISUP] Invalid circuit = %d (CIC = %d)\n", alarm.eventParm[0], g_ftdm_sngss7_data.cfg.isupCircuit[alarm.eventParm[0]].cic); break; /**********************************************************************/ } break; /**************************************************************************/ case (LCM_EVENT_LI_INV_EVT): switch (alarm.cause) { /**********************************************************************/ case (LCM_CAUSE_INV_SAP): SS7_WARN("[ISUP] Invalid spId = %d\n", alarm.eventParm[3]); break; /**********************************************************************/ } break; /**************************************************************************/ default: SS7_WARN("[ISUP] %s : %s \n", DECODE_LSI_EVENT(alarm.event), DECODE_LSI_CAUSE(alarm.cause)); break; /**************************************************************************/ } /* switch (alarm.event) */ return; }
void handle_sng_isup_alarm(Pst *pst, SiMngmt *sta) { char msg[250]; char tmp[25]; char *p = NULL; int x = 0; SS7_RELAY_DBG_FUN(handle_sng_isup_alarm); /* initalize the msg variable to NULLs */ memset(&msg[0], '\0', sizeof(&msg)); /* if the event is REMOTE/LOCAL we don't need to print these */ if ((sta->t.usta.alarm.event == LSI_EVENT_REMOTE) || (sta->t.usta.alarm.event == LSI_EVENT_LOCAL)) { return; } /* point p to the first spot in msg */ p = &msg[0]; p = strcat(p, "[ISUP]"); /* go through the dgnVals */ for (x = 0; x < 5; x++) { switch (sta->t.usta.dgn.dgnVal[x].type) { /**********************************************************************/ case (LSI_USTA_DGNVAL_NONE): break; /**********************************************************************/ case (LSI_USTA_DGNVAL_EVENT): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[EVENT:%d]",sta->t.usta.dgn.dgnVal[x].t.event); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_SPID): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[SPID:%d]",sta->t.usta.dgn.dgnVal[x].t.spId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_SUID): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[SUID:%d]",sta->t.usta.dgn.dgnVal[x].t.suId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_SPINSTID): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[SPINSTID:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.spInstId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_SUINSTID): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[SUINSTID:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.suInstId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_CIRCUIT): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[CKT:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.cirId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_CIC): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[CIC:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.cic); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_INTF): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[INTF:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.intfId); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_DPC): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[DPC:%d]", (int)sta->t.usta.dgn.dgnVal[x].t.dpc); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_ADDRS): #if 0 /* *typedef struct addrs *{ *U8 length; *U8 strg[ADRLEN]; *} Addrs; */ /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[ADDRS:%d]",sta->t.usta.dgn.dgnVal[x].t.); /* concat tmp to msg */ p = strcat(p, &tmp[0]); #endif break; /**********************************************************************/ case (LSI_USTA_DGNVAL_SWTCH): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[SWTCH:%d]",sta->t.usta.dgn.dgnVal[x].t.swtch); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_RANGE): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[RANGE:0x%X]",sta->t.usta.dgn.dgnVal[x].t.range); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_STATUS_OCTS): #if 0 /* *typedef struct addrs *{ *U8 length; *U8 strg[ADRLEN]; *} Addrs; */ /* init tmp with NULLs */ /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[STATUS_OCT:0x%X]",sta->t.usta.dgn.dgnVal[x].t.); /* concat tmp to msg */ p = strcat(p, &tmp[0]); #endif break; /**********************************************************************/ case (LSI_USTA_DGNVAL_VER): #ifdef SI_RUG /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[VER:%d]",sta->t.usta.dgn.dgnVal[x].t.intfVer); /* concat tmp to msg */ p = strcat(p, &tmp[0]); #endif break; /**********************************************************************/ case (LSI_USTA_DGNVAL_TIMER): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[TIMER:0x%X]",sta->t.usta.dgn.dgnVal[x].t.tmrInfo); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_MSGTYPE): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[MSGTYPE:%d]",sta->t.usta.dgn.dgnVal[x].t.msgType); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ case (LSI_USTA_DGNVAL_STATE): /* init tmp with NULLs */ memset(&tmp[0], '\0', sizeof(&tmp)); /* fill in the dgn val to tmp */ sprintf(&tmp[0], "[STATE:%d]",sta->t.usta.dgn.dgnVal[x].t.state); /* concat tmp to msg */ p = strcat(p, &tmp[0]); break; /**********************************************************************/ default: break; /**********************************************************************/ } /* switch (sta->t.usta.dgn.dgnVal[x].t.type) */ } /* for (x = 0; x < 5; x++) */ ftdm_log(FTDM_LOG_ERROR,"%s %s : %s\n", msg, DECODE_LSI_EVENT(sta->t.usta.alarm.event), DECODE_LSI_CAUSE(sta->t.usta.alarm.cause)); return; } /* handle_isup_alarm */