From Alejandro Vaqero:
[obnox/wireshark/wip.git] / gtk / voip_calls.c
index f4d61ed2572eb3b8df7540b3f2a6a5f85944681e..d69443fc1213d36a53467393527e1d333801dcdc 100644 (file)
@@ -306,9 +306,16 @@ RTP_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
        while (list)
        {
                tmp_listinfo=list->data;
-               if ( (tmp_listinfo->setup_frame_number == pi->info_setup_frame_num) && (tmp_listinfo->ssrc == pi->info_sync_src) ){
+               if ( (tmp_listinfo->setup_frame_number == pi->info_setup_frame_num) 
+                       && (tmp_listinfo->ssrc == pi->info_sync_src) && (tmp_listinfo->end_stream == FALSE)){
+                       /* if the payload type has changed, we mark the stream as finished to create a new one
+                          this is to show multiple payload changes in the Graph for example for DTMF RFC2833 */           
+                       if ( tmp_listinfo->pt != pi->info_payload_type ) 
+                               tmp_listinfo->end_stream = TRUE;
+                       else {
                                strinfo = (voip_rtp_stream_info_t*)(list->data);
                                break;
+                       }
                }
                list = g_list_next (list);
        }
@@ -321,6 +328,7 @@ RTP_packet( void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, const vo
                COPY_ADDRESS(&(strinfo->dest_addr), &(pinfo->dst));
                strinfo->dest_port = pinfo->destport;
                strinfo->ssrc = pi->info_sync_src;
+               strinfo->end_stream = FALSE;
                strinfo->pt = pi->info_payload_type;
                strinfo->npackets = 0;
                strinfo->first_frame_num = pinfo->fd->num;
@@ -650,6 +658,7 @@ static gchar                isup_called_number[255], isup_calling_number[255];
 static guint16         isup_cic;
 static guint8          isup_message_type;
 static guint8          isup_cause_value;
+static guint32         isup_frame_num;
 
 /****************************************************************************/
 /* whenever a isup_ packet is seen by the tap listener */
@@ -669,6 +678,8 @@ isup_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
        isup_cause_value = pi->cause_value;
        isup_cic = pinfo->circuit_id;
 
+       isup_frame_num = pinfo->fd->num;
+       
        return 0;
 }
 
@@ -738,6 +749,9 @@ mtp3_calls_packet(void *ptr _U_, packet_info *pinfo, epan_dissect_t *edt _U_, co
 
        const mtp3_tap_rec_t *pi = mtp3_info;
 
+       /* check if the upper layer is ISUP matching the frame number */
+       if (isup_frame_num != pinfo->fd->num) return 0;
+       
        /* check wether we already have a call with these parameters in the list */
        list = g_list_first(tapinfo->strinfo_list);
        while (list)