File: flow_stats.lua

package info (click to toggle)
ntopng 5.2.1%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 121,832 kB
  • sloc: javascript: 143,431; cpp: 71,175; ansic: 11,108; sh: 4,687; makefile: 911; python: 587; sql: 512; pascal: 234; perl: 118; ruby: 52; exp: 4
file content (482 lines) | stat: -rw-r--r-- 20,030 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
--
-- (C) 2013-22 - ntop.org
--

local dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path

require "lua_utils"
require "flow_utils"
require "voip_utils"

local json = require ("dkjson")

local flow_key = _GET["flow_key"]
local flow_hash_id = _GET["flow_hash_id"]

local flow = interface.findFlowByKeyAndHashId(tonumber(flow_key), tonumber(flow_hash_id))

local throughput_type = getThroughputType()

sendHTTPContentTypeHeader('text/html')

if(flow == nil) then
   print('{}')
else

   diff0 = os.time()-flow["seen.first"]
   diff = os.time()-flow["seen.last"]
   -- Default values
   thpt = 0
   thpt_display = bitsToSize(0)
   if (throughput_type == "bps") then
    thpt = 8*flow["throughput_bps"]
    thpt_display = bitsToSize(thpt)
    top_thpt_display = bitsToSize(8*flow["top_throughput_bps"])

    elseif (throughput_type == "pps") then
      thpt = flow["throughput_pps"]
      thpt_display = pktsToSize(thpt)
      top_thpt_display = pktsToSize(flow["top_throughput_pps"])
    end
    print('{ ' .. '"seen.last": "'.. formatEpoch(flow["seen.last"]) .. ' ['.. secondsToTime(diff) .. ' ago]", '
    .. '"seen.first": "'.. formatEpoch(flow["seen.first"]) .. ' ['.. secondsToTime(diff0) .. ' ago]"'
    .. ', "bytes": ' .. flow["bytes"] .. ', "goodput_bytes": ' .. flow["goodput_bytes"] .. ', "cli2srv.packets": ' .. flow["cli2srv.packets"] .. ', "srv2cli.packets": ' .. flow["srv2cli.packets"] .. ', "cli2srv.bytes": ' .. flow["cli2srv.bytes"] .. ', "srv2cli.bytes": ' .. flow["srv2cli.bytes"].. ', "throughput": "' .. thpt_display..'", "top_throughput_display": "'.. top_thpt_display ..'", "throughput_raw": ' .. thpt)

    local ifstats = interface.getStats()

    if ntop.isPro() and ifstats.inline and (flow["cli.pool_id"] ~= nil) and (flow["srv.pool_id"] ~= nil) then
      print(', "cli2srv_quota":'.. "\"")
      printFlowQuota(ifstats.id, flow, true --[[ client ]])
      print("\"" )
      print(', "srv2cli_quota":'.. "\"")
      printFlowQuota(ifstats.id, flow, false --[[ server ]])
      print("\"" )
    end

    if(flow["proto.l4"] == "TCP") then
       print(', "c2sOOO":'.. flow["cli2srv.out_of_order"] )
       print(', "c2slost":'..flow["cli2srv.lost"] )
       print(', "c2skeep_alive":'..flow["cli2srv.keep_alive"] )
       print(', "c2sretr":'..flow["cli2srv.retransmissions"] )
       print(', "s2cOOO":'.. flow["srv2cli.out_of_order"] )
       print(', "s2clost":'..flow["srv2cli.lost"] )
       print(', "s2ckeep_alive":'..flow["srv2cli.keep_alive"] )
       print(', "s2cretr":'..flow["srv2cli.retransmissions"] )
    end

    -- Processes information
    show_processes = false
    if ((flow.client_process ~= nil) or (flow.server_process ~= nil) )then show_processes= true end

    if (show_processes)then print (', "processes": {') end

    if(flow.client_process ~= nil) then

      proc = flow.client_process
      print ('"'..proc.pid..'": {')

      if((proc.actual_memory ~= nil) and (proc.actual_memory > 0) and (proc.average_cpu_load ~= nil)) then
        -- average_cpu_load
        print('"average_cpu_load": "')
	load = round(proc.average_cpu_load, 2)
        if(proc.average_cpu_load < 33) then
          if(proc.average_cpu_load == 0) then proc.average_cpu_load = "< 1" end
          print("<font color=green>"..load.." %</font>")
        elseif(proc.average_cpu_load < 66) then
          print("<font color=orange><b>"..load.." %</b></font>")
        else
          print("<font color=red><b>"..load.." %</b></font>")
        end
        print('"')
        -- memory
        print(', "memory": "'.. bytesToSize(proc.actual_memory) .. " / ".. bytesToSize(proc.peak_memory) .. " [" .. round((proc.actual_memory*100)/proc.peak_memory, 1) ..'%]"')
        -- page faults
        print(', "page_faults": ')
        if(proc.num_vm_page_faults > 0) then
          print('"<font color=red><b>'..proc.num_vm_page_faults..'</b></font>"')
        else
          print('"<font color=green><b>'..proc.num_vm_page_faults..'</b></font>"')
        end
      end

      print ('}')
    end

    if(flow.server_process ~= nil) then
      if (flow.client_process ~= nil) then print (',') end

      proc = flow.server_process
      print ('"'..proc.pid..'": {')

      if((proc.actual_memory ~= nil) and (proc.actual_memory > 0) and (proc.average_cpu_load ~= nil)) then
        -- average_cpu_load
        load = round(proc.average_cpu_load, 2)
        print('"average_cpu_load": "')
        if(proc.average_cpu_load < 33) then
          if(proc.average_cpu_load == 0) then proc.average_cpu_load = "< 1" end
          print("<font color=green>"..load.." %</font>")
        elseif(proc.average_cpu_load < 66) then
          print("<font color=orange><b>"..load.." %</b></font>")
        else
          print("<font color=red><b>"..load.." %</b></font>")
        end
        print('"')

        print(', "memory": "'.. bytesToSize(proc.actual_memory) .. " / ".. bytesToSize(proc.peak_memory) .. " [" .. round((proc.actual_memory*100)/proc.peak_memory, 1) ..'%]"')

        print(', "page_faults": ')
        if(proc.num_vm_page_faults > 0) then
          print('"<font color=red><b>'..proc.num_vm_page_faults..'</b></font>"')
        else
          print('"<font color=green><b>'..proc.num_vm_page_faults..'</b></font>"')
        end
      end

      print ('}')
    end

    if (show_processes)then print ('}') end

    if (flow["moreinfo.json"] ~= nil) then
      local info, pos, err = json.decode(flow["moreinfo.json"], 1, nil)
      sip_found = isThereProtocol("SIP", info)

      if(sip_found == 1) then
        sip_found = isThereSIPCall(info)
      end

      if(sip_found == 1) then
        local called_party = ""
        local calling_party = ""
        local sip_rtp_src_addr = 0
        local sip_rtp_dst_addr = 0
        local print_second = 0
        local print_second_2 = 0

        print(', "sip.call_id":"'..getFlowValue(info, "SIP_CALL_ID")..'"')
        called_party = getFlowValue(info, "SIP_CALLED_PARTY")
        calling_party = getFlowValue(info, "SIP_CALLING_PARTY")
        called_party = extractSIPCaller(called_party)
        calling_party = extractSIPCaller(calling_party)
        if(((called_party == nil) or (called_party == "")) and ((calling_party == nil) or (calling_party == ""))) then
          print(', "sip.calling_called_party":"'..calling_party .. ' ' .. called_party..'"')
        else
          print(', "sip.calling_called_party":"'..calling_party .. ' <i class=\\\"fas fa-exchange-alt fa-lg\\\"></i> ' .. called_party..'"')
        end

        print(', "sip.rtp_codecs":"'..getFlowValue(info, "SIP_RTP_CODECS")..'"')

        time_invite, time_epoch_invite = getFlowValue(info, "SIP_INVITE_TIME")
        time_trying, time_epoch_trying = getFlowValue(info, "SIP_TRYING_TIME")
        time_ringing, time_epoch_ringing = getFlowValue(info, "SIP_RINGING_TIME")
        time_invite_ok, time_epoch_invite_ok = getFlowValue(info, "SIP_INVITE_OK_TIME")
        time_invite_failure, time_epoch_invite_failure = getFlowValue(info, "SIP_INVITE_FAILURE_TIME")
        time_bye, time_epoch_bye = getFlowValue(info, "SIP_BYE_TIME")
        time_bye_ok, time_epoch_bye_ok = getFlowValue(info, "SIP_BYE_OK_TIME")
        time_cancel, time_epoch_cancel = getFlowValue(info, "SIP_CANCEL_TIME")
        time_cancel_ok, time_epoch_cancel_ok = getFlowValue(info, "SIP_CANCEL_OK_TIME")

        -- get delta invite
        local delta_invite = ""
        if(time_epoch_invite ~= "0") then
          if(time_epoch_ringing ~= "0") then
            if((tonumber(time_epoch_ringing) - tonumber(time_epoch_invite)) >= 0 ) then
              delta_invite = tonumber(time_epoch_ringing) - tonumber(time_epoch_invite)
              if (delta_invite == 0) then
                delta_invite = "< 1"
              end
              print_second = 1
            end
          else
            delta_invite = secondsToTime(os.time()-tonumber(time_epoch_invite))
            print_second = 0
          end
        end
        print(', "sip.time_invite":"')
        if(time_epoch_invite ~= "0") then
          print(delta_invite.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')

        local delta_trying = ""
        print_second = 0
        if(time_epoch_trying ~= "0") then
          if(time_epoch_ringing ~= "0") then
            if((tonumber(time_epoch_ringing) - tonumber(time_epoch_trying)) >= 0 ) then
              delta_trying = tonumber(time_epoch_ringing) - tonumber(time_epoch_trying)
              if (delta_trying == 0) then
                delta_trying = "< 1"
              end
              print_second = 1
            end
          else
            delta_trying = secondsToTime(os.time()-tonumber(time_epoch_trying))
            print_second = 0
          end
        end
        print(', "sip.time_trying":"')
        if(time_epoch_trying ~= "0") then
          print(delta_trying.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')

        local delta_ringing = ""
        print_second = 0
        if(time_epoch_ringing ~= "0") then
          if(time_epoch_invite_ok ~= "0") then
            if((tonumber(time_epoch_invite_ok) - tonumber(time_epoch_ringing)) >= 0 ) then
              delta_ringing = tonumber(time_epoch_invite_ok) - tonumber(time_epoch_ringing)
              if (delta_ringing == 0) then
                delta_ringing = "< 1"
              end
              print_second = 1
            end
          else
            if(time_epoch_invite_failure ~= "0") then
              if((tonumber(time_epoch_invite_failure) - tonumber(time_epoch_ringing)) >= 0 ) then
                delta_ringing = tonumber(time_epoch_invite_failure) - tonumber(time_epoch_ringing)
                if (delta_ringing == 0) then
                  delta_ringing = "< 1"
                end
                print_second = 1
              end
            else
              if(time_epoch_cancel_ok ~= "0") then
                if((tonumber(time_epoch_cancel_ok) - tonumber(time_epoch_ringing)) >= 0 ) then
                  delta_ringing = tonumber(time_epoch_cancel_ok) - tonumber(time_epoch_ringing)
                  if (delta_ringing == 0) then
                    delta_ringing = "< 1"
                  end
                  print_second = 1
                end
              else
                delta_ringing = secondsToTime(os.time()-tonumber(time_epoch_ringing))
                print_second = 0
              end
            end
          end
        end

        print(', "sip.time_ringing":"')
        if(time_epoch_ringing ~= "0") then
          print(delta_ringing.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')

        local delta_invite_ok = ""
        print_second = 0
        if(time_epoch_invite_ok ~= "0") then
          if(time_epoch_bye ~= "0") then
            if((tonumber(time_epoch_bye) - tonumber(time_epoch_invite_ok)) >= 0 ) then
              delta_invite_ok = tonumber(time_epoch_bye) - tonumber(time_epoch_invite_ok)
              if (delta_invite_ok == 0) then
                delta_invite_ok = "< 1"
              end
              print_second = 1
            end
          else
            delta_invite_ok = secondsToTime(os.time()-tonumber(time_epoch_invite_ok))
            print_second = 0
          end
        end

        print(', "sip.time_invite_ok":"')
        if(time_epoch_invite_ok ~= "0") then
          print(delta_invite_ok.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')

        local delta_invite_failure = ""
        print_second_2 = 0
        if(time_epoch_invite_failure ~= "0") then
          if(time_epoch_bye ~= "0") then
            if((tonumber(time_epoch_bye) - tonumber(time_epoch_invite_failure)) >= 0 ) then
              delta_invite_failure = tonumber(time_epoch_bye) - tonumber(time_epoch_invite_failure)
              if (delta_invite_failure == 0) then
                delta_invite_failure = "< 1"
              end
              print_second_2 = 1
            end
          else
            delta_invite_ok = secondsToTime(os.time()-tonumber(time_epoch_invite_failure))
            print_second_2 = 0
          end
        end

        print(', "sip.time_invite_failure":"')
        if(time_epoch_invite_failure ~= "0") then
          print(delta_invite_failure.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')


        local delta_bye = ""
        print_second = 0
        if(time_epoch_bye ~= "0") then
          if(time_epoch_bye_ok ~= "0") then
            if((tonumber(time_epoch_bye_ok) - tonumber(time_epoch_bye)) >= 0 ) then
              delta_bye = tonumber(time_epoch_bye_ok) - tonumber(time_epoch_bye)
              if (delta_bye == 0) then
                delta_bye = "< 1"
              end
              print_second = 1
            end
          else
            delta_bye = secondsToTime(os.time()-tonumber(time_epoch_bye_ok))
            print_second = 0
          end
        end

        print(', "sip.time_bye":"')
        if(time_epoch_bye ~= "0") then
          print(delta_bye.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')

        local delta_bye_ok = ""
        if(time_epoch_bye_ok ~= "0") then
            delta_bye_ok = secondsToTime(os.time()-tonumber(time_epoch_bye_ok))
        end

        print(', "sip.time_bye_ok":"')
        if(time_epoch_bye_ok ~= "0") then
          print(delta_bye_ok.."")
        end
        print('"')

        local delta_cancel = ""
        print_second = 0
        if(time_epoch_cancel ~= "0") then
          if(time_epoch_cancel_ok ~= "0") then
            if((tonumber(time_epoch_cancel_ok) - tonumber(time_epoch_cancel)) >= 0 ) then
              delta_cancel = tonumber(time_epoch_cancel_ok) - tonumber(time_epoch_cancel)
              if (delta_cancel == 0) then
                delta_cancel = "< 1"
              end
              print_second = 1
            end
          else
            delta_cancel = secondsToTime(os.time()-tonumber(time_epoch_cancel_ok))
            print_second = 0
          end
        end

        print(', "sip.time_cancel":"')
        if(time_epoch_cancel ~= "0") then
          print(delta_cancel.."")
          if (print_second == 1) then print(' sec') end
        end
        print('"')


        local delta_cancel_ok = ""
        if(time_epoch_cancel_ok ~= "0") then
            delta_cancel_ok = secondsToTime(os.time()-tonumber(time_epoch_cancel_ok))
        end

        print(', "sip.time_cancel_ok":"')
        if(time_epoch_cancel_ok ~= "0") then
          print(delta_cancel_ok.."")
        end
        print('"')

        print(', "sip.rtp_stream":"');
        if((getFlowValue(info, "SIP_RTP_IPV4_SRC_ADDR")~=nil) and (getFlowValue(info, "SIP_RTP_IPV4_SRC_ADDR")~="")) then
          sip_rtp_src_addr = 1
          local address_ip = getFlowValue(info, "SIP_RTP_IPV4_SRC_ADDR")
          if (address_ip ~= "0.0.0.0") then
            interface.select(ifname)
            rtp_host = interface.getHostInfo(address_ip)
            if(rtp_host ~= nil) then
              print(hostinfo2detailshref(rtp_host, nil, address_ip))
            end
          else
            print(address_ip)
          end
        end
        if((getFlowValue(info, "SIP_RTP_L4_SRC_PORT")~=nil) and (getFlowValue(info, "SIP_RTP_L4_SRC_PORT")~="") and (sip_rtp_src_addr == 1)) then
          --print(':'..getFlowValue(info, "SIP_RTP_L4_SRC_PORT"))
          print(':<A HREF=\\\"'..ntop.getHttpPrefix()..'/lua/flows_stats.lua?port='..getFlowValue(info, "SIP_RTP_L4_SRC_PORT").. '\\\">')
          print(getFlowValue(info, "SIP_RTP_L4_SRC_PORT"))
          print('</A>')
        end
        if((sip_rtp_src_addr == 1) or ((getFlowValue(info, "SIP_RTP_IPV4_DST_ADDR")~=nil) and (getFlowValue(info, "SIP_RTP_IPV4_DST_ADDR")~=""))) then
          print(' <i class=\\\"fas fa-exchange-alt fa-lg\\\"></i> ')
        end
        if((getFlowValue(info, "SIP_RTP_IPV4_DST_ADDR")~=nil) and (getFlowValue(info, "SIP_RTP_IPV4_DST_ADDR")~="")) then
          sip_rtp_dst_addr = 1
          local address_ip = getFlowValue(info, "SIP_RTP_IPV4_DST_ADDR")

	  if (address_ip ~= "0.0.0.0") then
            interface.select(ifname)
	    
            rtp_host = interface.getHostInfo(address_ip)
	    
            if(rtp_host ~= nil) then
	      print(hostinfo2detailshref(rtp_host, nil, address_ip))
            end
          else
            print(address_ip)
          end
        end
        if((getFlowValue(info, "SIP_RTP_L4_DST_PORT")~=nil) and (getFlowValue(info, "SIP_RTP_L4_DST_PORT")~="") and (sip_rtp_dst_addr == 1)) then
          --print(':'..getFlowValue(info, "SIP_RTP_L4_DST_PORT"))
          print(':<A HREF=\\\"'..ntop.getHttpPrefix()..'/lua/flows_stats.lua?port='..getFlowValue(info, "SIP_RTP_L4_DST_PORT").. '\\\">')
          print(getFlowValue(info, "SIP_RTP_L4_DST_PORT"))
          print('</A>')
        end
        print('"');

        fail_resp_code_string = getFlowValue(info, "SIP_RESPONSE_CODE")
        fail_resp_code_string = map_failure_resp_code(fail_resp_code_string)
        print(', "sip.response_code":"'..fail_resp_code_string..'"')
        val, val_original = getFlowValue(info, "SIP_REASON_CAUSE")
        if(val_original ~= "0") then
          print(', "sip.reason_cause":"'..val..'"')
        else
          print(', "sip.reason_cause":""')
        end
        print(', "sip.c_ip":"'..getFlowValue(info, "SIP_C_IP")..'"')
        print(', "sip.call_state":"'..getFlowValue(info, "SIP_CALL_STATE")..'"')
      end

      rtp_found = isThereProtocol("RTP", info)
      if(rtp_found == 1) then
        print(', "rtp.sync_source_id":"'..getFlowValue(info, "RTP_SSRC")..'"')
        --print(', "rtp.first_flow_timestamp":"'..getFlowValue(info, "RTP_FIRST_TS")..'"' )
        --print(', "rtp.last_flow_timestamp":"'..getFlowValue(info, "RTP_LAST_TS")..'"' )
        print(', "rtp.first_flow_sequence":"'..getFlowValue(info, "RTP_FIRST_SEQ")..'"' )
        print(', "rtp.last_flow_sequence":"'..getFlowValue(info, "RTP_LAST_SEQ")..'"' )
        print(', "rtp.jitter_in":"'..getFlowValue(info, "RTP_IN_JITTER")..'"' )
        print(', "rtp.jitter_out":"'..getFlowValue(info, "RTP_OUT_JITTER")..'"' )
        print(', "rtp.packet_lost_in":"'..getFlowValue(info, "RTP_IN_PKT_LOST")..'"' )
        print(', "rtp.packet_lost_out":"'..getFlowValue(info, "RTP_OUT_PKT_LOST")..'"' )
        print(', "rtp.packet_drop_in":"'..getFlowValue(info, "RTP_IN_PKT_DROP")..'"' )
        print(', "rtp.packet_drop_out":"'..getFlowValue(info, "RTP_OUT_PKT_DROP")..'"' )
	print(', "rtp.payload_type_in":"'..formatRtpPayloadType(getFlowValue(info, "RTP_IN_PAYLOAD_TYPE"))..'"' )
        print(', "rtp.payload_type_out":"'..formatRtpPayloadType(getFlowValue(info, "RTP_OUT_PAYLOAD_TYPE"))..'"' )
        print(', "rtp.max_delta_time_in":"'..getFlowValue(info, "RTP_IN_MAX_DELTA")..'"' )
        print(', "rtp.max_delta_time_out":"'..getFlowValue(info, "RTP_OUT_MAX_DELTA")..'"' )
        print(', "rtp.rtp_sip_call_id":"'..getFlowValue(info, "RTP_SIP_CALL_ID")..'"' )
        print(', "rtp.mos_average":"'..getFlowValue(info, "RTP_MOS")..'"' )
        print(', "rtp.r_factor_average":"'..getFlowValue(info, "RTP_R_FACTOR")..'"' )
        print(', "rtp.mos_in":"'..getFlowValue(info, "RTP_IN_MOS")..'"' )
        print(', "rtp.r_factor_in":"'..getFlowValue(info, "RTP_IN_R_FACTOR")..'"' )
        print(', "rtp.mos_out":"'..getFlowValue(info, "RTP_OUT_MOS")..'"' )
        print(', "rtp.r_factor_out":"'..getFlowValue(info, "RTP_OUT_R_FACTOR")..'"' )
        print(', "rtp.rtp_transit_in":"'..getFlowValue(info, "RTP_IN_TRANSIT")..'"' )
        print(', "rtp.rtp_transit_in":"'..getFlowValue(info, "RTP_OUT_TRANSIT")..'"' )
        print(', "rtp.rtp_rtt":"'..getFlowValue(info, "RTP_RTT")..'"' )
        print(', "rtp.dtmf_tones":"'..getFlowValue(info, "RTP_DTMF_TONES")..'"' )
      end
  end

  print (' }\n')
end