sipcapture / captagent

100% Open-Source Packet Capture Agent for HEP
https://sipcapture.org
GNU Affero General Public License v3.0
168 stars 75 forks source link

rtcpxr problem #62

Closed nickmaleao closed 8 years ago

nickmaleao commented 8 years ago

Hello

I have build captagent today , and i am using the included rtcprx config.

When i receive a PUBLISH message , this error appears in the debug:

[ERR] conf_function.c:118 BUG: do_action: unknown type -2024222144

Full debug:

root@sipd:/usr/local/captagent# bin/captagent [NOTICE] Loaded core config [DEBUG] modules.c:50 Loading module: [transport_hep] [NOTICE] Loaded transport_hep [DEBUG] modules.c:50 Loading module: [protocol_sip] [NOTICE] Loaded protocol_sip [DEBUG] modules.c:50 Loading module: [protocol_rtcp] [NOTICE] Loaded protocol_rtcp [DEBUG] modules.c:50 Loading module: [socket_rtcpxr] [NOTICE] Loaded socket_rtcpxr [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module transport_hep [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] modules.c:50 Loading module: [socket_pcap] [NOTICE] Loaded socket_pcap [DEBUG] socket_pcap.c:458 Activating device: eth0

[DEBUG] socket_pcap.c:494 Activated device: [eth0]

[DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module transport_hep [/usr/local/captagent/lib/captagent/modules] [DEBUG] conf_function.c:450 find_export_record: found in module protocol_sip [/usr/local/captagent/lib/captagent/modules] [DEBUG] modules.c:50 Loading module: [socket_raw] [NOTICE] Loaded socket_raw [DEBUG] captagent.c:328 The Captagent is ready [DEBUG] socket_rtcpxr.c:212 Received the following:

[DEBUG] socket_rtcpxr.c:213 PUBLISH 1.1.1.1:9070 SIP/2.0 Via: SIP/2.0/UDP 10.0.3.13:3073;branch=z9hG4bK-n60x6l9tz5s2;rport From: sip:5004@10.0.3.252;tag=qms5qt4pxm To: 1.1.1.1:9070 Call-ID: 4eb233575bdb-pe8f4nkqyitz CSeq: 2 PUBLISH Max-Forwards: 70 Contact: sip:5004@10.0.3.13:3073;line=1ly175ml;reg-id=1 User-Agent: snom821/873_19_20130321 Event: vq-rtcpxr Accept: application/sdp, message/sipfrag Content-Type: application/vq-rtcpxr Content-Length: 811

VQSessionReport: CallTerm CallID:42b23357b121-0i3ewfagn6bj LocalID:sip:5004@10.0.3.252 RemoteID:sip:910000000@10.0.3.252;user=phone OrigID:sip:5004@10.0.3.252 LocalAddr:IP=10.0.3.13 PORT=53264 SSRC=0x6D161C9F LocalMAC:0004135310DB RemoteAddr:IP=10.0.3.252 PORT=10092 SSRC=0xBF0E356A DialogID:42b23357b121-0i3ewfagn6bj;to-tag=TTYVqcOQuWz4FkXGiRbM-gZLUncq3wvf;from-tag=qms5qt4pxm x-UserAgent:snom821/873_19_20130321 LocalMetrics: Timestamps:START=2016-05-11T22:29:31Z STOP=2016-05-11T22:29:34Z SessionDesc:PT=8 PD=PCMA SR=8000 PPS=50 SSUP=off x-SIPmetrics:SVA=RG SRD=324 SFC=0 x-SIPterm:SDC=OK SDT=4 SDR=AN JitterBuffer:JBA=3 JBR=2 JBN=20 JBM=20 JBX=240 PacketLoss:NLR=0.0 JDR=0.0 BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=12100 GMIN=16 Delay:RTD=3 ESD=0 IAJ=0 QualityEst:MOSLQ=4.1 MOSCQ=4.1

[ERR] conf_function.c:118 BUG: do_action: unknown type -2024222144

lmangani commented 8 years ago

Please share your captagent.xml

nickmaleao commented 8 years ago
<?xml version="1.0"?>
<document type="captagent/xml">
        <configuration name="core.conf" description="CORE Settings" serial="2014024212">
            <settings>
                <param name="debug" value="9"/>
                <param name="version" value="2"/>
                <param name="serial" value="2014056501"/>
                <param name="uuid" value="00781a4a-5b69-11e4-9522-bb79a8fcf0f3"/>
                <param name="daemon" value="false"/>
                <param name="syslog" value="true"/>
                <param name="pid_file" value="/var/run/captagent.pid"/>
                <!-- Configure using installation path if different from default -->
                <param name="module_path" value="/usr/local/captagent/lib/captagent/modules"/>
                <param name="config_path" value="/usr/local/captagent/etc/captagent"/>
                <param name="capture_plans_path" value="/usr/local/captagent/etc/captagent/captureplans"/>
                <param name="backup" value="/usr/local/captagent/etc/captagent/backup"/>
                <param name="chroot" value="/usr/local/captagent"/>
            </settings>
        </configuration>
        <configuration name="modules.conf" description="Modules">
            <modules>
                <load module="transport_hep" register="local"/>
                <load module="protocol_sip" register="local"/>
                <load module="protocol_rtcp" register="local"/>
                <load module="socket_rtcpxr" register="local"/>
                <load module="socket_pcap" register="local"/>
                <load module="socket_raw" register="local"/>
                <load module="protocol_rtcp" register="local"/>
            <!--
                <load module="transport_json" register="local"/>
                <load module="database_hash" register="local"/>
                <load module="protocol_rtcp" register="local"/>
                <load module="interface_http" register="local"/>
                <load module="database_redis" register="local"/>
                <load module="socket_pfring" register="local"/>
            -->
            </modules>
        </configuration>
</document>

The only parameters that i modified, were the debug and syslog values and enabled the protocol_rtcp module.

Rico29 commented 8 years ago

Hello, I'm having the same kind of issue with rtcp-xr :

[DEBUG] socket_rtcpxr.c:212 Received the following:

[DEBUG] socket_rtcpxr.c:213 PUBLISH sip:loch@10.99.0.79:9070 SIP/2.0
Via: SIP/2.0/UDP 192.168.222.122:5060;branch=z9hG4bK3019194309
From: "44113" <sip:44113@10.99.0.79:5060>;tag=2675790702
To: <sip:loch@10.99.0.79:9070>
Call-ID: 0_446795877@192.168.222.122
CSeq: 1 PUBLISH
Content-Type: application/vq-rtcpxr
Max-Forwards: 70
User-Agent: Yealink SIP-T46G 28.80.0.70
Event: vq-rtcpxr
Content-Length:   685

VQSessionReport: CallTerm
LocalMetrics:
Timestamps:START=2016-6-15 10:41:26 STOP=2016-6-15 10:41:26
SessionDesc:PT=8 SR=0 FD=0 FO=0 FPP=0 PPS=50 PLC=0 SSUP=off
CallID:0_1504888233@192.168.222.122
ToID:<sip:loch@10.99.0.79:9070>
FromID:"44113"<sip:44113@10.99.0.79>
LocalAddr:IP=192.168.222.122 PORT=11782 SSRC=0x0824c673
RemoteAddr:IP=10.99.0.79 PORT=13588 SSRC=0x4bc1133e
JitterBuffer:JBA=0 JBR=0 JBN=0 JBM=0 JBX=0
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=0 GMIN=0
Delay:RTD=0 ESD=0 SOWD=0 IAJ=0 MAJ=0
Signal:SL=0 NL=0 RERL=0
QualityEst:RCQ=0 EXTRI=0 MOSLQ=0.0 MOSCQ=0.0
DialogID:0_1504888233@192.168.222.122;to-tag=as1d29db8b;from-tag=1268195456

[ERR] conf_function.c:118 BUG: do_action: unknown type 2120270288

my captagent.xml look like that :

<?xml version="1.0"?>
<document type="captagent/xml">
        <configuration name="core.conf" description="CORE Settings" serial="2014024212">
            <settings>
                <param name="debug" value="9"/>
                <param name="version" value="2"/>
                <param name="serial" value="2014056501"/>
                <param name="uuid" value="00781a4a-5b69-11e4-9522-bb79a8fcf0f3"/>
                <param name="daemon" value="false"/>
                <param name="syslog" value="false"/>
                <param name="pid_file" value="/var/run/captagent6.pid"/>
                <!-- Configure using installation path if different from default -->
                <param name="module_path" value="/usr/local/captagent/lib/captagent/modules"/>
                <param name="config_path" value="/usr/local/captagent/etc/captagent"/>
                <param name="capture_plans_path" value="/usr/local/captagent/etc/captagent/captureplans"/>
                <param name="backup" value="/usr/local/captagent/etc/captagent/backup"/>
                <param name="chroot" value="/usr/local/captagent"/>
            </settings>
        </configuration>
        <configuration name="modules.conf" description="Modules">
            <modules>
                <load module="transport_hep" register="local"/>
                <load module="protocol_sip" register="local"/>
                <load module="database_hash" register="local"/>
                <load module="protocol_rtcp" register="local"/>                                           
                <load module="socket_rtcpxr" register="local"/>
                <load module="socket_pcap" register="local"/>
                <load module="socket_raw" register="local"/>
            </modules>
        </configuration>
</document>

Did you find a solution ? Regards, Cédric

nickmaleao commented 8 years ago

Unfortunately no, i've tried to analyse the code, but its not my area of expertise.

I've been waiting from some input from the devs on this issue.

Regards.

adubovikov commented 8 years ago

Can you guys provide pcap file with RTCP-XR PUBLISH ?

nickmaleao commented 8 years ago

rtcpxr.zip

Thanks for your help, best regards.

Rico29 commented 8 years ago

hello, here's mine too : publish.zip

Thanks for help again. Regards.

adubovikov commented 8 years ago

Hi guys,

so, the socket_rtcpxr has been fixed. please take the last git and check.

the current version of the captagent is 6.2.0.1 and since now the captagent requires libuv. (0.10 or 1.x)

please test and let us know.

Wbr, Alexandr

Rico29 commented 8 years ago

Hello, Make fails for me, related to libuv : socket_rtcpxr.c:181:2: error: incompatible type for argument 5 of ‘uv_udp_send’

root@coralha1:/usr/src/captagent# pkg -l | grep libuv
-bash: pkg: command not found
root@coralha1:/usr/src/captagent# dpkg -l | grep libuv
ii  libuv0.10:amd64                0.10.28-6                   amd64        asynchronous event notification library - runtime library
ii  libuv0.10-dev:amd64            0.10.28-6                   amd64        asynchronous event notification library - development files

make output :

root@coralha1:/usr/src/captagent# make
Making all in src
make[1]: Entering directory '/usr/src/captagent/src'
make  all-recursive
make[2]: Entering directory '/usr/src/captagent/src'
Making all in .
make[3]: Entering directory '/usr/src/captagent/src'
make[3]: Leaving directory '/usr/src/captagent/src'
Making all in modules/socket/pcap
make[3]: Entering directory '/usr/src/captagent/src/modules/socket/pcap'
Making all in .
make[4]: Entering directory '/usr/src/captagent/src/modules/socket/pcap'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/usr/src/captagent/src/modules/socket/pcap'
make[3]: Leaving directory '/usr/src/captagent/src/modules/socket/pcap'
Making all in modules/socket/raw
make[3]: Entering directory '/usr/src/captagent/src/modules/socket/raw'
Making all in .
make[4]: Entering directory '/usr/src/captagent/src/modules/socket/raw'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/usr/src/captagent/src/modules/socket/raw'
make[3]: Leaving directory '/usr/src/captagent/src/modules/socket/raw'
Making all in modules/socket/rtcpxr
make[3]: Entering directory '/usr/src/captagent/src/modules/socket/rtcpxr'
Making all in .
make[4]: Entering directory '/usr/src/captagent/src/modules/socket/rtcpxr'
/bin/bash ../../../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../src   -I../../../../include  -Wall  -g -O2 -MT socket_rtcpxr_la-socket_rtcpxr.lo -MD -MP -MF .deps/socket_rtcpxr_la-socket_rtcpxr.Tpo -c -o socket_rtcpxr_la-socket_rtcpxr.lo `test -f 'socket_rtcpxr.c' || echo './'`socket_rtcpxr.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../src -I../../../../include -Wall -g -O2 -MT socket_rtcpxr_la-socket_rtcpxr.lo -MD -MP -MF .deps/socket_rtcpxr_la-socket_rtcpxr.Tpo -c socket_rtcpxr.c  -fPIC -DPIC -o .libs/socket_rtcpxr_la-socket_rtcpxr.o
socket_rtcpxr.c: In function ‘send_sip_rtcpxr_reply’:
socket_rtcpxr.c:181:2: error: incompatible type for argument 5 of ‘uv_udp_send’
  uv_udp_send(send_req, handle, &reply_msg, 1, (const struct sockaddr_in *) _m->var, on_send);
  ^
In file included from socket_rtcpxr.h:31:0,
                 from socket_rtcpxr.c:62:
/usr/include/uv.h:918:15: note: expected ‘struct sockaddr_in’ but argument is of type ‘const struct sockaddr_in *’
 UV_EXTERN int uv_udp_send(uv_udp_send_t* req, uv_udp_t* handle,
               ^
socket_rtcpxr.c: In function ‘on_recv’:
socket_rtcpxr.c:225:15: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     loc_idx = (int) handle->data;
               ^
socket_rtcpxr.c:227:5: warning: implicit declaration of function ‘gettimeofday’ [-Wimplicit-function-declaration]
     gettimeofday(&tv, NULL);
     ^
socket_rtcpxr.c: In function ‘init_socket’:
socket_rtcpxr.c:323:11: error: incompatible type for argument 2 of ‘uv_udp_bind’
  status = uv_udp_bind(&udp_servers[loc_idx], (const struct sockaddr*)&addr,0);
           ^
In file included from socket_rtcpxr.h:31:0,
                 from socket_rtcpxr.c:62:
/usr/include/uv.h:813:15: note: expected ‘struct sockaddr_in’ but argument is of type ‘const struct sockaddr *’
 UV_EXTERN int uv_udp_bind(uv_udp_t* handle, struct sockaddr_in addr,
               ^
socket_rtcpxr.c:335:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  udp_servers[loc_idx].data = (void *) loc_idx;
                              ^
socket_rtcpxr.c:337:62: warning: passing argument 3 of ‘uv_udp_recv_start’ from incompatible pointer type
  status = uv_udp_recv_start(&udp_servers[loc_idx], on_alloc, on_recv);
                                                              ^
In file included from socket_rtcpxr.h:31:0,
                 from socket_rtcpxr.c:62:
/usr/include/uv.h:954:15: note: expected ‘uv_udp_recv_cb’ but argument is of type ‘void (*)(struct uv_udp_t *, ssize_t,  struct uv_buf_t *, struct sockaddr *, unsigned int)’
 UV_EXTERN int uv_udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
               ^
socket_rtcpxr.c:309:21: warning: variable ‘v4addr’ set but not used [-Wunused-but-set-variable]
  struct sockaddr_in v4addr;
                     ^
Makefile:514: recipe for target 'socket_rtcpxr_la-socket_rtcpxr.lo' failed
make[4]: *** [socket_rtcpxr_la-socket_rtcpxr.lo] Error 1
make[4]: Leaving directory '/usr/src/captagent/src/modules/socket/rtcpxr'
Makefile:554: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/usr/src/captagent/src/modules/socket/rtcpxr'
Makefile:646: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/usr/src/captagent/src'
Makefile:463: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/captagent/src'
Makefile:448: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

configure end output :

captagent 6.2.0.1

Build directory............. :
Installation prefix......... : /usr/local/captagent
HEP Compression............. : no 
HEP SSL/TLS................. : no 
Flex........................ : flex
Bison....................... : bison -y

Build with REDIS............ : no 
Build with MySQL............ : no 
Build with PCRE............. : no 
Build with LibUV............ : yes

Regards, Cédric

adubovikov commented 8 years ago

please make git pull and recomile

Rico29 commented 8 years ago

compilation is OK. I'll test rtcp_xr as soon as I have the time to. Thanks / Regards, Cédric

Rico29 commented 8 years ago

Can you please provide a configure option to build captagent without libuv ? libuv is not available under debian 7 .debs, it would be great if we can compile captagent without libuv (rtcp-xr) support. Regards, Cédric

adubovikov commented 8 years ago

Cedric, as I wrote since 6.2.x libuv is mandatory. If you couldn't find package for wheezy, please download and compile libuv from here: https://github.com/libuv/libuv/releases

adubovikov commented 8 years ago

If u just want capture sip, without rtcp-xr collector, please use 6.1.0.x release On Jun 16, 2016 16:54, "Rico29" notifications@github.com wrote:

Can you please provide a configure option to build captagent without libuv ? libuv is not available under debian 7 .debs, it would be great if we can compile captagent without libuv (rtcp-xr) support. Regards, Cédric

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sipcapture/captagent/issues/62#issuecomment-226509809, or mute the thread https://github.com/notifications/unsubscribe/AETdJW3G767BlDwrpmdsgMelyA4zs5-5ks5qMWOJgaJpZM4Icjzd .

nickmaleao commented 8 years ago

Thank you very much!, for me the problem is solved :) captagent parses the PUBLISH message to kamailio , which then writes to mysql.

I have only one question before closing this issue, is it possibly to setup homer to analyse standalone rtpcrx reports without the complete flow of the sip session?

Regards.

adubovikov commented 8 years ago

yes, you can do it in the kamailio's config. Please see example in our presentation that we did at Kamailio World 2015.

adubovikov commented 8 years ago

I close the issue. Please re-open if anything