Hello,

But why you don’t use standard sipcapture config? You HAVE TO enable nonsip hook.
If you get a look into it, there is return 1 for SIP and return 0 for RTCP so it processed inside hook.

On 27 Oct  2017, at 18:07, Nathan Leyton <nathan@nlconsultancy.co> wrote:

Hi There

I am new to Kamailio and have just installed and got it up and running as  a sipcapture node. It is working well and logging all the hep sip traffic in my homer database. 

I have an issue with rtcp extracted to the msg column is not json. It is some kind of weird encoded string (not base64), this is not readable by homer in any way. 

When I use nonsip_hook I am able to extract the json from the hep and put it in the msg field. However when I return 1 from the hep route on sip to go back to main route I get parsing errors like so on all the sip messages:-

Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22518]: ERROR: sipcapture [sipcapture.c:2711]: nosip_hep_msg(): couldn't parse sip message
Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22518]: ERROR: <core> [core/receive.c:186]: receive_msg(): core parsing of SIP message failed (178.78.120.2:44389/1)
Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22518]: ERROR: <core> [core/parser/msg_parser.c:331]: parse_headers(): bad header field [(null)]
Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22518]: WARNING: <core> [core/receive.c:193]: receive_msg(): parsing relevant headers failed
Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22517]: ERROR: <core> [core/parser/parse_fline.c:257]: parse_first_line(): parse_first_line: bad message (offset: 0)
Oct 27 15:03:41 ip-172-31-19-41 /usr/local/sbin/kamailio[22517]: ERROR: <core> [core/parser/msg_parser.c:675]: parse_msg(): ERROR: parse_msg: message=<HEP3#002,>


It never actually enters the main route. With nonsip_hook off, I enter the main route and all my sip messages are there in homer, just missing rtcp as the data is a weird encoded string. 

Hope someone can help

-- 
Serge S. Yuriev