Giter Site home page Giter Site logo

sipcapture / captagent Goto Github PK

View Code? Open in Web Editor NEW
163.0 23.0 75.0 7.02 MB

100% Open-Source Packet Capture Agent for HEP

Home Page: https://sipcapture.org

License: GNU Affero General Public License v3.0

Shell 1.58% C 95.24% Makefile 0.74% Lex 0.47% Yacc 0.45% M4 1.02% JavaScript 0.48% Go 0.02%
sip rtcp packet capture pcap homer hep eep tls json

captagent's People

Contributors

adubovikov avatar amendiola avatar aphistic avatar btriller avatar dancapper avatar dependabot[bot] avatar dougbtv avatar dpocock avatar gaaf avatar giavac avatar jkroonza avatar joonake avatar kemathy avatar kevinferrero avatar kvishnivetsky avatar kyrol01 avatar leitao avatar lmangani avatar majortom81 avatar mmonka avatar mslehto avatar nshopik avatar sipseb avatar systemcrash avatar tkteun avatar trdenton avatar zecke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

captagent's Issues

Cisco phone INVITE - Bad SDP

Cisco 7960, 7965 and others that run v8 or higher firmware have their INVITE messages tossed with the "BAD SDP. Couldn't parse it!" error. The "c=" line comes after the "m=" in their SDP.

v=0
o=Cisco-SIPUA 7221 0 IN IP4 10.10.10.10
s=SIP Call
t=0 0
m=audio 20096 RTP/AVP 0 8 18 9 116 101
c=IN IP4 10.10.10.10
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:9 G722/8000
a=rtpmap:116 iLBC/8000
a=fmtp:116 mode=20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

IPv6 seems not to work

Hi all,

is there any support for IPv6 networks? So far we are running capagent on V4 only but we will expand our network to V6. Unfortunately captagent does not send HEP to kamailio from V6 interfaces.

Also i couldn't find any config to enable V6.

Does anyone have an idea how to enable?

thanks in adavnce

near 100% cpu usage

captagent is running @ 100% cpu usage for me. Using centos 7. It appears to be working, otherwise.

Here's how I built captagent:

yum install -y libpcap automake expat-devel libtool git libpcap-devel file make
git clone https://github.com/sipcapture/captagent.git
cd /captagent/captagent
./build.sh
./configure
make 
make install

And then I run it with (which shows no output):

captagent -n

When I check top I see:

PID   USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
13074 root      20   0  195256   6440   6152 S  99.8  0.1   0:07.33 captagent      

Additionally, here's my captagent.xml configuration:

<?xml version="1.0"?>

<document type="captagent/xml">

        <configuration name="core.conf" description="CORE Settings">
          <settings>
            <param name="debug" value="3"/>
            <param name="daemon" value="false"/>
            <param name="syslog" value="false"/>
            <param name="pid_file" value="/var/run/captagent.pid"/>
            <param name="path" value="/usr/local/lib/captagent/modules"/>
          </settings>
        </configuration>

        <configuration name="modules.conf" description="Modules">
          <modules>
                <load module="core_hep"/>
                <load module="proto_uni"/>
                <load module="proto_rtcp"/>
                <load module="capt_cli"/>
          </modules>
        </configuration>

        <!-- CORE MODULES -->

        <configuration name="core_hep.conf" description="HEP Socket">
          <settings>
            <param name="version" value="3"/>
            <param name="capture-host" value="192.168.100.204"/>
            <param name="capture-port" value="9060"/>
            <param name="capture-proto" value="udp"/>
            <param name="capture-id" value="2001"/>
            <param name="capture-password" value="myHep"/>
            <param name="payload-compression" value="false" />
          </settings>
        </configuration>

        <!-- PROTOCOLS -->

        <configuration name="proto_uni.conf" description="UNI Proto Basic capture">
          <settings>
            <param name="port" value="5060"/>
            <!-- <param name="portrange" value="5060-5090"/> -->
            <!--
                use -D flag for pcap import
                use "any" for all interfaces in your system
            -->
            <param name="dev"  value="any"/>
            <param name="promisc" value="true"/>
            <!--
                comment it if you want to see all IPProto (tcp/udp)
            -->
            <!-- enable this if you want to get RTCP stats -->
            <param name="sip-parse"  value="true"/>
            <param name="rtcp-tracking"  value="true"/>
            <param name="ip-proto" value="udp"/>
            <param name="proto-type"  value="sip"/>
            <!-- <param name="filter" value="not src port 5099"/> -->
            <!-- 
                <param name="expire-timer" value ="120"/>                       
                <param name="expire-rtcp" value ="120"/>                       
            -->
          </settings>
        </configuration>

        <configuration name="proto_rtcp.conf" description="RTCP capture">
            <settings>
                <!-- <param name="portrange" value="5060-5090"/> -->
                <param name="dev"  value="any"/>       
                <param name="promisc" value="true"/>
                <param name="debug" value ="false"/>                    
                <!-- <param name="rtcp-json" value="false"/> -->
                <!-- <param name="send-sdes" value="false"/> -->
                <!-- <param name="filter" value="not src port 5099"/> -->
                <!-- <param name="vlan" value="false"/> -->
            </settings>
          </configuration>

        <!-- CLI  -->

        <configuration name="capt_cli.conf" description="CLI socket">
          <settings>
            <param name="cli-host" value="localhost"/>
            <param name="cli-port" value="8909"/>
            <param name="cli-password" value="12345"/>
          </settings>
        </configuration>

</document>

Captagent 6.1.0 Debian Wheezy: "This is not RTCP"

Hello everyone,

I'm facing an issue with RTCP parsing with captagent 6.1.0 on Debian Wheezy and Asterisk 11.15.0 compiled from a git clone made the 18th May 2016, like explained on the doc:

git clone https://github.com/sipcapture/captagent.git captagent
cd captagent
./build.sh
./configure
make && make install

RTCP are sent and received on the node running captagent, but the parser says "[ERR] protocol_sip.c:131 This is not RTCP" for each RTCP packets.

A tcpdump shows RTCP packets and wireshark RTCP dissector is able to give me packets details.
I searched on the src, and I think my packets are for some reason not compliant with tests within the code (check_rtcp_version function maybe?) but my very little dev knowledge is confusing me.

So you'll find thereafter my captagent config, and capture of 6 RTCP packets corresponding to 6 "This is not RTCP" I got today.

Thanks for your help, and congrats for your amazing sipcapture/homer suite ;)

captagent_config.zip
RTCPdump.zip

Issues starting captagent, files missing

Hi,

When i try to run captagent, i got the following errors, why are these files missing? I did a succesfull make & make install

Version 6.0.0

captagent -n
[NOTICE] Loaded core config
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/transport_json.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/transport_hep.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/protocol_sip.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/database_hash.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/protocol_sip.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/protocol_rtcp.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/socket_rtcpxr.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/socket_pcap.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/lib64/captagent/modules/socket_raw.so: cannot open shared object file: No such file or directory]

CentOS 6 captagent segfault

Hello

I met some interesting issue with CentOS 6.6 (freepbx 12). After the first start of the captagent I'm not able to restart it. For details check out the output below:

[root@localhost ~]# /etc/init.d/captagent restart
Stopping captagent:                                        [  OK  ]
Starting captagent:                                        [  OK  ]
[root@localhost ~]# [ERR] proto_uni.c:511 Failed to compile filter " port 5060  and udp ": syntax error
[root@localhost ~]# /etc/init.d/captagent restart
Stopping captagent:                                        [FAILED]
Starting captagent:                                        [  OK  ]
[root@localhost ~]# [ERR] proto_uni.c:511 Failed to compile filter " port 5060  and udp ": illegal port number 1584191127 > 65535

[root@localhost ~]# /etc/init.d/captagent restart
Stopping captagent:                                        [FAILED]
Starting captagent:                                        [  OK  ]
[root@localhost ~]# *** longjmp causes uninitialized stack frame ***: /usr/local/bin/captagent terminated
[ERR] proto_rtcp.c:291 Failed to compile filter "(ip and ip[6] & 0x2 = 0 and ip[6:2] & 0x1fff = 0 and udp and udp[8] & 0xc0 = 0x80 and udp[9] >= 0xc8 && udp[9] <= 0xcc)":
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7fecb5a0d527]
/lib64/libc.so.6(+0x1024b9)[0x7fecb5a0d4b9]
/lib64/libc.so.6(__longjmp_chk+0x33)[0x7fecb5a0d423]
/usr/lib64/libpcap.so.1(+0x125fb)[0x7fecb677c5fb]
/usr/lib64/libpcap.so.1(pcap_lex+0xd5e)[0x7fecb678d84e]
/usr/lib64/libpcap.so.1(pcap_parse+0x3f2)[0x7fecb678e4a2]
/usr/lib64/libpcap.so.1(pcap_compile+0x235)[0x7fecb677cbf5]
/usr/local/lib/captagent/modules/proto_uni.so(proto_collect+0x1e9)[0x7fecb3f7b119]
/lib64/libpthread.so.0(+0x79d1)[0x7fecb61289d1]
/lib64/libc.so.6(clone+0x6d)[0x7fecb59f38fd]
======= Memory map: ========
00400000-00405000 r-xp 00000000 fc:02 29099                              /usr/local/bin/captagent
00604000-00605000 rw-p 00004000 fc:02 29099                              /usr/local/bin/captagent
00605000-00607000 rw-p 00000000 00:00 0
01a98000-01ab9000 rw-p 00000000 00:00 0                                  [heap]
7feca4000000-7feca4021000 rw-p 00000000 00:00 0
7feca4021000-7feca8000000 ---p 00000000 00:00 0
7fecac000000-7fecac021000 rw-p 00000000 00:00 0
7fecac021000-7fecb0000000 ---p 00000000 00:00 0
7fecb0788000-7fecb079e000 r-xp 00000000 fc:02 22                         /lib64/libgcc_s-4.4.7-20120601.so.1
7fecb079e000-7fecb099d000 ---p 00016000 fc:02 22                         /lib64/libgcc_s-4.4.7-20120601.so.1
7fecb099d000-7fecb099e000 rw-p 00015000 fc:02 22                         /lib64/libgcc_s-4.4.7-20120601.so.1
7fecb099e000-7fecb0d7e000 rw-s 00000000 00:06 117049                     socket:[117049]
7fecb0d7e000-7fecb115e000 rw-s 00000000 00:06 117051                     socket:[117051]
7fecb115e000-7fecb115f000 ---p 00000000 00:00 0
7fecb115f000-7fecb1b5f000 rw-p 00000000 00:00 0
7fecb1b5f000-7fecb1b6b000 r-xp 00000000 fc:02 2748                       /lib64/libnss_files-2.12.so
7fecb1b6b000-7fecb1d6b000 ---p 0000c000 fc:02 2748                       /lib64/libnss_files-2.12.so
7fecb1d6b000-7fecb1d6c000 r--p 0000c000 fc:02 2748                       /lib64/libnss_files-2.12.so
7fecb1d6c000-7fecb1d6d000 rw-p 0000d000 fc:02 2748                       /lib64/libnss_files-2.12.so
7fecb1d6d000-7fecb1d6f000 r-xp 00000000 fc:02 394301                     /usr/local/lib/captagent/modules/capt_cli.so
7fecb1d6f000-7fecb1f6f000 ---p 00002000 fc:02 394301                     /usr/local/lib/captagent/modules/capt_cli.so
7fecb1f6f000-7fecb1f70000 rw-p 00002000 fc:02 394301                     /usr/local/lib/captagent/modules/capt_cli.so
7fecb1f70000-7fecb1f71000 ---p 00000000 00:00 0
7fecb1f71000-7fecb2971000 rw-p 00000000 00:00 0
7fecb2971000-7fecb2974000 r-xp 00000000 fc:02 394302                     /usr/local/lib/captagent/modules/proto_rtcp.so
7fecb2974000-7fecb2b74000 ---p 00003000 fc:02 394302                     /usr/local/lib/captagent/modules/proto_rtcp.so
7fecb2b74000-7fecb2b75000 rw-p 00003000 fc:02 394302                     /usr/local/lib/captagent/modules/proto_rtcp.so
7fecb2b75000-7fecb2b76000 rw-p 00000000 00:00 0
7fecb2b76000-7fecb2b77000 ---p 00000000 00:00 0
7fecb2b77000-7fecb3577000 rw-p 00000000 00:00 0
7fecb3577000-7fecb3578000 ---p 00000000 00:00 0
7fecb3578000-7fecb3f78000 rw-p 00000000 00:00 0
7fecb3f78000-7fecb3f82000 r-xp 00000000 fc:02 394300                     /usr/local/lib/captagent/modules/proto_uni.so
7fecb3f82000-7fecb4181000 ---p 0000a000 fc:02 394300                     /usr/local/lib/captagent/modules/proto_uni.so
7fecb4181000-7fecb4182000 rw-p 00009000 fc:02 394300                     /usr/local/lib/captagent/modules/proto_uni.so
7fecb4182000-7fecb4187000 r-xp 00000000 fc:02 394299                     /usr/local/lib/captagent/modules/core_hep.so
7fecb4187000-7fecb4386000 ---p 00005000 fc:02 394299                     /usr/local/lib/captagent/modules/core_hep.so
7fecb4386000-7fecb4387000 rw-p 00004000 fc:02 394299                     /usr/local/lib/captagent/modules/core_hep.so
7fecb4387000-7fecb43a4000 r-xp 00000000 fc:02 3330                       /lib64/libselinux.so.1
7fecb43a4000-7fecb45a3000 ---p 0001d000 fc:02 3330                       /lib64/libselinux.so.1
7fecb45a3000-7fecb45a4000 r--p 0001c000 fc:02 3330                       /lib64/libselinux.so.1
7fecb45a4000-7fecb45a5000 rw-p 0001d000 fc:02 3330                       /lib64/libselinux.so.1
7fecb45a5000-7fecb45a6000 rw-p 00000000 00:00 0
7fecb45a6000-7fecb45bc000 r-xp 00000000 fc:02 2758                       /lib64/libresolv-2.12.so
7fecb45bc000-7fecb47bc000 ---p 00016000 fc:02 2758                       /lib64/libresolv-2.12.so
7fecb47bc000-7fecb47bd000 r--p 00016000 fc:02 2758                       /lib64/libresolv-2.12.so
7fecb47bd000-7fecb47be000 rw-p 00017000 fc:02 2758                       /lib64/libresolv-2.12.so
7fecb47be000-7fecb47c0000 rw-p 00000000 00:00 0
7fecb47c0000-7fecb47c2000 r-xp 00000000 fc:02 4110                       /lib64/libkeyutils.so.1.3
7fecb47c2000-7fecb49c1000 ---p 00002000 fc:02 4110                       /lib64/libkeyutils.so.1.3
7fecb49c1000-7fecb49c2000 r--p 00001000 fc:02 4110                       /lib64/libkeyutils.so.1.3
7fecb49c2000-7fecb49c3000 rw-p 00002000 fc:02 4110                       /lib64/libkeyutils.so.1.3
7fecb49c3000-7fecb49cd000 r-xp 00000000 fc:02 4120                       /lib64/libkrb5support.so.0.1
7fecb49cd000-7fecb4bcc000 ---p 0000a000 fc:02 4120                       /lib64/libkrb5support.so.0.1
7fecb4bcc000-7fecb4bcd000 r--p 00009000 fc:02 4120                       /lib64/libkrb5support.so.0.1
7fecb4bcd000-7fecb4bce000 rw-p 0000a000 fc:02 4120                       /lib64/libkrb5support.so.0.1
7fecb4bce000-7fecb4d87000 r-xp 00000000 fc:02 7323                       /usr/lib64/libcrypto.so.1.0.1e
7fecb4d87000-7fecb4f86000 ---p 001b9000 fc:02 7323                       /usr/lib64/libcrypto.so.1.0.1e
7fecb4f86000-7fecb4fa1000 r--p 001b8000 fc:02 7323                       /usr/lib64/libcrypto.so.1.0.1e
7fecb4fa1000-7fecb4fad000 rw-p 001d3000 fc:02 7323                       /usr/lib64/libcrypto.so.1.0.1e
7fecb4fad000-7fecb4fb1000 rw-p 00000000 00:00 0
7fecb4fb1000-7fecb4fda000 r-xp 00000000 fc:02 4116                       /lib64/libk5crypto.so.3.1
7fecb4fda000-7fecb51da000 ---p 00029000 fc:02 4116                       /lib64/libk5crypto.so.3.1
7fecb51da000-7fecb51db000 r--p 00029000 fc:02 4116                       /lib64/libk5crypto.so.3.1
7fecb51db000-7fecb51dc000 rw-p 0002a000 fc:02 4116                       /lib64/libk5crypto.so.3.1
7fecb51dc000-7fecb51dd000 rw-p 00000000 00:00 0
7fecb51dd000-7fecb51e0000 r-xp 00000000 fc:02 3174                       /lib64/libcom_err.so.2.1
7fecb51e0000-7fecb53df000 ---p 00003000 fc:02 3174                       /lib64/libcom_err.so.2.1
7fecb53df000-7fecb53e0000 r--p 00002000 fc:02 3174                       /lib64/libcom_err.so.2.1
7fecb53e0000-7fecb53e1000 rw-p 00003000 fc:02 3174                       /lib64/libcom_err.so.2.1
7fecb53e1000-7fecb54bc000 r-xp 00000000 fc:02 4118                       /lib64/libkrb5.so.3.3

I have to reboot my server to be able to start daemon again. The real problem is segfault of captagent

[root@localhost ~]# grep captagent /var/log/messages
Jun 17 06:51:05 localhost kernel: captagent[7764]: segfault at 7f9a10021000 ip 00007f9a242b792f sp 00007f9a21e97728 error 6 in libc-2.12.so[7f9a2422e000+18a000]
Jun 17 06:51:13 localhost kernel: captagent[7782]: segfault at 0 ip (null) sp 00007f17d6323bf0 error 14 in captagent[400000+5000]
Jun 17 06:58:45 localhost kernel: captagent[2124]: segfault at 7fec4eb9e000 ip 00007fec5b5bb33d sp 00007fec591a05e8 error 6 in libc-2.12.so[7fec5b537000+18a000]

Also the issue persist for both architectures x86 and x64

captureplan: sip_check() fix for harmless error logging

So I noticed when using sip_check() in capture plan to limit what messaging to capture, that there's some harmless error messages in the logs, I think there's a missing else-if in protocol_sip.c

If you're doing something like sip_check("method","REGISTER") in a capture plan, you'll get a harmless error stating:

[ERR] protocol_sip.c:195 unknown variable [method]

Need an else-if here:

Otherwise you get this error message:

LERR("unknown variable [%s]\n", param1);

I'll submit a PR as soon as I get a chance. It's not breaking, but, it appears as an error when you're kind of not expecting it.

setup capture for rtcp

how do i setup captagent to capture rtcp and how/where can the info/charts be viewed ?

Is ERSPAN supported

Hello

I was using RSPAN to capture packets from my network and forward them to captagent , due to some complexity i want to use ERSPAN , i test it and if i do wireshark it do decapsulate the sip packets and show them but when trying to configure captagent it doesn't recognize the packets because they are encapsulated

more info about ERSPAN

captagent 6 issue when started it

Hi,
I have this issue when I try start captagent (in debian 8). Captagent is started, but with these logs

root@capturenode1:/usr/src/captagent/init/debian# /etc/init.d/captagent start
Starting captagent: [NOTICE] Loaded core config

[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/transport_json.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/transport_hep.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/protocol_sip.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/socket_rtcpxr.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/socket_pcap.so: cannot open shared object file: No such file or directory]
[ERR] modules.c:75 dlopen error [/usr/local/lib/captagent/modules/socket_raw.so: cannot open shared object file: No such file or directory]

indeed:

root@capturenode1:/usr/src/captagent/conf# ls /usr/local/lib/captagent/modules/
capt_cli.so  core_hep.so  proto_rtcp.so  proto_uni.so

how I compile it with the good modules please ?

thanks in advance

Problem compiling captagent undefined reference to `yylex'

Having an issue compiling captagent on archlinux. I just grabbed what I thought was the relevant data from the log. Can anyone point me in the right direction? I also tried ./configure LEX="flex --noyywrap" but it would return that flex was not found even thought it was installed and the config found it earlier in the detection.

configure:13761: checking for yywrap in -lfl
configure:13786: gcc -o conftest -g -O2   conftest.c -lfl  -lpcap -lexpat -ldl -lpthread  >&5
/usr/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../lib/libfl.so: undefined reference to `yylex'
collect2: error: ld returned 1 exit status
configure:13786: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "captagent"
| #define PACKAGE_TARNAME "captagent"
| #define PACKAGE_VERSION "6.0.1"
| #define PACKAGE_STRING "captagent 6.0.1"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL "http://www.sipcapture.org"
| #define PACKAGE "captagent"
| #define VERSION "6.0.1"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define OS_LINUX 1
| #define YYTEXT_POINTER 1
| #define HAVE_LIBPTHREAD 1
| #define HAVE_LIBDL 1
| #define HAVE_LIBEXPAT 1
| #define HAVE_LIBPCAP 1
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char yywrap ();
| int
| main ()
| {
| return yywrap ();
|   ;
|   return 0;
| }
configure:13795: result: no
configure:13800: error: captagent requires but cannot find libfl

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_YACC_set=
ac_cv_env_YACC_value=
ac_cv_env_YFLAGS_set=
ac_cv_env_YFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_header_dlfcn_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_lib_dl_dlopen=yes
ac_cv_lib_expat_XML_ParserCreate=yes
ac_cv_lib_fl_yywrap=no
ac_cv_lib_json_c_json_object_get=yes
ac_cv_lib_json_json_object_get=no
ac_cv_lib_lex=-lfl
ac_cv_lib_pcap_pcap_open_live=yes
ac_cv_lib_pthread_pthread_create=yes
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_FGREP='/usr/bin/grep -F'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_lt_DD=/usr/bin/dd
ac_cv_path_mkdir=/usr/bin/mkdir
ac_cv_prog_AWK=gawk
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_LEX=flex
ac_cv_prog_YACC='bison -y'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_OBJDUMP=objdump
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_lex_root=lex.yy
ac_cv_prog_lex_yytext_pointer=yes
ac_cv_prog_make_make_set=yes
am_cv_CC_dependencies_compiler_type=gcc3
am_cv_make_support_nested_variables=yes
am_cv_prog_cc_c_o=yes
am_cv_prog_tar_ustar=gnutar
lt_cv_ar_at_file=@
lt_cv_archive_cmds_need_lc=no
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_ld_reload_flag=-r
lt_cv_nm_interface='BSD nm'
lt_cv_objdir=.libs
lt_cv_path_LD=/usr/bin/ld
lt_cv_path_NM='/usr/bin/nm -B'
lt_cv_path_mainfest_tool=no
lt_cv_prog_compiler_c_o=yes
lt_cv_prog_compiler_pic='-fPIC -DPIC'
lt_cv_prog_compiler_pic_works=yes
lt_cv_prog_compiler_rtti_exceptions=no
lt_cv_prog_compiler_static_works=yes
lt_cv_prog_gnu_ld=yes
lt_cv_sharedlib_from_linklib_cmd='printf %s\n'
lt_cv_shlibpath_overrides_runpath=no
lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[   ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[     ][  ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\'''
lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/  {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/  {"\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/  {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/  {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/  {"lib\1", (void *) \&\1},/p'\'''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\'''
lt_cv_sys_global_symbol_to_import=
lt_cv_sys_max_cmd_len=1572864
lt_cv_to_host_file_cmd=func_convert_file_noop
lt_cv_to_tool_file_cmd=func_convert_file_noop
lt_cv_truncate_bin='/usr/bin/dd bs=4096 count=1'

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /build/captagent/src/captagent-6.0.1/missing aclocal-1.15'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='1'
AM_V='$(V)'
AR='ar'
AUTOCONF='${SHELL} /build/captagent/src/captagent-6.0.1/missing autoconf'
AUTOHEADER='${SHELL} /build/captagent/src/captagent-6.0.1/missing autoheader'
AUTOMAKE='${SHELL} /build/captagent/src/captagent-6.0.1/missing automake-1.15'
AWK='gawk'
CC='gcc'
CCDEPMODE='depmode=gcc3'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DLLTOOL='false'
DL_LIBS=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
EXPAT_LIBS=''
FGREP='/usr/bin/grep -F'
FLEX_LIBS=''
GREP='/usr/bin/grep'
HIREDIS_LIBS=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
JSON_LIBS='-ljson-c'
LD='/usr/bin/ld -m elf_x86_64'
LDFLAGS=''
LEX='flex'
LEXLIB='-lfl'
LEX_OUTPUT_ROOT='lex.yy'
LIBOBJS=''
LIBS='-lpcap -lexpat -ldl -lpthread '
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LIBUV='no'
LIPO=''
LN_S='ln -s'
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAKEINFO='${SHELL} /build/captagent/src/captagent-6.0.1/missing makeinfo'
MANIFEST_TOOL=':'
MKDIR_P='/usr/bin/mkdir -p'
MYSQL='no'
MYSQL_LIBS=''
NM='/usr/bin/nm -B'
NMEDIT=''
OBJDUMP='objdump'
OBJEXT='o'
OS_DARWIN=''
OS_FREEBSD=''
OS_LINUX='1'
OS_NETBSD=''
OS_SOLARIS=''
OTOOL64=''
OTOOL=''
OUR_MODS=''
PACKAGE='captagent'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_NAME='captagent'
PACKAGE_STRING='captagent 6.0.1'
PACKAGE_TARNAME='captagent'
PACKAGE_URL='http://www.sipcapture.org'
PACKAGE_VERSION='6.0.1'
PATH_SEPARATOR=':'
PCAP_LIBS=''
PCRE='no'
PCRE_LIBS=''
PTHREAD_LIBS=''
RANLIB='ranlib'
REDIS='no'
SED='/usr/bin/sed'
SET_MAKE=''
SHELL='/bin/sh'
SSL='no'
STRIP='strip'
UV_LIBS=''
VERSION='6.0.1'
YACC='bison -y'
YFLAGS=''
ZLIB='no'
ac_ct_AR='ar'
ac_ct_CC='gcc'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE='#'
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='tar --format=ustar -chf - "$$tardir"'
am__untar='tar -xf -'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /build/captagent/src/captagent-6.0.1/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "captagent"
#define PACKAGE_TARNAME "captagent"
#define PACKAGE_VERSION "6.0.1"
#define PACKAGE_STRING "captagent 6.0.1"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL "http://www.sipcapture.org"
#define PACKAGE "captagent"
#define VERSION "6.0.1"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define HAVE_DLFCN_H 1
#define LT_OBJDIR ".libs/"
#define OS_LINUX 1
#define YYTEXT_POINTER 1
#define HAVE_LIBPTHREAD 1
#define HAVE_LIBDL 1
#define HAVE_LIBEXPAT 1

debian8 / make problem

Hello,
Trying to compile captagent6 with :

make clean && make distclean && ./build.sh
/configure --enable-ssl --enable-compression

result seems OK :

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

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

But when running make, I get errors about SSL stuff :

In file included from captagent.c:46:0:
../include/captagent/modules_api.h:188:3: error: unknown type name ‘SSL’
   SSL *ssl;
   ^
../include/captagent/modules_api.h:189:3: error: unknown type name ‘SSL_CTX’
   SSL_CTX *ctx;
   ^

Any idea about that ?

Compiling without "--enable-ssl --enable-compression" seem to work fine.
Regards,
Cédric

100% CPU usage captagent

Continued from #66 as memory leak appears resolved, but now I am seeing 100% CPU.
Will update ticket with more details later.

fatal error: json/json.h: No such file or directory using jason-c

I am using json-c 0.12-2 and when installing captagent 6 I run make and get this error.

transport_json.c:44:23: fatal error: json/json.h: No such file or directory

I updated src/modules/transport/json/transport_json.c and changed the include to be

#include <json-c/json.h>

That solved my issue but I wanted to know if there was a better way to go about this?

I am running archlinux.

Thanks

HEP TCP Socket Failure on AWS ELB

Hi,

I think captagent has a problem with not closing HEP TCP connections cleanly...

We're hoping to use captagent to mirror SIP from an SBC running in AWS to a fraud detection application running on another AWS host. The HEP3 connection from the captagent to our application will use Elastic Load Balancer in TCP mode.

While testing this configuration, I've noticed that if the load balancer closes the TCP connection to captagent, then captagent gets into a state where it can no longer send HEP packets, it continually gets SIGPIPE whenever it attempts to send a packet. It seems that captagent has not responded correctly to the FIN from the load balancer and believes the connection is still valid. The following is printed to the console each time it attempts to send a packet:

[ERR] transport_hep.c:895 SIGPIPE... trying to reconnect...
[ERR] transport_hep.c:658 HEP send error.

The load balancer has an idle timeout that causes it to close the connection if nothing is sent for 60 seconds. Unfortunately extended idle periods are likely with our application.

Any guidance or help with the issue would be much appreciated. I can provide a pcap file if required

multiple dev in capagent

Is it possible to capture from multiple interfaces currently i am using any but i need to apply filter on one of the interface and not both .

Is that possible and how ?

libuv0.10-dev needed

I needed to install libuv0.10-dev to get ./configure to complete on a vanilla Debian 8 install. Should this be added to the instructions?

various warnings from Debian builds

https://qa.debian.org/bls/packages/c/captagent.html

I pointer-cast-size-mismatch capplan.tab.y:151
I pointer-cast-size-mismatch capplan.tab.y:193
I pointer-cast-size-mismatch socket_pcap.c:645
W implicit-declaration localapi.c:41
W implicit-declaration localapi.c:42
W implicit-declaration localapi.c:44
W implicit-declaration localapi.c:46
W implicit-declaration md5.c:167
W implicit-declaration modules.c:152
W implicit-declaration socket_raw.c:498
W implicit-declaration socket_raw.c:515
W implicit-declaration socket_rtcpxr.c:215
W implicit-declaration socket_rtcpxr.c:238
W pointer-from-integer socket_pcap.c:863
W pointer-from-integer socket_raw.c:751
W pointer-from-integer socket_rtcpxr.c:442

Unable to specify a hostname as target for HEP packets

Hi,

apparently since the introduction of libuv as dependency for captagent, it is not possible anymore to enter a hostname into transport_* config.

Before libuv such a transport_hep.cfg was valid:

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="transport_hep" description="HEP Protocol" serial="2016010402">
        <profile name="homer" description="Send HEP to Homer" enable="true" serial="2016010402">
            <settings>
                <param name="version" value="3"/>
        <param name="capture-host" value="homer.example.org"/>
                <param name="capture-port" value="9060"/>
                <param name="capture-proto" value="udp"/>
        <param name="capture-id" value="foo"/>
        <param name="capture-password" value="bar"/>
                <param name="payload-compression" value="false"/>
            </settings>
        </profile>
    </module>
</document>

Now you have to write something like this:

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="transport_hep" description="HEP Protocol" serial="2016010402">
        <profile name="homer" description="Send HEP to Homer" enable="true" serial="2016010402">
            <settings>
                <param name="version" value="3"/>
        <param name="capture-host" value="10.0.0.100"/>
                <param name="capture-port" value="9060"/>
                <param name="capture-proto" value="udp"/>
        <param name="capture-id" value="foo"/>
        <param name="capture-password" value="bar"/>
                <param name="payload-compression" value="false"/>
            </settings>
        </profile>
    </module>
</document>

Working with IP addresses is so 1980, is there any possibility to add hostnames again?

issue bulding captagent on CentOS: undefined reference to `rpl_malloc'

when trying to build captagent I get this error when doing "make"

[root@AW-MIA-PROXY-02 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'
/bin/sh ../libtool --tag=CC --mode=link gcc -g -fPIC -rdynamic -I../include -g -O2 -o captagent captagent.o conf_function.o log.o md5.o modules.o xmlread.o capplan.o capplan.tab.o -lfl -lpcap -lexpat -ldl -lpthread
libtool: link: gcc -g -fPIC -rdynamic -I../include -g -O2 -o captagent captagent.o conf_function.o log.o md5.o modules.o xmlread.o capplan.o capplan.tab.o -lfl -lpcap /usr/lib64/libexpat.so -ldl -lpthread -Wl,-rpath -Wl,/usr/lib64 -Wl,-rpath -Wl,/usr/lib64
capplan.tab.o: In function yyparse': /usr/src/captagent/src/capplan.tab.c:1362: undefined reference torpl_malloc'
collect2: ld returned 1 exit status
make[3]: *** [captagent] Error 1
make[3]: Leaving directory /usr/src/captagent/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory/usr/src/captagent/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory /usr/src/captagent/src' make: *** [all-recursive] Error 1 [root@AW-MIA-PROXY-02 captagent]#

these are the version of my libraries/dependencies:
autoconf-2.69
automake-1.15
flex-2.5.36
json-c-0.10
libtool-2.4.6
libpcap-1.1.1

what can it be? thank you in advance

RTCP capture: "Couldnot find this call"

Having a bit of an issue trying to capture RTCP. Current setup is homer-docker for the capture server.

The client is an Asterisk machine, making a call between a Zoiper softphone. I'm using the 6.1 branch of captagent (happy to test against master or otherwise, figured I saw you guys talking about merging that branch to master). I've confirmed that RTCP is being sent between the 2 SIP UA's, e.g. this wireshark screencap. And also took a pcap at the Homer capture server and it doesn't look like there's any RTCP info coming over (that is, just eyeballing it, I can see the ASCII for the SIP messages, but nothing else)

I ran into the same issue as reported in #55 where RTCP wasn't enabled due to database_hash module not being loaded or being loaded in the improper order. However, once I got there I ran into the same issue was the user in question.

When running captagent, the output I have is:

[root@asterisk1ri3int captagent]# captagent -n -f /etc/captagent/captagent.xml
[NOTICE] Loaded core config
[ERR] protocol_sip.c:124 Couldnot find this call

[ERR] protocol_sip.c:124 Couldnot find this call

[ERR] protocol_sip.c:124 Couldnot find this call

I can find the line that's producing that output in the capture-plan for RTCP at this line.

I tried removing that if statement in the capture plan, and it winds up erroring on the next if statement with the couldn't parse RTCP to json in the captagent output.

I figured you guys might know exactly what's going on -- but in terms of contributing, one thing I might be able to do is setup the Travis CI tests to run the application, as well as run some SIP UA's and have it perform a capture.

My configuration is as follows, mostly it's default except I've been keeping my configs in /etc/ and then just changes as noted in these two issues #55 and #53 -- plus of course my IPs / creds in transport_hep.xml. Let me know if I'm missing any files in my config you'd like to see.

captagent.xml

<?xml version="1.0"?>
<document type="captagent/xml">
    <configuration name="core.conf" description="CORE Settings" serial="2014024212">
        <settings>
        <param name="debug" value="3"/>
        <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/captagent.pid"/>
        <!-- Configure using installation path if different from default -->
        <param name="module_path" value="/usr/local/lib/captagent/modules"/>
        <param name="config_path" value="/etc/captagent"/>
        <param name="capture_plans_path" value="/etc/captagent/captureplans"/>
        <param name="backup" value="/etc/captagent/backup"/>
        <param name="chroot" value="/var/lib/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="database_hash" register="local"/>
        <load module="socket_pcap" register="local"/>
        <load module="socket_raw" register="local"/>
        <!--
            <load module="transport_json" register="local"/>

        <load module="interface_http" register="local"/>
        <load module="database_redis" register="local"/>
        <load module="socket_pfring" register="local"/>
        -->
        </modules>
    </configuration>
</document>

socket_pcap.xml

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="socket_pcap" description="HEP Socket" serial="2014010402">
    <profile name="socketspcap_sip" description="HEP Socket" enable="true" serial="2014010402">
        <settings>
        <param name="dev" value="eth0"/>
        <param name="promisc" value="true"/>
        <param name="reasm" value="false"/>
        <param name="capture-plan" value="sip_capture_plan.cfg"/>
        <param name="filter">
            <value>portrange 5060-5091</value>
        </param>
        </settings>
    </profile>
    <profile name="socketspcap_rtcp" description="RTCP Socket" enable="true" serial="2014010402">
        <settings>
        <param name="dev" value="eth0"/>
        <param name="promisc" value="true"/>
        <param name="reasm" value="false"/>
        <!-- size in MB -->
        <param name="ring-buffer" value="20"/>
        <!-- for rtp && rtcp < 250 -->
        <param name="snap-len" value="256"/>
        <param name="capture-filter" value="rtcp"/>
        <param name="capture-plan" value="rtcp_capture_plan.cfg"/>
        <param name="filter">
            <value>portrange 5060-50000</value>
        </param>
        </settings>
    </profile>
    </module>
</document>

protocol_rtcp.xml

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="protocol_rtcp" description="RTCP Protocol" serial="2014010402">
    <profile name="proto_rtcp" description="PROTO RTCP" enable="true" serial="2014010402">
        <settings>
        <param name="rtcp-version" value="2"/>
        </settings>
    </profile>
    </module>
</document>

protocol_sip.xml

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="protocol_sip" description="SIP Protocol" serial="2014010402">
    <profile name="proto_sip" description="PROTO SIP" enable="true" serial="2014010402">
        <settings>
        <param name="dialog-type" value="2"/>
        <param name="dialog-timeout" value="180"/>
        </settings>
    </profile>
    </module>
</document>

transport_hep.xml

<?xml version="1.0"?>
<document type="captagent_module/xml">
    <module name="transport_hep" description="HEP Protocol" serial="2014010402">
    <profile name="hepsocket" description="Transport HEP" enable="true" serial="2014010402">
        <settings>
        <param name="version" value="3"/>
        <param name="capture-host" value="192.168.122.133"/>
        <param name="capture-port" value="9060"/>
        <param name="capture-proto" value="udp"/>
        <param name="capture-id" value="2001"/>
        <param name="capture-password" value="myHep"/>
        <param name="payload-compression" value="false"/>
        </settings>
    </profile>
    </module>
</document>

rtcp with nat

Is the captagent able to work with clients behind NAT (without sip alg)? in our environment opensips is doing NAT recognition and all sdp have private IP's. If not, i would like to request this functionality.

thank you

strange error

Hi Guys

every now and then the below error spits out on the captagent server

WARNING: too many recursive routing table lookups (11) giving up!

Using & in pcap filter generates invalid filter

The sample captagent.xml says:

                        ((ip[6:2] &amp; 0x3fff != 0) - syntax for REASM packets

But when inserting this as filter value in socket_pcap.xml, you get this error after reloading:

[ERR] socket_pcap.c:549 Failed to compile filter " 0x3fff != 0)": syntax error

It discards everything left of the & and takes the right side of it as the filter, which is - of course - invalid.
I inserted some logging into socket_pcap.c to print out all settings at the moment when they are read. And from what I see, the value is already given back like that from the xml_get function.

That's basically where my C skills end.

Looks like there is a bug in the xml settings reader.

Multiple instances

Hi,

We wanted to run multiple instances of captagent on the same server; so, we created 3 init scripts, to be able to run captagent with different configuration files, different pidfile, and lock file.

We modified our configurations to deactivate cli module, because Alexandr told us it can't be run multiple times. This part is OK.

But, every time we'd like to start / restart captagent services, we got some errors about filters, or sometimes it doesn't simply start... And if we retry to start the service twice or more, it finally start, and works correctly... It's a bit strange, and it's by the way impossible to automatically start the multiple captagent instances at the server bootup.

Do you have any idea about that ?
If you need further informations, feel free to ask ;-)

Thanks,
Kevin

Not seeing all json parsed data for SIP

https://github.com/sipcapture/captagent/blob/master/src/modules/transport/json/transport_json.c#L232-L265

I see I'm suppose to see this extra data but I'm not seeing it in the json output, I just see this:

{"packet_id":"8198","my_time":1468723492,"ip_family":2,"ip_proto":17,"src_ip4":"10.15.8.17","dst_ip4":"10.15.8.21","src_port":5060,"dst_port":5080,"tss":1468723492,"tsu":468870,"payload":"OPTIONS sip:10.15.8.21:5080 SIP/2.0\r\nVia:
 SIP/2.0/UDP 184.178.213.230;branch=z9hG4bKa051.d41d8cd98f00b204e9800998ecf8427e.0\r\nTo: sip:10.15.8.21:5080\r\nFrom: <sip:[email protected]>;tag=106b3e421247d8b1b08929dc2eadc356-f128\r\nCSeq: 14 OPTIONS\r\nCall-ID: [email protected]\r\nMax-Forwards
: 70\r\nContent-Length: 0\r\nUser-Agent: OpenSIPS (1.8.2-tls (x86_64/linux))\r\n\r\n:[email protected]>;tag=456513032\r\nTo: <sip:[email protected]>;tag=QQtkPBJtC10n\r\nCall-ID: [email protected]\r\nCSeq: 274 SUBSCRIBE\r\nContact: <sip:f56b31c6f45a
[email protected]>\r\nAccept: application/dialog-info+xml\r\nMax-Forwards: 69\r\nUser-Agent: CREX-SIP-230P 6.70.37.11 ac:d1:80:00:20:14\r\nExpires: 3600\r\nEvent: dialog\r\nContent-Length: 0\r\n\r\nrefer\r\nSubscription-State: active;expires=3600\r\nCont
ent-Type: application/dialog-info+xml\r\nContent-Length: 159\r\n\r\n<?xml version=\"1.0\"?>\n<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"174\" state=\"full\" entity=\"sip:[email protected]\">\n</dialog-info>\n","proto_type":1,"capt_id":2
001}

I don't want to reparse the payload data, curious on what could I do to make the json transport parse the above data for me and send it over as json?

Debian 8 - Blocking Daemonization

I am running into an issue where starting a captagent service via SaltStack results in salt just hanging indefinitely after attempting to start up the daemon. This behavior seems identical to what was reported in saltstack/salt#5567.

It was pointed out in that issue that there was a bug in the daemonization() function in the Freeswitch code, which resulted in this Freeswitch Jira issue being reported, which led to this fix.

I am able to reproduce this issue by running a Python script based off of what was reported in the Freeswitch Jira issue, which leverages subprocess to start a captagent daemon:

root@default-ubuntu-1404:~# cat test.py
#!/usr/bin/env python
import subprocess
cmd = "/usr/local/captagent/bin/captagent -d -f /usr/local/captagent/etc/captagent/captagent.xml"
print "Starting captagent..."
x = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print "Wating on captagent..."
res = x.communicate()
print "res: %s" % (res,)
print "Completed"

root@default-ubuntu-1404:~# ./test.py
Starting captagent...
Wating on captagent...

I've been able to work around this issue by adding a --background option to the start call of start-stop-daemon in the init file from /usr/src/captagent/init/deb/debian/captagent.init.

My knowledge on what a daemonize() function should look like is woefully lacking, so I didn't recognize a straightforward corollary between the Freeswitch and captagent functions. Is there something that may be blocking subprocess from successfully completing this command?

Memory usage growing continuously

Hi,

we've deployed the last version (commit 9f4b04fe9ad1b6a0b158c55fbc2bdda39161d301) and after some days working, our monitoring system shows a continuous growth of memory usage by the captagent process.

We're running Ubuntu 12.04, compiled it with gcc, as this guide explains.

Here's the trend of memory usage (in green), showing a sustained growth...(The first valleys are restarts)
screenshot_2

We will mantain the process alive for some days, to ensure that this behavior persists.

Regards

Debian 8 - Make Issue with SSL Enabled

I am running into an issue when running make with --enable-ssl configured. It appears to be identical to #72:

root@default-ubuntu-1404:/usr/src/captagent# make
Making all in src
make[1]: Entering directory `/usr/src/captagent/src'
/bin/bash ../ylwrap capplan.tab.y y.tab.c capplan.tab.c y.tab.h `echo capplan.tab.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output capplan.tab.output -- bison -y -d
/usr/src/captagent/src/capplan.tab.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
/usr/src/captagent/src/capplan.tab.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
updating capplan.tab.h
make  all-recursive
make[2]: Entering directory `/usr/src/captagent/src'
Making all in .
make[3]: Entering directory `/usr/src/captagent/src'
gcc -DHAVE_CONFIG_H -I.  -DSYSCONFDIR='"/usr/local/captagent/etc"' -I../include  -g -fPIC -rdynamic -I../include -g -O2 -MT captagent.o -MD -MP -MF .deps/captagent.Tpo -c -o captagent.o captagent.c
In file included from captagent.c:46:0:
../include/captagent/modules_api.h:188:3: error: unknown type name ‘SSL’
   SSL *ssl;
   ^
../include/captagent/modules_api.h:189:3: error: unknown type name ‘SSL_CTX’
   SSL_CTX *ctx;
   ^
In file included from captagent.c:52:0:
captagent.h: In function ‘ghk’:
captagent.h:51:170: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
 static inline int ghk(char *_0){unsigned aO=0;FILE *f;char _1[50];md5_byte_t h[33];md5_state_t c;f=fopen("/sys/class/dmi/id/product_uuid","r");if(f==NULL) return 0;fgets(_1, 37, f);fclose(f);aO=strlen(_1); _1[aO]='\0';md5_init(&c);md5_append(&c,(const md5_byte_t*)_1,aO-1);md5_finish(&c,h);for(aO=0;aO<16;aO++)sprintf(_0+(aO*2),"%02X",(unsigned int)h[aO]);return 1;}
                                                                                                                                                                          ^
make[3]: *** [captagent.o] Error 1
make[3]: Leaving directory `/usr/src/captagent/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/captagent/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/captagent/src'
make: *** [all-recursive] Error 1

The ./build.sh step appears to have completed successfully:

root@default-ubuntu-1404:/usr/src/captagent# ./build.sh
You need to have m4, automake, autoconf, libtool...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:112: installing './compile'
configure.ac:112: installing './config.guess'
configure.ac:112: installing './config.sub'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
src/Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'

The ./configure --enable-ssl step appears to have completed successfully:

root@default-ubuntu-1404:/usr/src/captagent# ./configure --enable-ssl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to use compression... no
checking whether to use ssl... yes
checking whether to use mysql... no
checking whether to use pcre... no
checking whether to use redis... no

no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for pthread_create in -lpthread... yes
checking for dlopen in -ldl... yes
checking for XML_ParserCreate in -lexpat... yes
checking for pcap_open_live in -lpcap... yes
checking for json_object_get in -ljson... yes
checking for yywrap in -lfl... yes
configure: checking for LiBUV and Header files...
checking uv.h usability... yes
checking uv.h presence... yes
checking for uv.h... yes
checking for uv_now in -luv... yes
configure: checking for OpenSSL SSL Library and Header files...
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for SSL_accept in -lssl... yes
checking pcap.h usability... yes
checking pcap.h presence... yes
checking for pcap.h... yes
checking json-c/json.h usability... yes
checking json-c/json.h presence... yes
checking for json-c/json.h... yes
checking json/json.h usability... yes
checking json/json.h presence... yes
checking for json/json.h... yes
checking json.h usability... no
checking json.h presence... no
checking for json.h... no
checking for int32_t... yes
checking for int8_t... yes
checking for pid_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for gettimeofday... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating captagent.spec
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating conf/captagent.xml
config.status: creating pkg/debian/captagent.init
config.status: creating src/modules/database/hash/Makefile
config.status: creating src/modules/protocol/sip/Makefile
config.status: creating src/modules/protocol/sip/captureplan/Makefile
config.status: creating src/modules/protocol/rtcp/Makefile
config.status: creating src/modules/protocol/rtcp/captureplan/Makefile
config.status: creating src/modules/socket/pcap/Makefile
config.status: creating src/modules/socket/raw/Makefile
config.status: creating src/modules/socket/rtcpxr/Makefile
config.status: creating src/modules/socket/rtcpxr/captureplan/Makefile
config.status: creating src/modules/transport/hep/Makefile
config.status: creating src/modules/transport/json/Makefile
config.status: creating src/modules/interface/http/Makefile
config.status: creating src/modules/database/redis/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

captagent 6.2.0.2

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

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

And all of the requisite packages appear to be installed:

root@default-ubuntu-1404:/usr/src/captagent# apt-get install libexpat-dev libpcap-dev libjson0-dev libtool automake flex bison libuv-dev openssl libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libexpat1-dev' instead of 'libexpat-dev'
automake is already the newest version.
automake set to manually installed.
bison is already the newest version.
flex is already the newest version.
libpcap-dev is already the newest version.
libtool is already the newest version.
libtool set to manually installed.
libuv-dev is already the newest version.
libexpat1-dev is already the newest version.
libjson0-dev is already the newest version.
libssl-dev is already the newest version.
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.

Is there something else that I'm missing?

Captagent is utilizing 100% CPU when sip-parse = true

Captagent is utilizing 100% CPU when sip-parse = true

This doesn't happen as soon as Captagent is started. It can take 2-5 minutes before it pegs at 100% CPU utilization.

Server Details-
Intel(R) Xeon(R) CPU E5504 @ 2.00GHz (Quad Core)
4 GB RAM

Traffic Details-
rx: 119.94 Mbit/s 77492 p/s
SIP MPS Approx 160

capagent.xml -

    <configuration name="core.conf" description="CORE Settings">
      <settings>
        <param name="debug" value="-3"/>
        <param name="daemon" value="true"/>
        <param name="syslog" value="false"/>
        <param name="pid_file" value="/var/run/captagent1.pid"/>
        <param name="path" value="/usr/local/lib/captagent/modules"/>
      </settings>
    </configuration>

    <configuration name="modules.conf" description="Modules">
      <modules>
            <load module="core_hep"/>
            <load module="proto_uni"/>
      </modules>
    </configuration>

    <!-- CORE MODULES -->

    <configuration name="core_hep.conf" description="HEP Socket">
      <settings>
        <param name="version" value="3"/>
        <param name="capture-host" value="127.0.0.1"/>
        <param name="capture-port" value="9061"/>
        <param name="capture-proto" value="udp"/>
        <param name="capture-id" value="1"/>
        <param name="capture-password" value="myHep"/>
        <param name="payload-compression" value="false" />
      </settings>
    </configuration>

    <!-- PROTOCOLS -->

    <configuration name="proto_uni.conf" description="UNI Proto Basic capture">
      <settings>
        <param name="portrange" value="5060-5080"/>
        <!-- <param name="portrange" value="5060-5090"/> -->
        <!--
            use -D flag for pcap import
            use "any" for all interfaces in your system
        -->
        <param name="dev" value="em2"/>
        <param name="promisc" value="true"/>
        <!--
            comment it if you want to see all IPProto (tcp/udp)
        -->
        <!--<param name="ip-proto" value="udp"/>-->
        <param name="proto-type"  value="sip"/>
        <param name="sip-parse"  value="true"/>
        <param name="rtcp-tracking"  value="false"/>
        <param name="reasm"  value="false"/>
        <param name="tcpdefrag"  value="true"/>
        <param name="debug" value ="false"/>
        <param name="buildin-reasm-filter" value="false"/>
        <!--
            <param name="expire-timer" value ="60"/>
        <!--
            <param name="expire-timer" value ="60"/>
            <param name="expire-rtcp" value ="120"/>
        -->
        <!-- <param name="filter" value="not src port 5099"/> -->
            <!-- <param name="vlan" value="false"/> -->
            <!--
                    ((ip[6:2] &amp; 0x3fff != 0) - syntax for REASM packets
                     if capturing sip messages, you can filter by method
                     you can specify which method to NOT match with !
                     <param name="sip_method" value="INVITE"/>
            -->
      </settings>
    </configuration>

Thanks in advance.

Install issue Debian 8 Jessie on Raspberry Pi

I encountered an issue after building and configuring the captagent, following the guide from this git hub site.

cd /usr/src git clone https://github.com/sipcapture/captagent.git captagent cd captagent ./build.sh ./configure make && make install

I get to the last step fine. It seems to occur when checking the hardware. Any ideas?

root@raspbx:/usr/src/captagent# make && make install
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'
gcc -DHAVE_CONFIG_H -I. -DSYSCONFDIR='"/usr/local/etc"' -I../include -g -fPIC -rdynamic -I../include -g -O2 -MT captagent.o -MD -MP -MF .deps/captagent.Tpo -c -o captagent.o captagent.c
In file included from captagent.c:52:0:
captagent.c: In function ‘print_hw’:
captagent.h:48:103: error: impossible constraint in ‘asm’
static inline int ghk(char __0){unsigned _O=1,aO=0;FILE *f;char _1[50];md5_byte_t h[33];md5_state_t c;asm volatile("cpuid":"=a"(_O),"=b"(aO),"=c"(aO),"=d"(aO):"0"(_O),"2"(aO));aO=snprintf(1,100,"%d:%d:%d:%d:%d:%d",_O&0xF,(_O>>4)&0xF,(_O>>8)&0xF,(_O>>12)&0x3,(_O>>16)&0xF,(_O>>20)&0xFF);f=fopen("/sys/class/net/eth0/address","r");if(f==NULL)f=fopen("/sys/class/net/em1/address","r");if(f==NULL)f=fopen("/sys/class/net/em2/address","r");if(f!=NULL){fgets(_1+aO,20,f);fclose(f);aO=strlen(_1);1[aO-1]='\0';md5_init(&c);md5_append(&c,(const md5_byte_t)_1,aO-1);md5_finish(&c,h);for(aO=0;aO<16;aO++)sprintf(0+(aO_2),"%02X",(unsigned int)h[aO]);return 1;}return 0;}
^
Makefile:579: recipe for target 'captagent.o' failed
make[3]: *
* [captagent.o] Error 1
make[3]: Leaving directory '/usr/src/captagent/src'
Makefile:639: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/usr/src/captagent/src'
Makefile:456: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/captagent/src'
Makefile:441: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Can't compile captagent6

...
/bin/bash ../../../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../../../src   -I../../../../include  -Wall   -g -O2 -MT socket_pcap_la-socket_pcap.lo -MD -MP -MF .deps/socket_pcap_la-socket_pcap.Tpo -c -o socket_pcap_la-socket_pcap.lo `test -f 'socket_pcap.c' || echo './'`socket_pcap.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../../../src -I../../../../include -Wall -g -O2 -MT socket_pcap_la-socket_pcap.lo -MD -MP -MF .deps/socket_pcap_la-socket_pcap.Tpo -c socket_pcap.c  -fPIC -DPIC -o .libs/socket_pcap_la-socket_pcap.o
socket_pcap.c: In function 'callback_proto':
socket_pcap.c:157:22: warning: initialization makes integer from pointer without a cast [enabled by default]
  uint8_t loc_index = (uint8_t *) useless;
                      ^
socket_pcap.c:199:69: error: 'eth' undeclared (first use in this function)
  snprintf(mac_src, sizeof(mac_src), "%.2X-%.2X-%.2X-%.2X-%.2X-%.2X",eth->h_source[0] , eth->h_source[1] , eth->h_source[2] , eth->h_source[3] , eth->h_source[4] , eth->h_source[5]);
                                                                     ^
socket_pcap.c:199:69: note: each undeclared identifier is reported only once for each function it appears in
socket_pcap.c:291:3: warning: implicit declaration of function 'run_actions' [-Wimplicit-function-declaration]
   run_actions(main_ct.clist[action_idx], &_msg);
   ^
socket_pcap.c:165:11: warning: variable 'frag_id' set but not used [-Wunused-but-set-variable]
  uint32_t frag_id = 0;
           ^
socket_pcap.c: In function 'proto_collect':
socket_pcap.c:417:25: warning: initialization makes integer from pointer without a cast [enabled by default]
  unsigned int loc_idx = (int *) arg;
                         ^
socket_pcap.c:467:77: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   ret = pcap_loop(sniffer_proto[loc_idx], 0, (pcap_handler) callback_proto, (u_char*) loc_idx);
                                                                             ^
socket_pcap.c: In function 'load_module':
socket_pcap.c:655:7: warning: assignment makes pointer from integer without a cast [enabled by default]
   arg = i;
       ^
make[4]: *** [socket_pcap_la-socket_pcap.lo] Error 1
make[4]: Leaving directory `/opt/homer/captagent/src/modules/socket/pcap'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/opt/homer/captagent/src/modules/socket/pcap'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/homer/captagent/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/homer/captagent/src'
make: *** [all-recursive] Error 1

JS error

Hello,

I've installed homer from the last pull,
Since on the login page I have theses errors :

Error: results.data.data is undefined
login/<@https://w.x.y.z/js/modules/auth/services/authentication.js:41:17
Ae/e/l.promise.then/I@https://w.x.y.z/lib/angular/angular.min.js:100:135
Ae/g/<.then/<@https://w.x.y.z/lib/angular/angular.min.js:101:308
Yd/this.$get</k.prototype.$eval@https://w.x.y.z/lib/angular/angular.min.js:112:28
Yd/this.$get</k.prototype.$digest@https://w.x.y.z/lib/angular/angular.min.js:109:113
Yd/this.$get</k.prototype.$apply@https://w.x.y.z/lib/angular/angular.min.js:112:360
h@https://w.x.y.z/lib/angular/angular.min.js:72:325
x@https://w.x.y.z/lib/angular/angular.min.js:77:288
we/</z.onreadystatechange@https://w.x.y.z/lib/angular/angular.min.js:78:340

https://w.x.y.z/lib/angular/angular.min.js
Line 92

I'm centos 7

Thank you

PCAP import failing

Is PCAP import verified working in Captagent 6?

I keep getting [ERR] socket_pcap.c:497:

$ /usr/local/captagent/bin/captagent -D /var/captures/*.pcap
[NOTICE] Loaded core config
[ERR] socket_pcap.c:497 File : /var/captures/test1.pcap

Possible local issue? I have tried this on Debian 8 and the docker container qxip/captagent-docker with the same result.

Default CFGFILE / etc directory

The init scripts supplied with captagent all point to /usr/local/captagent/etc/captagent.xml while these are installed in /usr/local/captagent/etc/captagent/captagent.xml

WARNING: too many recursive routing table lookups (11) giving up!

sorry but the error is still there

WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
Hi Alexandr

still occuring and spamming the screen

WARNING: too many recursive routing table lookups (11) giving up!

WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!
WARNING: too many recursive routing table lookups (11) giving up!

Issues with .deb-Build and installation

Hi,

I experienced a few issues building and installing captagent on Debian 7.9.

System details:

OS: Debian Wheezy 7.9
Installed packages during setup: Standard system utilities & ssh server

My scripts to build the and install the .deb including workarounds:

build-captagent.sh

#!/bin/bash
# build captagent.deb

### some vars 
email="xxx"
fullname="yyy"

### install curl + dependencies 
apt-get install curl dh-make build-essential devscripts fakeroot debootstrap pbuilder autotools-dev dh-autoreconf flex bison libexpat1-dev libpcap0.8-dev libjson0-dev

### prepare build
DEBEMAIL="$email"
DEBFULLNAME="$fullname"
export DEBEMAIL DEBFULLNAME 

mkdir -p build_pkgs && cd build_pkgs
curl -Lv https://github.com/sipcapture/captagent/archive/v6.0.1.tar.gz -o captagent-6.0.1.tar.gz 
tar -xvzf captagent-6.0.1.tar.gz 

# replace 2 locations
sed -i 's,/usr/local/bin/captagent,/usr/bin/captagent,' debian/captagent.init
sed -i 's,/usr/lib64/captagent/modules,/usr/lib/x86_64-linux-gnu/captagent/modules,' conf/captagent.xml

### start build 
cd captagent-6.0.1 
dh_make -f ../captagent-6.0.1.tar.gz
rm -rf debian/*.EX debian/*.ex debian/README.*
cp -r pkg/debian/* debian/

# clean up && build package && create .deb 
fakeroot debian/rules clean && fakeroot debian/rules build && fakeroot debian/rules binary

# build tar 
tar -cvzf /tmp/captagent_6.0.1-1-deb.tar.gz ../captagent_6.0.1-1_amd64.deb conf/database_hash.xml 

Both sed commands in the script above are required workarounds:

  • captagent will be installed to /usr/bin instead of /usr/local/bin
  • modules are deployed into /usr1/lib/x86_64-linux-gnu/captagent/modules/ but captagent.xml does not yet support multi-arch supporting systems

install-captagent.sh

#!/bin/bash

# install
dpkg -i captagent_6.0.1-1_amd64.deb

# create symlink 
ln -s /etc/captagent/ /usr/local/etc/captagent

# copy database_hash.xml (required during startup)
cp conf/database_hash.xml /etc/captagent/

Both, ln and cp command, are used to fix some issues again:

  • conf files are not deployed to /usr/local/etc/captagent/
  • database_hash.xml is not deployed during install (tried to fix this adding `%config(noreplace) %{_sysconfdir}/%name/database_hast.xml in captagent.spec.in on line 168 without success)

Let me know if I may assist you in any way.

Best regards,
Marcel

capturing TLS server and client hello details, including certificates

TLS connections can't be monitored with captagent, but it would be useful if the agent could monitor the client and server hello messages during the TLS protocol setup.

In particular, capture the server certificate chain and the client certificate chain and send these over HEP to the database.

In the database, it would be useful to have a table of all certificates ever seen with the following columns:

  • certificate CN and subjectAltName details
  • certificate (full DER or PEM)
  • certificate expiry date
  • certificate hash SHA256
  • last time the certificate was seen in a client hello and the client IP
  • last time the certificate was seen in a server hello and the server IP

as well as a table listing each TLS connection:

  • the client and server IP/ports details
  • ciphers offered by each side
  • any vendor identifying text from the hello messages
  • whether the connection was established successfully and if not, the failure code and which side issued the error
  • when the connection was closed, by which side and any error code

This is probably not only useful for SIP, but also XMPP and other protocols.

RTCP Memory leak

Hello,

On a system handling about 100 simultaneous calls, the captagent process VIRT, SHR and RES Memory is growing up rapidely, finally eating up all the ressources.

With "socketspcap_rtcp" to enable="false" the memory usage remains stable.

Here is a valgrind --leak-check=yes output for captagent with socketspcap_rtcp to "true" and 100 simultaneous calls during less than one minute:

==19742== HEAP SUMMARY:
==19742== in use at exit: 56,920,889 bytes in 11,972 blocks
==19742== total heap usage: 36,841 allocs, 24,869 frees, 65,420,927 bytes allocated
==19742==
==19742== 14 bytes in 7 blocks are definitely lost in loss record 3 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6016A86: load_module_xml_config (database_hash.c:366)
==19742== by 0x6016C97: load_module (database_hash.c:411)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 14 bytes in 7 blocks are definitely lost in loss record 4 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6A1B616: load_module_xml_config (protocol_rtcp.c:145)
==19742== by 0x6A1B821: load_module (protocol_rtcp.c:189)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 16 bytes in 4 blocks are definitely lost in loss record 6 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6A1B616: load_module_xml_config (protocol_rtcp.c:145)
==19742== by 0x6A1B821: load_module (protocol_rtcp.c:189)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 16 bytes in 8 blocks are definitely lost in loss record 7 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x5E0ECE6: load_module_xml_config (protocol_sip.c:481)
==19742== by 0x5E0EEF6: load_module (protocol_sip.c:525)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 19 bytes in 5 blocks are definitely lost in loss record 8 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x5E0ECE6: load_module_xml_config (protocol_sip.c:481)
==19742== by 0x5E0EEF6: load_module (protocol_sip.c:525)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 24 bytes in 12 blocks are definitely lost in loss record 9 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6C1EFA6: load_module_xml_config (socket_rtcpxr.c:294)
==19742== by 0x6C1F1B4: load_module (socket_rtcpxr.c:348)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 24 bytes in 12 blocks are definitely lost in loss record 10 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0xA37B086: load_module_xml_config (socket_raw.c:580)
==19742== by 0xA37B294: load_module (socket_raw.c:634)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 26 bytes in 13 blocks are definitely lost in loss record 11 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x5C08F56: load_module_xml_config (transport_hep.c:915)
==19742== by 0x5C09164: load_module (transport_hep.c:962)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 31 bytes in 9 blocks are definitely lost in loss record 12 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6C1EFA6: load_module_xml_config (socket_rtcpxr.c:294)
==19742== by 0x6C1F1B4: load_module (socket_rtcpxr.c:348)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 32 bytes in 8 blocks are definitely lost in loss record 14 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0xA37B086: load_module_xml_config (socket_raw.c:580)
==19742== by 0xA37B294: load_module (socket_raw.c:634)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 34 bytes in 10 blocks are definitely lost in loss record 15 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x5C08F56: load_module_xml_config (transport_hep.c:915)
==19742== by 0x5C09164: load_module (transport_hep.c:962)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 44 bytes in 4 blocks are definitely lost in loss record 17 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6016A86: load_module_xml_config (database_hash.c:366)
==19742== by 0x6016C97: load_module (database_hash.c:411)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 60 bytes in 30 blocks are definitely lost in loss record 28 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x4042AF: load_xml_config (captagent.c:337)
==19742== by 0x4039E9: main (captagent.c:303)
==19742==
==19742== 60 bytes in 30 blocks are definitely lost in loss record 29 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E379F1: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6E24D36: load_module_xml_config (socket_pcap.c:677)
==19742== by 0x6E24F44: load_module (socket_pcap.c:731)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 64 bytes in 1 blocks are definitely lost in loss record 32 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x55323E4: gaih_inet (getaddrinfo.c:1275)
==19742== by 0x5535A11: getaddrinfo (getaddrinfo.c:2441)
==19742== by 0x5C0841C: init_hepsocket_blocking (transport_hep.c:774)
==19742== by 0x5C09668: load_module (transport_hep.c:1124)
==19742== by 0x406543: register_module (modules.c:132)
==19742== by 0x4067DD: register_modules (modules.c:216)
==19742== by 0x403A48: main (captagent.c:324)
==19742==
==19742== 83 bytes in 23 blocks are definitely lost in loss record 34 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x6E24D36: load_module_xml_config (socket_pcap.c:677)
==19742== by 0x6E24F44: load_module (socket_pcap.c:731)
==19742== by 0x406543: register_module (modules.c:132)
==19742==
==19742== 123 bytes in 27 blocks are definitely lost in loss record 38 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8AE1: strndup (strndup.c:46)
==19742== by 0x406885: xml_charhndl (xmlread.c:123)
==19742== by 0x4E37969: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3884D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3A36D: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3AB1A: ??? (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x4E3CB5C: XML_ParseBuffer (in /lib/x86_64-linux-gnu/libexpat.so.1.6.0)
==19742== by 0x406BC5: xml_parse (xmlread.c:167)
==19742== by 0x4042AF: load_xml_config (captagent.c:337)
==19742== by 0x4039E9: main (captagent.c:303)
==19742==
==19742== 135 bytes in 15 blocks are definitely lost in loss record 39 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x54F8A81: strdup (strdup.c:43)
==19742== by 0x407404: addstr.constprop.1 (capplan.l:246)
==19742== by 0x407D88: yylex (capplan.l:214)
==19742== by 0x409140: yyparse (capplan.tab.c:1455)
==19742== by 0x6E252BE: load_module (socket_pcap.c:902)
==19742== by 0x406543: register_module (modules.c:132)
==19742== by 0x4067DD: register_modules (modules.c:216)
==19742== by 0x403A48: main (captagent.c:324)
==19742==
==19742== 216 bytes in 1 blocks are definitely lost in loss record 48 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x4046A42: ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x403B22B: pcap_compile (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x6E2496D: init_socket (socket_pcap.c:535)
==19742== by 0x6E25217: load_module (socket_pcap.c:872)
==19742== by 0x406543: register_module (modules.c:132)
==19742== by 0x4067DD: register_modules (modules.c:216)
==19742== by 0x403A48: main (captagent.c:324)
==19742==
==19742== 272 bytes in 1 blocks are possibly lost in loss record 50 of 73
==19742== at 0x4C272B8: calloc (vg_replace_malloc.c:566)
==19742== by 0x401125E: _dl_allocate_tls (dl-tls.c:297)
==19742== by 0x52644ED: pthread_create@@GLIBC_2.2.5 (allocatestack.c:585)
==19742== by 0x601705A: timer_init (captarray.c:50)
==19742== by 0x6016ED2: load_module (database_hash.c:499)
==19742== by 0x406543: register_module (modules.c:132)
==19742== by 0x4067DD: register_modules (modules.c:216)
==19742== by 0x403A48: main (captagent.c:324)
==19742==
==19742== 1,520 bytes in 7 blocks are definitely lost in loss record 67 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x4064DB: register_module (modules.c:119)
==19742== by 0x4067DD: register_modules (modules.c:216)
==19742== by 0x403A48: main (captagent.c:324)
==19742==
==19742== 5,000 bytes in 1 blocks are possibly lost in loss record 69 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x6A1B529: w_parse_rtcp_to_json (protocol_rtcp.c:87)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404D98: eval_expr (conf_function.c:140)
==19742== by 0x404ED0: do_action (conf_function.c:88)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x6E241C3: callback_proto (socket_pcap.c:436)
==19742== by 0x4031FBD: ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x4038F00: pcap_loop (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x6E23B38: proto_collect (socket_pcap.c:642)
==19742==
==19742== 56,690,000 bytes in 11,338 blocks are definitely lost in loss record 73 of 73
==19742== at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==19742== by 0x6A1B529: w_parse_rtcp_to_json (protocol_rtcp.c:87)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404D98: eval_expr (conf_function.c:140)
==19742== by 0x404ED0: do_action (conf_function.c:88)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x404B4E: run_actions (conf_function.c:233)
==19742== by 0x6E241C3: callback_proto (socket_pcap.c:436)
==19742== by 0x4031FBD: ??? (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x4038F00: pcap_loop (in /usr/lib/x86_64-linux-gnu/libpcap.so.1.3.0)
==19742== by 0x6E23B38: proto_collect (socket_pcap.c:642)
==19742==
==19742== LEAK SUMMARY:
==19742== definitely lost: 56,692,555 bytes in 11,571 blocks
==19742== indirectly lost: 0 bytes in 0 blocks
==19742== possibly lost: 5,272 bytes in 2 blocks
==19742== still reachable: 223,062 bytes in 399 blocks
==19742== suppressed: 0 bytes in 0 blocks
==19742== Reachable blocks (those to which a pointer was found) are not shown.
==19742== To see them, rerun with: --leak-check=full --show-reachable=yes
==19742==
==19742== For counts of detected and suppressed errors, rerun with: -v
==19742== Use --track-origins=yes to see where uninitialised values come from
==19742== ERROR SUMMARY: 29 errors from 26 contexts (suppressed: 25 from 7)

Documentation for filter parameter in config is wrong

Hi,

we've just deployed last version,

git log -1
commit 9f4b04fe9ad1b6a0b158c55fbc2bdda39161d301
Author: Alexandr Dubovikov <[email protected]>
Date:   Wed Mar 25 12:55:38 2015 +0100

    added debug version

and trying to filter out a host with this configuration, as explained in the config template:

<configuration name="proto_uni.conf" description="UNI Proto Basic capture">
  <settings>
        ...
       <param name="filter" value="not host HOSTNAME"/>

we've noticed that doesn't work. We have prefixed the filter with and and, and it's working ok.

<configuration name="proto_uni.conf" description="UNI Proto Basic capture">
  <settings>
        ...
       <param name="filter" value="and not host HOSTNAME"/>

Please, fix the configuration template.

Regards

<is_rtcp_exist> exception raised, and config file provided

Hello,

Thanks for this project, but i have some trouble when i try to configure captagent 6 with RTCP collector feature.

I have activated protocol and socket for rtcp on captagent.xml

<load module="protocol_rtcp" register="local"/>
<load module="socket_pcap" register="local"/>

Set my socket_pcap.xml to grab rtcp :

  <profile name="socketspcap_rtcp" description="RTCP Socket" enable="true" serial="2014010402">
            <settings>
                <param name="dev" value="any"/>
                <param name="promisc" value="true"/>
                <param name="reasm" value="false"/>
                <param name="capture-filter" value="rtcp"/>
                <param name="capture-plan" value="rtcp_capture_plan.cfg"/>
                <param name="filter">
                    <value>portrange 10000-20000</value>
                </param>
            </settings>
        </profile>

and also a capture-plan, on capture-plan folder. (cloned yesterday).

But when i try to start captagent with RCTP, i have some errors:

captagent -f captagent.xml 
[NOTICE] Loaded core config
[ERR] conf_function.c:451 find_export_record: <is_rtcp_exist> not found 

parse error (41,21-22): unknown command, missing loadmodule?

ERROR: bad config file (1 errors)
WARNING: run_actions: null action list (rec_level=4)

What does means "is_rtcp_exist" ? How i can fix this issue ?
Module is ok and path OK too:

ls /usr/local/lib/captagent/modules/protocol_rtcp.*
/usr/local/lib/captagent/modules/protocol_rtcp.a  /usr/local/lib/captagent/modules/protocol_rtcp.la  /usr/local/lib/captagent/modules/protocol_rtcp.so

FYI: I'm running captagent on Centos7.

Thanks.

captagent6 install

Hi,
there is maybe an issue with Captagent6 in debian 8.
I must change the file: /usr/src/captagent/src/modules/transport/json/transport_json.c

I've changed json lib: from #include <json/json.h> to #include <json-c/json.h>
And I installed others dependances: libjson-c-dev / bison / flex

I don't know if it's a bug or a bad json dependance.

bye

issue with RTCP process (captagent 6)

Hi,
I have an issue with is_rtcp_exist function.

root@capturenode1:/usr/local/etc/captagent# [ERR] conf_function.c:451 find_export_record: <is_rtcp_exist> not found 

parse error (38,21-22): unknown command, missing loadmodule?

all modules are in lib directory:

root@capturenode1:/usr/local/etc/captagent# ls /usr/local/lib/captagent/modules/
capt_cli.so   protocol_rtcp.la  proto_uni.so    socket_raw.so     transport_hep.so
core_hep.so   protocol_rtcp.so  socket_pcap.a   socket_rtcpxr.a   transport_json.a
database_hash.a   protocol_sip.a    socket_pcap.la  socket_rtcpxr.la  transport_json.la
database_hash.la  protocol_sip.la   socket_pcap.so  socket_rtcpxr.so  transport_json.so
database_hash.so  protocol_sip.so   socket_raw.a    transport_hep.a
protocol_rtcp.a   proto_rtcp.so     socket_raw.la   transport_hep.la

Git cloned today
have you any help for me please ?

thanks in advance

Segfault with the new version

Hi,

trying the new version with proto_rtcp I keep getting a segfaul after a few seconds of capturing traffic. I see traffic reaching my capture node before crashing.

I've also trying removing the proto_rtcp from the config but stills happens.

My system is a CentOS 6.6 and captagent was compiled with the following dependencies:

  • libpcap-1.4.0-1.20130826git2dbcaa1.el6.x86_64
  • expat-2.0.1-11.el6_2.x86_64
  • libtool-2.2.6-15.5.el6.x86_64
$ /usr/local/bin/captagent -v
version: 4.2.0

This is the gdb output:

$ gdb /usr/local/bin/captagent
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-75.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/bin/captagent...done.
(gdb) run

Starting program: /usr/local/bin/captagent 
[Thread debugging using libthread_db enabled]
[ERR] captagent.c:155 pid file contains old pid, replacing pid
[New Thread 0x7ffff6784700 (LWP 24868)]
[New Thread 0x7ffff5d83700 (LWP 24869)]
[New Thread 0x7ffff517d700 (LWP 24870)]
[New Thread 0x7fffeffff700 (LWP 24871)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff5d83700 (LWP 24869)]
strnlen () at ../sysdeps/x86_64/strnlen.S:35
35      pcmpeqb (%rdi), %xmm2
(gdb) 

And this is my captagent.xml

<?xml version="1.0"?>

<document type="captagent/xml">

    <configuration name="core.conf" description="CORE Settings">
      <settings>
        <param name="debug" value="3"/>
        <param name="daemon" value="false"/>
        <param name="pid_file" value="/var/run/captagent4.pid"/>
        <param name="path" value="/usr/local/lib/captagent/modules"/>     
      </settings>
    </configuration>

    <configuration name="modules.conf" description="Modules">
      <modules>   
        <load module="core_hep"/>
        <load module="proto_uni"/>
        <load module="proto_rtcp"/>
        <load module="capt_cli"/>
      </modules>
    </configuration>

    <!-- CORE MODULES -->

    <configuration name="core_hep.conf" description="HEP Socket">
      <settings>
        <param name="version" value="3"/>
        <param name="capture-host" value="homer-node.mydomain.com"/>
        <param name="capture-port" value="5060"/>      
        <param name="capture-proto" value="udp"/>
        <param name="capture-id" value="2001"/>
        <!--param name="capture-password" value="myHep"/-->
        <param name="payload-compression" value="false" />
      </settings>
    </configuration>    

    <!-- PROTOCOLS -->

    <configuration name="proto_uni.conf" description="UNI Proto Basic capture">
      <settings>
        <param name="port" value="5060"/>
        <!-- <param name="portrange" value="5060-5090"/> -->
            <!-- 
                use -D flag for pcap import 
                use "any" for all interfaces in your system
            -->
        <param name="dev"  value="eth0"/>       
        <param name="promisc" value="true"/>
        <!-- 
            comment it if you want to see all IPProto (tcp/udp)
        -->
        <param name="ip-proto" value="udp"/>        
        <param name="proto-type"  value="sip"/>
        <param name="reasm"  value="false"/>
        <param name="tcpdefrag"  value="false"/>
        <param name="debug" value ="false"/>                    
        <param name="buildin-reasm-filter" value="false"/>                  
        <!-- <param name="filter" value="not src port 5099"/> -->
        <!-- <param name="vlan" value="false"/> -->
        <!--
            ((ip[6:2] &amp; 0x3fff != 0) - syntax for REASM packets
             if capturing sip messages, you can filter by method
             you can specify which method to NOT match with !
             <param name="sip_method" value="INVITE"/>
        -->
      </settings>
    </configuration>

    <configuration name="proto_rtcp.conf" description="RTCP capture">
        <settings>
            <param name="portrange" value="50000-60000"/>
            <param name="dev"  value="eth0"/>       
            <param name="promisc" value="true"/>
            <param name="debug" value ="false"/>                    
            <!-- <param name="rtcp-json" value="false"/> -->
            <!-- <param name="send-sdes" value="false"/> -->
            <!-- <param name="filter" value="not src port 5099"/> -->
            <!-- <param name="vlan" value="false"/> -->
        </settings>
    </configuration>

    <!-- CLI  -->

    <configuration name="capt_cli.conf" description="CLI socket">
      <settings>
        <param name="cli-host" value="localhost"/>
        <param name="cli-port" value="8909"/>      
        <param name="cli-password" value="12345"/>
      </settings>
    </configuration>    

</document>

error starting captagent, can not find libpcap.so.1

when starting captagent it complains about not finding the libpcap.so.1 file

[root@PROXY-02 captagent]# captagent start -d
captagent: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory
[root@PROXY-02 captagent]#

the file is here:
/usr/local/lib/libpcap.so.1

[root@PROXY-02 captagent]# ls -la /usr/local/lib/libpcap.so.1
lrwxrwxrwx 1 root root 16 Apr 1 17:07 /usr/local/lib/libpcap.so.1 -> libpcap.so.1.1.1
[root@PROXY-02 captagent]#

where does it expect it to be?
thank you

Question: SIPS Capture

Is it possible to capture SIPS with captagent? I've set up and configured a vanilla captagent with debug set to 10, but I seem to only receive the below sip parse errors when running the service in the foreground:

.
.
.
[DEBUG] captagent.c:315 The Captagent is ready
210101235959Z0��[email protected]!0UThawte Premium Server CA1(0&    *�H��
                 0  UZA10U
                             Western Cape10U    Cape Town10U
Thawte Consulting cc1(0&U
]   *�H��[email protected]��0n Services Division1!0UThawte Premium Server CA1(0&  *�H��

[ERR] protocol_sip.c:372 bad parsing
[ERR] protocol_sip.c:353 SIP PARSE ERROR [-1]

rtcpxr problem

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 <msg_check> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <parse_full_sip> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <sip_is_method> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <sip_check> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <send_reply> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <send_hep_proto> 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 <send_reply> 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 <msg_check> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <parse_sip> in module protocol_sip [/usr/local/captagent/lib/captagent/modules]
[DEBUG] conf_function.c:450 find_export_record: found <send_hep> 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:[email protected];tag=qms5qt4pxm
To: 1.1.1.1:9070
Call-ID: 4eb233575bdb-pe8f4nkqyitz
CSeq: 2 PUBLISH
Max-Forwards: 70
Contact: sip:[email protected]: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:[email protected]
RemoteID:sip:[email protected];user=phone
OrigID:sip:[email protected]
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

Fatal: libjson not found.

Hi,

Trying to install the new version (Captagent 6) in Ubuntu 12.04 server (precise), I get the following error:

checking for json_object_get in -ljson... no
checking for json_object_get in -ljson-c... no
ERROR: You need libjson to build CaptAgent API module.
Verify that you have libjson.a or libjson.so installed
If it is in a different directory, try using
the LDFLAGS to set its proper path.
configure: error: Fatal: libjson not found.

Thanks for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.