Beautify SIP logs

94 views
Skip to first unread message

Mihai Costache

unread,
Dec 8, 2016, 6:39:16 AM12/8/16
to sipxco...@googlegroups.com
Hi community,

Probably you all know about the syslogviewer tool used to beautify logs on you sipxcom machines.
I've created a small tool that will allow you to do the same with logs from snapshots (if log verbosity was at least INFO)

Check it out here:

https://github.com/Mihai-CMM/beautify_sipxcom_proxy_logs



Transforms this :

2016-12-08T11:37:42.437378Z":309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:"Read SIP message:\n----Local Host:10.3.0.150---- Port: 5060----\n----Remote Host:10.3.0.51---- Port: 37823----\nINVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0\r\nVia: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0\r\nFrom: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968\r\nTo: <sip:10...@mihai.test;user=phone>\r\nCSeq: 1 INVITE\r\nCall-ID: 9ef958b7-fccf...@10.3.0.51\r\nContact: <sip:20...@10.3.0.51:5060;transport=tcp>\r\nAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER\r\nUser-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509\r\nAccept-Language: en\r\nSupported: 100rel,replaces\r\nAllow-Events: conference,talk,hold\r\nMax-Forwards: 70\r\nContent-Type: application/sdp\r\nContent-Length: 288\r\n\r\nv=0\r\no=- 1481197061 1481197061 IN IP4 10.3.0.51\r\ns=Polycom IP Phone\r\nc=IN IP4 10.3.0.51\r\nt=0 0\r\na=sendrecv\r\nm=audio 2224 RTP/AVP 9 0 8 18 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:18 G729/8000\r\na=fmtp:18 annexb=no\r\na=rtpmap:101 telephone-event/8000\r\n====================END====================\n"

Into this:

2016-12-08T11:37:42.437378Z:309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:Read SIP message:
----Local Host:10.3.0.150---- Port: 5060----
----Remote Host:10.3.0.51---- Port: 37823----
INVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0
From: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968
To: <sip:10...@mihai.test;user=phone>
CSeq: 1 INVITE
Call-ID: 9ef958b7-fccf...@10.3.0.51
Contact: <sip:20...@10.3.0.51:5060;transport=tcp>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 288

v=0
o=- 1481197061 1481197061 IN IP4 10.3.0.51
s=Polycom IP Phone
c=IN IP4 10.3.0.51
t=0 0

 
Best Regards,
Mihai Costache

"No problem can withstand the assault of sustained thinking. "

                                -  Voltaire


Michael Picher

unread,
Dec 8, 2016, 7:54:58 AM12/8/16
to Mihai Costache, sipxco...@googlegroups.com
Nice Mihai!


Michael Picher, VP of Product Innovation
eZuce, Inc.

300 Brickstone Square

Suite 104

Andover, MA. 01810


Notice: This transmittal and/or attachments may be privileged or confidential. It is intended solely for the addressee(s) named above. Any dissemination, or copying is strictly prohibited. If you received this transmittal in error, please notify us immediately by reply and immediately delete this message and all its attachments. Thank you. FMS

On Thu, Dec 8, 2016 at 6:39 AM, Mihai Costache <mihai.c...@ezuce.com> wrote:
Hi community,

Probably you all know about the syslogviewer tool used to beautify logs on you sipxcom machines.
I've created a small tool that will allow you to do the same with logs from snapshots (if log verbosity was at least INFO)

Check it out here:

https://github.com/Mihai-CMM/beautify_sipxcom_proxy_logs



Transforms this :

2016-12-08T11:37:42.437378Z":309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:"Read SIP message:\n----Local Host:10.3.0.150---- Port: 5060----\n----Remote Host:10.3.0.51---- Port: 37823----\nINVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0\r\nVia: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0\r\nFrom: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968\r\nTo: <sip:10...@mihai.test;user=phone>\r\nCSeq: 1 INVITE\r\nCall-ID: 9ef958b7-fccf7c58-53e117bf@10.3.0.51\r\nContact: <sip:20...@10.3.0.51:5060;transport=tcp>\r\nAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER\r\nUser-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509\r\nAccept-Language: en\r\nSupported: 100rel,replaces\r\nAllow-Events: conference,talk,hold\r\nMax-Forwards: 70\r\nContent-Type: application/sdp\r\nContent-Length: 288\r\n\r\nv=0\r\no=- 1481197061 1481197061 IN IP4 10.3.0.51\r\ns=Polycom IP Phone\r\nc=IN IP4 10.3.0.51\r\nt=0 0\r\na=sendrecv\r\nm=audio 2224 RTP/AVP 9 0 8 18 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:18 G729/8000\r\na=fmtp:18 annexb=no\r\na=rtpmap:101 telephone-event/8000\r\n====================END====================\n"

Into this:

2016-12-08T11:37:42.437378Z:309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:Read SIP message:
----Local Host:10.3.0.150---- Port: 5060----
----Remote Host:10.3.0.51---- Port: 37823----
INVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0
Via: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0
From: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968
To: <sip:10...@mihai.test;user=phone>
CSeq: 1 INVITE

Contact: <sip:20...@10.3.0.51:5060;transport=tcp>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 288

v=0
o=- 1481197061 1481197061 IN IP4 10.3.0.51
s=Polycom IP Phone
c=IN IP4 10.3.0.51
t=0 0

 
Best Regards,
Mihai Costache

"No problem can withstand the assault of sustained thinking. "

                                -  Voltaire


--
You received this message because you are subscribed to the Google Groups "sipxcom-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sipxcom-users+unsubscribe@googlegroups.com.
To post to this group, send email to sipxco...@googlegroups.com.
Visit this group at https://groups.google.com/group/sipxcom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/sipxcom-users/CA%2Bpyz5pvXviW%2BAWbYjRqi5j4LGH2P3P56yewx_0G5bBF%3Dri8oQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Olivier Gauthier

unread,
Dec 8, 2016, 8:15:35 AM12/8/16
to Michael Picher, Mihai Costache, sipxco...@googlegroups.com
Nice script indeed,
Is there a way to pipe this with tail and see sipxproxy log been
parsed interactively?
I often resort on using "tcpdump -n -A -s 0 -i eth0 port 5060 or port
5080" to interactively see SIP messages been exchanged by sipxproxy
and sipxbridge.

Olivier
>> 9ef958b7-fccf...@10.3.0.51\r\nContact:
>> <sip:20...@10.3.0.51:5060;transport=tcp>\r\nAllow: INVITE, ACK, BYE, CANCEL,
>> OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE,
>> REFER\r\nUser-Agent:
>> PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509\r\nAccept-Language:
>> en\r\nSupported: 100rel,replaces\r\nAllow-Events:
>> conference,talk,hold\r\nMax-Forwards: 70\r\nContent-Type:
>> application/sdp\r\nContent-Length: 288\r\n\r\nv=0\r\no=- 1481197061
>> 1481197061 IN IP4 10.3.0.51\r\ns=Polycom IP Phone\r\nc=IN IP4
>> 10.3.0.51\r\nt=0 0\r\na=sendrecv\r\nm=audio 2224 RTP/AVP 9 0 8 18
>> 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8
>> PCMA/8000\r\na=rtpmap:18 G729/8000\r\na=fmtp:18 annexb=no\r\na=rtpmap:101
>> telephone-event/8000\r\n====================END====================\n"
>>
>> Into this:
>>
>>
>> 2016-12-08T11:37:42.437378Z:309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:Read
>> SIP message:
>> ----Local Host:10.3.0.150---- Port: 5060----
>> ----Remote Host:10.3.0.51---- Port: 37823----
>> INVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0
>> Via: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0
>> From: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968
>> To: <sip:10...@mihai.test;user=phone>
>> CSeq: 1 INVITE
>> Call-ID: 9ef958b7-fccf...@10.3.0.51
>> Contact: <sip:20...@10.3.0.51:5060;transport=tcp>
>> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE,
>> NOTIFY, PRACK, UPDATE, REFER
>> User-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509
>> Accept-Language: en
>> Supported: 100rel,replaces
>> Allow-Events: conference,talk,hold
>> Max-Forwards: 70
>> Content-Type: application/sdp
>> Content-Length: 288
>>
>> v=0
>> o=- 1481197061 1481197061 IN IP4 10.3.0.51
>> s=Polycom IP Phone
>> c=IN IP4 10.3.0.51
>> t=0 0
>>
>>
>> Best Regards,
>> Mihai Costache
>>
>> "No problem can withstand the assault of sustained thinking. "
>>
>> - Voltaire
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sipxcom-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sipxcom-user...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "sipxcom-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sipxcom-user...@googlegroups.com.
> To post to this group, send email to sipxco...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sipxcom-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sipxcom-users/CAAHujP6YoU1x-Kfxq9oAjDK67HwY3xFAAe_BLbcMGo8WgKNWAw%40mail.gmail.com.

Mihai Costache

unread,
Dec 8, 2016, 8:25:35 AM12/8/16
to Olivier Gauthier, Michael Picher, sipxco...@googlegroups.com
Olivier,
On the live machine you can use

tailf /var/log/sipxpbx/sipXproxy.log | syslogviewer

directly.


My tool was done to pretty logs collected, that you are looking offline at them from a snapshot

Thanks!
 

Best Regards,
Mihai Costache

"No problem can withstand the assault of sustained thinking. "

                                -  Voltaire




>> <sip:20...@10.3.0.51:5060;transport=tcp>\r\nAllow: INVITE, ACK, BYE, CANCEL,
>> OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE,
>> REFER\r\nUser-Agent:
>> PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509\r\nAccept-Language:
>> en\r\nSupported: 100rel,replaces\r\nAllow-Events:
>> conference,talk,hold\r\nMax-Forwards: 70\r\nContent-Type:
>> application/sdp\r\nContent-Length: 288\r\n\r\nv=0\r\no=- 1481197061
>> 1481197061 IN IP4 10.3.0.51\r\ns=Polycom IP Phone\r\nc=IN IP4
>> 10.3.0.51\r\nt=0 0\r\na=sendrecv\r\nm=audio 2224 RTP/AVP 9 0 8 18
>> 101\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8
>> PCMA/8000\r\na=rtpmap:18 G729/8000\r\na=fmtp:18 annexb=no\r\na=rtpmap:101
>> telephone-event/8000\r\n====================END====================\n"
>>
>> Into this:
>>
>>
>> 2016-12-08T11:37:42.437378Z:309250:INCOMING:INFO:uc1.mihai.test:SipClientTcp-860:7f3bd3d4d700:sipxproxy:Read
>> SIP message:
>> ----Local Host:10.3.0.150---- Port: 5060----
>> ----Remote Host:10.3.0.51---- Port: 37823----
>> INVITE sip:10...@mihai.test;user=phone;transport=tcp SIP/2.0
>> Via: SIP/2.0/TCP 10.3.0.51:5060;branch=z9hG4bKc3ee832fF3AD95A0
>> From: \"testare\" <sip:20...@mihai.test>;tag=76584F27-DB0F1968
>> To: <sip:10...@mihai.test;user=phone>
>> CSeq: 1 INVITE

>> Contact: <sip:20...@10.3.0.51:5060;transport=tcp>
>> Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE,
>> NOTIFY, PRACK, UPDATE, REFER
>> User-Agent: PolycomSoundPointIP-SPIP_335-UA/4.0.9.0509
>> Accept-Language: en
>> Supported: 100rel,replaces
>> Allow-Events: conference,talk,hold
>> Max-Forwards: 70
>> Content-Type: application/sdp
>> Content-Length: 288
>>
>> v=0
>> o=- 1481197061 1481197061 IN IP4 10.3.0.51
>> s=Polycom IP Phone
>> c=IN IP4 10.3.0.51
>> t=0 0
>>
>>
>> Best Regards,
>> Mihai Costache
>>
>> "No problem can withstand the assault of sustained thinking. "
>>
>>                                 -  Voltaire
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sipxcom-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

>> To post to this group, send email to sipxco...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/sipxcom-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sipxcom-users/CA%2Bpyz5pvXviW%2BAWbYjRqi5j4LGH2P3P56yewx_0G5bBF%3Dri8oQ%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sipxcom-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to sipxco...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sipxcom-users.
> To view this discussion on the web visit
Reply all
Reply to author
Forward
0 new messages