sipcapture / captagent

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

no rtcp sent by captagent #135

Closed mattki closed 7 years ago

mattki commented 7 years ago

I run Ubuntu 16.04.2 and Asterisk 13.15 using only chan_sip and latest homer running on a different host.

Using mostly default captagent config I get sip call detail sent to homer host with no issue.

rtcp does not get sent to homer host but seems to be detected by captagent. I have checked this with ngrep on homer host, and also checked the homer databases and no rtcp rows are inserted.

captagent 6.2.0.2 and homer 5

rtcp_capture_plan.cfg:

capture[pcap] {

    # here we can check source/destination IP/port, message size
    if(msg_check("size", "20")) {

            if(is_rtcp()) {
                    clog("ERROR", "found rtcp matt");
                    #Only for redis!

                    if(is_rtcp_exist()) {

                            #Convert to JSON if needed.
                            if(parse_rtcp_to_json()) {

                                    #Can be defined many profiles in transport_hep.xml
                                    if(!send_hep("hepsocket")) {
                                            clog("ERROR", "Error sending HEP!!!!");
                                    }

                            } else {
                                    clog("ERROR", "couldn't parse RTCP to json");
                            }

                    } else {
                            clog("ERROR", "Couldnot find this call");
                    }
            } else {
                    clog("ERROR", "This is not RTCP");
            }
    }
    drop;

}

sip capture plan:

capture[pcap] {

    # here we can check source/destination IP/port, message size
    if(msg_check("size", "100")) {

        #Do parsing
        if(parse_sip()) {
            #Can be defined many profiles in transport_hep.xml

            if(!send_hep("hepsocket")) {
                clog("ERROR", "Error sending HEP!!!!");
            }

             if(sip_has_sdp())
             {
                    #Activate it for RTCP checks
                    if(!check_rtcp_ipport())
                    {
                            clog("ERROR", "ALREADY EXIST");
                    }
             }

            #Duplicate all INVITEs to JSON transport
            # if(sip_is_method() && sip_check("method","INVITE")) {
            #    #Can be defined many profiles in transport_json.xml
            #    if(!send_json("jsonsocket")) {
            #       clog("ERROR", "Error sending JSON!!!");
            #    }
            # }
        }
    }
    drop;

}

transport_hep.xml:

<?xml version="1.0"?>

protocol_sip.xml:

<?xml version="1.0"?>

captagent.xml:

<?xml version="1.0"?>

protocol_rtcp.xml:

<?xml version="1.0"?>

adubovikov commented 7 years ago

please check your socket_pcap.xml and be sure that the socket profile for rtcp has been activated.

mattki commented 7 years ago

Thank you for the response and the great software!

You're right, just had to change enabled=false to enabled=true for profile socketspcap_rtcp in socket_pcap.xml.

adubovikov commented 7 years ago

ok. you are welcome

agicblack commented 6 years ago

profile name="socketspcap_rtcp" description="RTCP Socket" enable="true" serial="2014010402" but don't work

hoangtuan151 commented 1 year ago

Hi @adubovikov , @lmangani I very much appreciate your fantastic project.

I got the same issue here: the Homer server has not received any QoS reports for media.

Here's my environment:

I have searched on Google for a day and could not find any clue so end up with this question here. Thank you!

kYroL01 commented 1 year ago

First, could you guys @mattki @hoangtuan151 double-check if the SIP and RTCP traffic is correctly ingested to captagent ? Second, you can run captagent in foreground mode to see what's happening in real time with the traffic /usr/local/captagent/sbin/captagent -x 10

Anyway, this error "[ERR] protocol_sip.c:141 Couldnot find this call" is shown when you have the wrong port for SIP - I just tried.

I made a test call and I can see everything is flowing correctly from Captagent to HOMER UI ScreenShot_20230526185047

So I guess something's wrong with your setup. I also suggest you use the latest Captagent version.

Thanks