{{tag>Troubleshooting SIP_Trace Advanced_Tasks Asterisk FreeSWITCH PBX}} ====== SIP Traces ====== If you manage your own phone system (PBX) in your network, you will be asked to provide a //SIP trace// to SureVoIP Support to help troubleshoot call set up or call quality issues. ====== Asterisk and FreeSWITCH ====== ===== SIP trace for signalling only ===== As Asterisk and FreeSWITCH systems generally run on Linux it is very straight-forward to gather a SIP trace. You will need: * root access * **tcpdump** to be installed To gather a SIP trace with signalling only, run: tcpdump -nnp -w siptrace.pcap -i any -s 0 port 5060 This captures only port 5060, which is the default SIP port. Change this if your system uses a different port. The file will be called siptrace.pcap and will be saved in your current directory. Press //Ctrl+C// to stop the trace once you have made your test call and send the file to SureVoIP Support. ===== SIP trace including media ===== If you are troubleshooting voice quality you may be asked to provide a call trace including RTP. You will need: * root access * **tcpdump** to be installed * you will need to know the RTP ports used by your system * Asterisk default is ports 10000-20000 * FreeSWITCH default is ports 10000-40000 To capture SIP and RTP for //Asterisk// using the default ports run: tcpdump -nnp -w test.pcap -i any -s 0 port 5060 or portrange 10000-20000 or to capture SIP and RTP for //FreeSWITCH// using the default ports run: tcpdump -nnp -w test.pcap -i any -s 0 port 5060 or portrange 10000-40000 Make your test call and when finished press //Ctrl+C// to end the capture and then send the file to SureVoIP Support. ===== 3CX Phone System ===== Please see [[https://www.3cx.com/docs/capture-network-traffic/|3CX SIP Trace guide]] (external page). ====== Other Phone Systems ====== All reputable phone systems will have a method to acquire SIP traces for troubleshooting purposes. Please consult your vendor's documentation or consult with a qualified professional to assist. * [[https://supportforums.cisco.com/document/44376/packet-capture-cucm-appliance-model|Cisco - Packet Capture on CUCM Appliance Model]] ===== Windows-based Phone Sytems ===== For PBX software running on Microsoft Windows, we suggest using [[http://www.wireshark.org|Wireshark]] to obtain SIP traces. ===== Handsets ===== There may be times when a SIP trace from a handset is required. * [[howtos:setup:yealink#call_trace|Yealink]] * [[http://www.cisco.com/c/en/us/support/docs/unified-communications/spa2102-phone-adapter-router/108784-pqa-108784.html|Cisco SPA500 and SPA300 Series]] (external link) * [[http://wiki.snom.com/Category:HowTo:PCAP_Trace|Snom]] (external link) ====== Other Useful Information ====== There are several tools you can use to obtain SIP traces, such as: * [[https://github.com/irontec/sngrep/wiki|sngrep]] (widely available for all Linux distributions) * [[http://www.tcpdump.org/|tcpdump]] (widely available for all Linux distributions) * [[http://ngrep.sourceforge.net/|ngrep]] * [[http://pcapsipdump.sourceforge.net/|pcapsipdump]] * [[http://www.wireshark.org|Wireshark]] * [[http://www.draytek.co.uk/support/guides/kb-port-mirror|DrayTek Router port mirroring]] (external link; login required)