sipcapture / heplify

Portable and Lightweight HEP Capture Agent for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
185 stars 65 forks source link

use un-quoted payload when logging into files #153

Closed sincejune closed 4 years ago

sincejune commented 4 years ago

Use better format when logging into files.(removed quote() function)

Example log in file:

2020-02-06T16:49:23Z INFO HEP packet:{Version:2,Protocol:17,SrcIP:35.233.182.194,DstIP:172.31.29.80,SrcPort:15060,DstPort:5060,Tsec:1581007763,Tmsec:460673,ProtoType:1,NodeID:2002
,NodePW:,CID:,Vlan:0} with Payload:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 3.113.15.75:5060;branch=z9hG4bKd629.6e427557.0
From: <sip:dispatcher@localhost>;tag=3fb2ef1b2852ede23a85635eb60d3af5-274f
To: <sip:freeswitch.dashbase.io:15060>;tag=D92HjmNaDee3c
Call-ID: 542c228538fc618d-25732@0.0.0.0
CSeq: 14 OPTIONS
Contact: <sip:35.233.182.194:15060>
User-Agent: FreeSWITCH-mod_sofia/1.10.2-release-13-f7bdd3845a~64bit
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Length: 0

Example log in syslog:

2020-02-06T16:51:50.511688+00:00 ip-172-31-29-80 ./heplify[23816]: file.go:20: HEP packet:{Version:2,Protocol:17,SrcIP:35.233.182.194,DstIP:172.31.29.80,SrcPort:15060,DstPort:5060,Tsec:1581007909,Tmsec:489384,ProtoType:1,NodeID:2002,NodePW:,CID:,Vlan:0} with Payload:#012SIP/2.0 407 Proxy Authentication Required#015#012Via: SIP/2.0/UDP 3.113.15.75:5060;branch=z9hG4bK2f38.45e3a537.0#015#012Via: SIP/2.0/UDP 185.53.88.29:49432;branch=z9hG4bK49679476#015#012From: <sip:105@3.113.15.75>;tag=1425735984#015#012To: <sip:300972599924215@3.113.15.75>;tag=3jaZ3cSar9j1K#015#012Call-ID: 1265477378-112730891-1965850099#015#012CSeq: 1 INVITE#015#012User-Agent: FreeSWITCH-mod_sofia/1.10.2-release-13-f7bdd3845a~64bit#015#012Accept: application/sdp#015#012Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE#015#012Supported: timer, path, replaces#015#012Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer#015#012Proxy-Authenticate: Digest realm="3.113.15.75", nonce="52103d4f-9154-41c9-a479-0bce21c2af43", algorithm=MD5, qop="auth"#015#012Content-Length: 0
claassistantio commented 4 years ago

CLA assistant check
All committers have signed the CLA.

negbie commented 4 years ago

Thank you @sincejune !

sincejune commented 4 years ago

Thanks @negbie It would be helpful when debugging. And what's the release plan for this project? Could we make a release for latest changes?

negbie commented 4 years ago

Your welcome. Give me some hours but it will be today.

negbie commented 4 years ago

@sincejune please check latest release https://github.com/sipcapture/heplify/releases

sincejune commented 4 years ago

Thanks @negbie , will take a try tomorrow.

sincejune commented 4 years ago

It's awesome! Thanks @negbie !

negbie commented 4 years ago

your welcome @sincejune and thank you for the contribution!