diff options
author | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-03 21:50:19 +0000 |
---|---|---|
committer | etxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7> | 2005-02-03 21:50:19 +0000 |
commit | b1a39b0b539ce00a5f696665c665320249d1a63b (patch) | |
tree | 769691b378b7afafe4362c955132bf2eb38ebd4c /gtk/voip_calls.c | |
parent | 1f036aa098d18ab5f9d19cee138c1755c9bfaf16 (diff) |
From Francisco Alcoba:
Patch for graphing ISUP calls. It shows the type of message,
in the first one the calling and called numbers, and in the second the SPs
and CIC; in releases it shows the cause value.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13262 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/voip_calls.c')
-rw-r--r-- | gtk/voip_calls.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gtk/voip_calls.c b/gtk/voip_calls.c index d3e6298336..fc0e905179 100644 --- a/gtk/voip_calls.c +++ b/gtk/voip_calls.c @@ -512,6 +512,7 @@ remove_tap_listener_sip_calls(void) static gchar isup_called_number[255], isup_calling_number[255]; static guint16 isup_cic; static guint8 isup_message_type; +static guint8 isup_cause_value; /****************************************************************************/ /* whenever a isup_ packet is seen by the tap listener */ @@ -528,6 +529,7 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co strcpy(isup_called_number, pi->called_number); } isup_message_type = pi->message_type; + isup_cause_value = pi->cause_value; isup_cic = pinfo->circuit_id; return 0; @@ -593,6 +595,9 @@ mtp3_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co gboolean forward; gboolean right_pair = TRUE; GList* list; + gchar *frame_label = NULL; + gchar *comment = NULL; + int i; const mtp3_tap_rec_t *pi = mtp3_info; @@ -671,6 +676,35 @@ mtp3_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co /* Let's analyze the call state */ + + for (i=0;(isup_message_type_value[i].strptr!=NULL)&& (isup_message_type_value[i].value!=isup_message_type);i++); + + if (isup_message_type_value[i].value==isup_message_type){ + frame_label = g_strdup(isup_message_type_value_acro[i].strptr); + } + else{ + frame_label = g_strdup_printf("Unknown"); + } + + if (strinfo->npackets == 1){ /* this is the first packet, that must be an IAM */ + comment = g_strdup_printf("Call from %s to %s", + isup_calling_number, isup_called_number); + } + else if (strinfo->npackets == 2){ /* in the second packet we show the SPs */ + if (forward){ + comment = g_strdup_printf("%i-%i -> %i-%i. Cic:%i", + pi->addr_opc.ni, pi->addr_opc.pc, + pi->addr_opc.ni, pi->addr_dpc.pc, pinfo->circuit_id); + + } + else{ + comment = g_strdup_printf("%i-%i -> %i-%i. Cic:%i", + pi->addr_opc.ni, pi->addr_dpc.pc, + pi->addr_opc.ni, pi->addr_opc.pc, pinfo->circuit_id); + + } + } + switch(isup_message_type){ case 1: /* IAM */ strinfo->call_state=VOIP_CALL_SETUP; @@ -693,11 +727,23 @@ mtp3_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co strinfo->call_state = VOIP_COMPLETED; tapinfo->completed_calls++; } + for (i=0;(q931_cause_code_vals[i].strptr!=NULL)&& (q931_cause_code_vals[i].value!=isup_cause_value);i++); + if (q931_cause_code_vals[i].value==isup_cause_value){ + comment = g_strdup_printf("Cause %i - %s",isup_cause_value, q931_cause_code_vals[i].strptr); + } + else{ + comment = g_strdup_printf("Cause %i",isup_cause_value); + } break; } /* increment the packets counter of all calls */ ++(tapinfo->npackets); + + /* add to the graph */ + add_to_graph(tapinfo, pinfo, frame_label, comment, strinfo->call_num); + g_free(comment); + g_free(frame_label); } |