2 * VoIP calls summary addition for Wireshark
4 * Copyright 2004, Ericsson , Spain
5 * By Francisco Alcoba <francisco.alcoba@ericsson.com>
7 * based on h323_calls.h
8 * Copyright 2004, Iskratel, Ltd, Kranj
9 * By Miha Jemec <m.jemec@iskratel.si>
11 * H323, RTP and Graph Support
12 * By Alejandro Vaquero, alejandro.vaquero@verso.com
13 * Copyright 2005, Verso Technologies Inc.
15 * Wireshark - Network traffic analyzer
16 * By Gerald Combs <gerald@wireshark.org>
17 * Copyright 1998 Gerald Combs
19 * SPDX-License-Identifier: GPL-2.0-or-later
22 #ifndef __VOIP_CALLS_H__
23 #define __VOIP_CALLS_H__
26 * "VoIP Calls" dialog box common routines.
27 * @ingroup main_ui_group
32 #endif /* __cplusplus */
37 #include "epan/address.h"
38 #include "epan/packet.h"
39 #include "epan/guid-utils.h"
41 #include "epan/tap-voip.h"
42 #include "epan/sequence_analysis.h"
44 /****************************************************************************/
45 extern const char *voip_call_state_name[8];
47 typedef enum _voip_protocol {
65 typedef enum _hash_indexes {
69 extern const char *voip_protocol_name[];
71 typedef enum _flow_show_options
77 /** defines specific SIP data */
79 typedef enum _sip_call_state {
85 typedef struct _sip_calls_info {
86 gchar *call_identifier;
88 sip_call_state sip_state;
91 /** defines specific ISUP data */
92 typedef struct _isup_calls_info {
98 /* defines specific H245 data */
99 typedef struct _h245_address {
100 address h245_address;
104 /** defines specific H323 data */
105 typedef struct _h323_calls_info {
106 e_guid_t *guid; /* Call ID to identify a H225 */
107 GList* h245_list; /**< list of H245 Address and ports for tunneling off calls*/
108 address h225SetupAddr; /**< we use the SETUP H225 IP to determine if packets are forward or reverse */
110 gboolean is_faststart_Setup; /**< if faststart field is included in Setup*/
111 gboolean is_faststart_Proc; /**< if faststart field is included in Proce, Alerting, Progress or Connect*/
112 gboolean is_h245Tunneling;
118 /**< defines specific MGCP data */
119 typedef struct _mgcp_calls_info {
121 gboolean fromEndpoint; /**< true if the call was originated from the Endpoint, false for calls from MGC */
124 /** defines specific ACTRACE ISDN data */
125 typedef struct _actrace_isdn_calls_info {
128 } actrace_isdn_calls_info_t;
130 /** defines specific ACTRACE CAS data */
131 typedef struct _actrace_cas_calls_info {
134 } actrace_cas_calls_info_t;
136 /** defines specific SKINNY data */
137 typedef struct _skinny_calls_info {
139 } skinny_calls_info_t;
141 /** defines a voip call */
142 typedef struct _voip_calls_info {
143 voip_call_state call_state;
144 voip_call_active_state call_active_state;
146 gchar *from_identity;
149 void (*free_prot_info)(gpointer);
150 address initial_speaker;
152 voip_protocol protocol;
153 gchar *protocol_name;
156 /**> The frame_data struct holds the frame number and timing information needed. */
157 frame_data *start_fd;
158 nstime_t start_rel_ts;
160 nstime_t stop_rel_ts;
164 * structure that holds the information about all detected calls */
165 /* struct holding all information of the tap */
167 * XXX Most of these are private to voip_calls.c. We might want to
171 typedef struct _voip_calls_tapinfo {
172 tap_reset_cb tap_reset; /**< tap reset callback */
173 tap_packet_cb tap_packet; /**< tap per-packet callback */
174 tap_draw_cb tap_draw; /**< tap draw callback */
175 void *tap_data; /**< data for tap callbacks */
176 int ncalls; /**< number of call */
177 GQueue* callsinfos; /**< queue with all calls (voip_calls_info_t) */
178 GHashTable* callsinfo_hashtable[1]; /**< array of hashes per voip protocol (voip_calls_info_t); currently only the one for SIP is used */
179 int npackets; /**< total number of packets of all calls */
180 voip_calls_info_t *filter_calls_fwd; /**< used as filter in some tap modes */
184 seq_analysis_info_t *graph_analysis;
185 epan_t *session; /**< epan session */
186 int nrtpstreams; /**< number of rtp streams */
187 GList* rtpstream_list; /**< list of rtpstream_info_t */
188 guint32 rtp_evt_frame_num;
190 gboolean rtp_evt_end;
192 guint32 sdp_frame_num;
196 guint32 mtp3_frame_num;
197 struct _h245_labels *h245_labels; /**< H.245 labels */
198 gchar *q931_calling_number;
199 gchar *q931_called_number;
200 guint8 q931_cause_value;
202 guint32 q931_frame_num;
203 guint32 h225_frame_num;
204 guint16 h225_call_num;
205 int h225_cstype; /* XXX actually an enum */
206 gboolean h225_is_faststart;
207 guint32 sip_frame_num;
208 guint32 actrace_frame_num;
209 gint32 actrace_trunk;
210 gint32 actrace_direction;
211 flow_show_options fs_option;
213 } voip_calls_tapinfo_t;
216 #define VOIP_CALLS_DEBUG(...) { \
217 char *VOIP_CALLS_DEBUG_MSG = g_strdup_printf(__VA_ARGS__); \
218 g_warning("voip_calls: %s:%d %s", G_STRFUNC, __LINE__, VOIP_CALLS_DEBUG_MSG); \
219 g_free(VOIP_CALLS_DEBUG_MSG); \
222 #define VOIP_CALLS_DEBUG(...)
225 /****************************************************************************/
229 * Registers the voip_calls tap listeners (if not already done).
230 * From that point on, the calls list will be updated with every redissection.
231 * This function is also the entry point for the initialization routine of the tap system.
232 * So whenever voip_calls.c is added to the list of WIRESHARK_TAP_SRCs, the tap will be registered on startup.
233 * If not, it will be registered on demand by the voip_calls functions that need it.
235 void voip_calls_init_all_taps(voip_calls_tapinfo_t *tap_id_base);
238 * Removes the voip_calls tap listener (if not already done)
239 * From that point on, the voip calls list won't be updated any more.
241 void voip_calls_remove_all_tap_listeners(voip_calls_tapinfo_t *tap_id_base);
244 * Cleans up memory of voip calls tap.
246 void voip_calls_reset_all_taps(voip_calls_tapinfo_t *tapinfo);
250 #endif /* __cplusplus */
252 #endif /* __VOIP_CALLS_H__ */
255 * Editor modelines - https://www.wireshark.org/tools/modelines.html
260 * indent-tabs-mode: nil
263 * ex: set shiftwidth=4 tabstop=8 expandtab:
264 * :indentSize=4:tabSize=8:noTabs=true: