Discussion:
[SR-Users] Enable SipTrace
Bruno Emer
2014-10-02 21:24:22 UTC
Permalink
Hello!

I just got some kamailio servers working with websockets using jssip in my
clients and now I want to get the SIP Messages to better understand how it
flows between my servers.

I have enabled the "siptrace" module, and I can now save information on my
database, but the problem is that I can't read the SIP Messages there, as
it saves some strings in my database.

The SIP messages appears like this store in the sip_trace table:

\x41434b207369703a616c69636540656e74657270726973652e636f6d205349502f322e300d0a5669613a205349502f322e302f554450203137322e33312e34352e3139393b6272616e63683d7a39684734624b303537322e30363339656237323563616464373463313534633365663639626135643731332e300d0a4d61782d466f7277617264733a2036380d0a546f3a203c7369703a616c69636540656e74657270726973652e636f6d3e3b7461673d6c65673061356e6d62310d0a46726f6d3a203c7369703a626f6240656e74657270726973652e636f6d3e3b7461673d636d6e6b66766e6935680d0a43616c6c2d49443a20396f716e6c7369746e666c7166726765676f63740d0a435365713a20313233302041434b0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a

I am currently using postgres as my database, and to get this I just have:


- Define "WITH_SIP_TRACE" in the beginning of my configuration file:

#!KAMAILIO
#!define WITH_PGSQL
##!define WITH_DEBUG
#!define WITH_SIP_TRACE

- loadmodule:

#!ifdef WITH_SIP_TRACE
loadmodule "siptrace.so"
#!endif


- Configure SIP_TRACE params:

#!ifdef WITH_SIP_TRACE
# ---- sip_trace params ----
modparam("siptrace", "db_url", "postgres://kamailio:***@localhost
/kamailio")
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_flag", 22)
#!endif

- Get the messages:

request_route {
sip_trace();
setflag(22);
route(REQINIT);
...

Does anyone knows if is there something wrong in this configuration, or
what can I do to fix this and have the SIP messages stored in my database?


Thanks!

*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Daniel-Constantin Mierla
2014-10-03 08:54:31 UTC
Permalink
Hello,

maybe it is postrges client printing hexa because the typo of column is
blob?!?

Cheers,
Daniel
Post by Bruno Emer
Hello!
I just got some kamailio servers working with websockets using jssip
in my clients and now I want to get the SIP Messages to better
understand how it flows between my servers.
I have enabled the "siptrace" module, and I can now save information
on my database, but the problem is that I can't read the SIP Messages
there, as it saves some strings in my database.
\x41434b207369703a616c69636540656e74657270726973652e636f6d205349502f322e300d0a5669613a205349502f322e302f554450203137322e33312e34352e3139393b6272616e63683d7a39684734624b303537322e30363339656237323563616464373463313534633365663639626135643731332e300d0a4d61782d466f7277617264733a2036380d0a546f3a203c7369703a616c69636540656e74657270726973652e636f6d3e3b7461673d6c65673061356e6d62310d0a46726f6d3a203c7369703a626f6240656e74657270726973652e636f6d3e3b7461673d636d6e6b66766e6935680d0a43616c6c2d49443a20396f716e6c7369746e666c7166726765676f63740d0a435365713a20313233302041434b0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
#!KAMAILIO
#!define WITH_PGSQL
##!define WITH_DEBUG
#!define WITH_SIP_TRACE
#!ifdef WITH_SIP_TRACE
loadmodule "siptrace.so"
#!endif
*_
_*
#!ifdef WITH_SIP_TRACE
# ---- sip_trace params ----
modparam("siptrace", "db_url",
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_flag", 22)
#!endif
request_route {
sip_trace();
setflag(22);
route(REQINIT);
...
Does anyone knows if is there something wrong in this configuration,
or what can I do to fix this and have the SIP messages stored in my
database?
Thanks!
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Bruno Emer
2014-10-03 15:43:10 UTC
Permalink
Hello, Daniel!
Thanks for your support (AGAIN !!!)!

I just have discovered how to fix this using PGADMIN. Here is the query
that I'm using, so if someone else face this problem, it can help:

select a.id, a.time_stamp, a.time_us, a.callid, a.traced_user,
convert_from(msg::BYTEA, 'UTF8') as msg, a.method, a.status, a.fromip,
a.toip, a.fromtag, a.direction from sip_trace a


The point to fix this is to use the function "convert_from", so it can get
the data from the column and print as UTF8 text.






*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Hello!
I just got some kamailio servers working with websockets using jssip in my
clients and now I want to get the SIP Messages to better understand how it
flows between my servers.
I have enabled the "siptrace" module, and I can now save information on my
database, but the problem is that I can't read the SIP Messages there, as
it saves some strings in my database.
\x41434b207369703a616c69636540656e74657270726973652e636f6d205349502f322e300d0a5669613a205349502f322e302f554450203137322e33312e34352e3139393b6272616e63683d7a39684734624b303537322e30363339656237323563616464373463313534633365663639626135643731332e300d0a4d61782d466f7277617264733a2036380d0a546f3a203c7369703a616c69636540656e74657270726973652e636f6d3e3b7461673d6c65673061356e6d62310d0a46726f6d3a203c7369703a626f6240656e74657270726973652e636f6d3e3b7461673d636d6e6b66766e6935680d0a43616c6c2d49443a20396f716e6c7369746e666c7166726765676f63740d0a435365713a20313233302041434b0d0a436f6e74656e742d4c656e6774683a20300d0a0d0a
#!KAMAILIO
#!define WITH_PGSQL
##!define WITH_DEBUG
#!define WITH_SIP_TRACE
#!ifdef WITH_SIP_TRACE
loadmodule "siptrace.so"
#!endif
#!ifdef WITH_SIP_TRACE
# ---- sip_trace params ----
/kamailio")
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "trace_flag", 22)
#!endif
request_route {
sip_trace();
setflag(22);
route(REQINIT);
...
Does anyone knows if is there something wrong in this configuration, or
what can I do to fix this and have the SIP messages stored in my database?
Thanks!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Loading...