Debugging and, or Investigation of messages

From Yate Documentation
(Difference between revisions)
Jump to: navigation, search
(Enable / Disable sniffer in telnet)
(Apply filter messages with sniffer)
 
(9 intermediate revisions by one user not shown)
Line 34: Line 34:
  
 
  telnet 0 5038
 
  telnet 0 5038
 +
debug on
 +
color on
 
  sniffer on
 
  sniffer on
 
and disabled with:
 
and disabled with:
Line 56: Line 58:
 
=== Apply filter messages with sniffer===
 
=== Apply filter messages with sniffer===
  
* Apply filter by specifying regex to match in telnet:
+
* Apply filter by specifying regex to match in telnet. Various examples:
  
 
  sniffer filter ^\(chan\.\|engine\.halt$\)
 
  sniffer filter ^\(chan\.\|engine\.halt$\)
 +
 +
sniffer on filter chan.control\|gtp.*
 +
 +
sniffer on filter call.execute
 +
 +
* you can also add extra filters on message params
 +
 +
sniffer on params operation=add_campaign\|get_campaign
 +
 +
* you can combine filter on message name and specific param_name = param_value
 +
 +
sniffer on filter api.request
 +
sniffer on params operation=add_campaign\|get_campaign
 +
 +
>> Message sniffer: on, timer: off, filter: api.request, params: operation=add_campaign\|get_campaign
 +
 +
* sniff messages older than 5 seconds
 +
 +
sniffer on age 5
  
 
* or in yate.conf:
 
* or in yate.conf:
Line 195: Line 216:
 
* [[Configuration Files]]
 
* [[Configuration Files]]
 
* [[Debug Output]]
 
* [[Debug Output]]
 +
 +
[[Category:Sniffer]] [[Category:MsgSniff]] [[Category:Machine]] [[Category:Telnet]] [[Category:Rmanager]] [[Category:Messages]] [[Category:Message investigation]] [[Category:Test module]] [[Category:Programmers]]

Latest revision as of 15:07, 18 August 2022

The module msgsniff is for you to probe all the messages being generated and, or received by Yate.

This module should be used on development systems only and should be disable on production systems.

The loading of msgsniff.yate is controlled by yate.conf like any other module.

The initial activation is controlled by msgsniff in [general] of same yate.conf file. The default status is off as it would flood the logs and hit the performance.

Contents

[edit] Enable msgsniff in Yate's main configuration file

The sniffer will dump the Yate messages to output or log file.

All Yate's messages will be seen and their parameters.

  • It can be enabled in yate.conf:
[general]
msgsniff=yes
modload=no
;Don't forget to load the sniffer module if modload parameter value is 'no'.

[modules]
;for debugging yate
rmanager.yate=yes
msgsniff.yate=yes

After enable the sniffer, start Yate with logging:

./run -vvvvv -l yate.log

[edit] Enable / Disable sniffer in telnet

The module must be loaded so that you can use this commands from telnet:

telnet 0 5038
debug on
color on
sniffer on

and disabled with:

sniffer off

Sniffer on will dump the message and his parameters, each on a separated line.

With sniffer the messages will be seen twice:

- once when they are emitted
- once when they are handled (or not)

If you need the output to be parsed by a machine you can use in telnet:

machine on 

This will dump the messages and their parameters in a single line using ':' as a separator.

To disable it:

machine off

[edit] Apply filter messages with sniffer

  • Apply filter by specifying regex to match in telnet. Various examples:
sniffer filter ^\(chan\.\|engine\.halt$\)
sniffer on filter chan.control\|gtp.*
sniffer on filter call.execute
  • you can also add extra filters on message params
sniffer on params operation=add_campaign\|get_campaign
  • you can combine filter on message name and specific param_name = param_value
sniffer on filter api.request
sniffer on params operation=add_campaign\|get_campaign
>> Message sniffer: on, timer: off, filter: api.request, params: operation=add_campaign\|get_campaign
  • sniff messages older than 5 seconds
sniffer on age 5
  • or in yate.conf:
[default]
; filtersniff: regexp: Default filter to apply to message sniffer at initialization
; If empty it will match all messages except engine.timer which is never displayed
; Example for a filter matching all chan.Anything messages and engine.halt:
filtersniff=^\(chan\.\|engine\.halt$\)

[edit] Example

  • Sniffer output example:
telnet 0 5038
Trying 0.0.0.0...
Connected to 0 (0.0.0.0).
Escape character is '^]'.
YATE 4.2.1-alpha1 (http://YATE.null.ro) ready on localhost.localdomain.
debug on
Debug level: 8 local: on threshold: 10
color on
Colorized output: yes
sniffer on
Returned true 'engine.command' delay=0.000024
  thread=0x9f9cc4c 'RManager Connection'
  data=(nil)
  retval='Message sniffer is on
'
  param['line'] = 'sniffer on'
Message sniffer is on
................................................

Sniffed 'call.route' time=1365692292.996772                                                                                                                          
 thread=0x9fb5450 'Call Router'                                                                                                                                     
 data=(nil)                                                                                                                                                         
 retval='(null)'                                                                                                                                                    
 param['id'] = 'sip/1'                                                                                                                                              
 param['module'] = 'sip'                                                                                                                                            
 param['status'] = 'incoming'                                                                                                                                       
 param['address'] = '192.168.168.185:62825'                                                                                                                         
 param['billid'] = '1365691777-1'                                                                                                                                   
 param['answered'] = 'false'                                                                                                                                        
 param['direction'] = 'incoming'                                                                                                                                    
 param['callid'] = 'sip/1096570971@192.168.168.156:5061/1476622558/'                                                                                                
 param['caller'] = '777'                                                                                                                                            
 param['called'] = '602'                                                                                                                                            
 param['antiloop'] = '19'                                                                                                                                           
 param['ip_host'] = '192.168.168.185'                                                                                                                               
 param['ip_port'] = '62825'                                                                                                                                         
 param['ip_transport'] = 'TLS'                                                                                                                                      
 param['sip_uri'] = 'sip:602@192.168.168.156:5061'                                                                                                                  
 param['sip_from'] = 'sip:777@192.168.168.156:5061'                                                                                                                 
 param['sip_to'] = '<sip:602@192.168.168.156:5061>'                                                                                                                 
 param['sip_callid'] = '1096570971@192.168.168.156:5061'                                                                                                            
 param['device'] = 'YATE/4.3.0'                                                                                                                                     
 param['sip_user-agent'] = 'YATE/4.3.0'                                                                                                                             
 param['sip_contact'] = '<sip:777@192.168.168.185:62825>'                                                                                                           
 param['sip_allow'] = 'ACK, INVITE, BYE, CANCEL, OPTIONS, INFO'                                                                                                     
 param['sip_content-type'] = 'application/sdp'                                                                                                                      
 param['rtp_addr'] = '192.168.168.185'                                                                                                                              
 param['media'] = 'yes'                                                                                                                                             
 param['formats'] = 'mulaw,alaw,slin,ilbc20,ilbc30,isac/16000,isac/32000'                                                                                           
 param['transport'] = 'RTP/AVP'                                                                                                                                     
 param['rtp_mapping'] = 'ilbc30=97'                                                                                                                                 
 param['rtp_rfc2833'] = '101'                                                                                                                                       
 param['rtp_port'] = '17666'                                                                                                                                        
 param['rtp_forward'] = 'possible'                                                                                                                                  
 param['handlers'] = 'javascript:15,regexroute:100'                                                                                                                 
Returned false 'call.route' delay=0.012136                                                                                                                           
 thread=0x9fb5450 'Call Router'                                                                                                                                     
 data=(nil)                                                                                                                                                         
 retval='(null)'                                                                                                                                                    
 param['id'] = 'sip/1'                                                                                                                                              
 param['module'] = 'sip'                                                                                                                                            
 param['status'] = 'incoming'                                                                                                                                       
 param['address'] = '192.168.168.185:62825'                                                                                                                         
 param['billid'] = '1365691777-1'                                                                                                                                   
 param['answered'] = 'false'                                                                                                                                        
 param['direction'] = 'incoming'                                                                                                                                    
 param['callid'] = 'sip/1096570971@192.168.168.156:5061/1476622558/'                                                                                                
 param['caller'] = '777'                                                                                                                                            
 param['called'] = '602'                                                                                                                                            
 param['antiloop'] = '19'                                                                                                                                           
 param['ip_host'] = '192.168.168.185'                                                                                                                               
 param['ip_port'] = '62825'                                                                                                                                         
 param['ip_transport'] = 'TLS'                                                                                                                                      
 param['sip_uri'] = 'sip:602@192.168.168.156:5061'                                                                                                                  
 param['sip_from'] = 'sip:777@192.168.168.156:5061'                                                                                                                 
 param['sip_to'] = '<sip:602@192.168.168.156:5061>'                                                                                                                 
 param['sip_callid'] = '1096570971@192.168.168.156:5061'                                                                                                            
 param['device'] = 'YATE/4.3.0'                                                                                                                                     
 param['sip_user-agent'] = 'YATE/4.3.0'                                                                                                                             
 param['sip_contact'] = '<sip:777@192.168.168.185:62825>'                                                                                                           
 param['sip_allow'] = 'ACK, INVITE, BYE, CANCEL, OPTIONS, INFO'                                                                                                     
 param['sip_content-type'] = 'application/sdp'                                                                                                                      
 param['rtp_addr'] = '192.168.168.185'                                                                                                                              
 param['media'] = 'yes'                                                                                                                                             
 param['formats'] = 'mulaw,alaw,slin,ilbc20,ilbc30,isac/16000,isac/32000'                                                                                           
 param['transport'] = 'RTP/AVP'                                                                                                                                     
 param['rtp_mapping'] = 'ilbc30=97'                                                                                                                                 
 param['rtp_rfc2833'] = '101'                                                                                                                                       
 param['rtp_port'] = '17666'                                                                                                                                        
 param['rtp_forward'] = 'possible'                                                                                                                                  
 param['handlers'] = 'javascript:15,regexroute:100,javascript:15,cdrbuild:50,iax:100,h323:100,jingle:100,regexroute:100,sip:100,regfile:100,analog:100,sig:100'
                                   
..........................................

sniffer off
Message sniffer is off

Watch parameter 'handlers' to see which modules saw this message and who handled it.

  • Machine output example:
machine on
Machine mode: on
%%<message::false:engine.timer::time=1365692006:nodename=localhost.localdomain:handlers=jbfeatures%z90,jabber%z90,ciscosm%z90,subscription%z90,pgsqldb%z90,
mgcpca%z90,sigtransport%z90,analogdetect%z90,mysqldb%z90,socks%z90,openssl%z90,zlibcompress%z90,mux%z90,javascript%z90,tonedetect%z90,
wave%z90,iax%z90,h323%z90,pbx%z90,yrtp%z90,jingle%z90,enumroute%z90,conf%z90,callfork%z90,tone%z90,sip%z90,analyzer%z90,stun%z90,
gvoice%z90,dumb%z90,sipfeatures%z90,mgcpgw%z90,queues%z90,users%z90,mrcp%z90,park%z90,presence%z90,monitoring%z90,analog%z90,
queuesnotify%z90,register%z90,sig%z90,filetransfer%z90,snmpagent%z90,regfile%z100 ........................... %%<message::false:call.route::id=sip/2:module=sip:status=incoming:address=192.168.168.185%z62825:billid=1365691777-2:answered=false: direction=incoming:callid=sip/636679705@192.168.168.156%z5061/511103288/:caller=777:called=602:antiloop=19:ip_host=192.168.168.185: ip_port=62825:ip_transport=TLS:sip_uri=sip%z602@192.168.168.156%z5061:sip_from=sip%z777@192.168.168.156%z5061: sip_to=<sip%z602@192.168.168.156%z5061>:sip_callid=636679705@192.168.168.156%z5061:device=YATE/4.3.0: sip_user-agent=YATE/4.3.0:sip_contact=<sip%z777@192.168.168.185%z62825>: sip_allow=ACK, INVITE, BYE, CANCEL, OPTIONS, INFO:sip_content-type=application/sdp:rtp_addr=192.168.168.185: media=yes:formats=mulaw,alaw,slin,ilbc20,ilbc30,isac/16000,isac/32000:transport=RTP/AVP:rtp_mapping=ilbc30=97: rtp_rfc2833=101:rtp_port=29814:rtp_forward=possible:handlers=javascript%z15,regexroute%z100,javascript%z15,cdrbuild%z50, ............................................... machine off Machine mode: off


See also

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers