Skip to content
Lorenzo Mangani edited this page Jan 28, 2016 · 17 revisions

HOMER


FREQUENTLY ASKED QUESTIONS



Having issues setting up or using Homer SIP Capture? No Problem!
Most likely someone raised and solved the same issue before - Enter HOMER'S F.A.Q.


GENERAL FAQ


  • I receive a fatal error while trying to clone GIT repository

Please update your GIT client to the latest version (ie: 1.7.2.5) and try again


  • I see search results, but when i click on a message it shows an empty window

Please upgrade Kamailio to 4.3+ and edit kamailio.cfg as follows :

#For old models. Not accurate insert time. System vs capture time.
#$var(a) = $var(table) + "" + $timef(%Y%m%d);
#for Kamailio >4.3 please uncomment this parameters:
$var(a) = $var(table) + "%Y%m%d";

  • My proxy has both IPv4 and IPv6 addresses and it displays as two separate hosts in Call Flows

Go to Admin > Aliases define both the IPv4 and IPv6 address and for both define the exact same hostname. The V4/V6 flow will now correlate.


  • I'm running more SIP services on the same host and columns in Call Flows are not correctly disaplyed

Please change the following parameter in your preferences:

define('CFLOW_HPORT', 2);

  • I have a B2BUA and I would like to achieve leg correlation in Call-Flow

If your B2B leg are extending/appending the original Call-ID with a suffix (A-Leg: 1234 B-Leg: 1234+suffix) you can enable the following parameters:

define('BLEGCID', "b2b");
define('BLEGTAIL', "-0"); /* session-ID correlation suffix, required for b2b mode */

If your two Call-IDs are completely different, your B2BUA should insert an X-CID: header in the B-Leg, carrying over the A-LEG Call-ID:

define('BLEGCID', "x-cid");

  • If accessing Homer-UI via a locally defined hostname or [IPv6] URL and I see PHP errors related to API calls

Please define the same host/ip aliases on the server running Homer-UI in order for the server to refer itself using the same alias.


  • In Call Flow, the RTP Statistic tab is always empty

RTP Stats in Homer OSS are currently based only on X-RTP/P-RTP stats in BYE messages generated by User-Agents (Fritzbox, Linksys, Sipura, Cisco, Aastra ...). For the P-RTP-Stats string format reference see [https://supportforums.cisco.com/servlet/JiveServlet/downloadBody/18784-102-3-46597/spaPhoneP-RTP-Stat_09292011.pdf here]


  • I use Kamailio/RTPProxy and I would like to generate P-RTP-Stats

Although RTP-Stats are supposed to be generated by the UA/client to be any meaningful, if you are using Kamailio/RTPProxy you can still write pseudo-statistics (minimalistic, as seen from the server-side, NOT client-side) in your BYE messages using the data provided back to Kamailio core by RTPProxy using something as the following basic example in your script:

                        ## P-RTP-Stats snippet for Kamailio/RTPProxy
                        if (is_method("BYE")) {
                                setflag(FLT_ACC); # do accounting ...
                                setflag(FLT_ACCFAILED); # ... even if the transaction fails

                                $var(xrtpstat) = $(rtpstat{s.striptail,1});

                                 # Work the stats
                                 $var(rtp0) = $(var(xrtpstat){s.select,1, });
                                 $var(rtp1) = $(var(xrtpstat){s.select,2, });
                                 $var(rtp2) = $(var(xrtpstat){s.select,3, });
                                 $var(rtp3) = $(var(xrtpstat){s.select,4, });
                                 $var(rtp4) = $(var(xrtpstat){s.select,5, });
                                 if ($var(rtp0) != "" || $var(rtp1) != "")
                                 {
                                 append_hf("P-RTP-Stat:  EX=RTPProxy,PS=$var(rtp0),PR=$var(rtp1),PL=$var(rtp3)\r\n");
                                 }
                        }

HOMER/SIPCAPTURE FAQ


  • I see the following error in syslog:
ERROR: <core> [db.c:79]: module db_mysql does not export db_use_table function 
ERROR: sipcapture [sipcapture.c:323]: unable to bind database module 

This means db_mysql.so was not loaded, likely because the module does not exist on the module's path (mpath) of kamailio.cfg

Please go to kamalio's source directory, modules/db_mysql and check if you have db_mysql.so there. If not, execute in db_mysql:

make
make install

in other scenarios you might have to check the correct mpath in kamailio.cfg and db_mysql.so is on this path.

find /usr/local -type f -name db_mysql.so

  • I use HEP and see kamailio replying with 100 Trying, 200 OK. Why is that?

The messages have been replied to by onreply_route; To disable replies, adjust your kamailio.cfg as follows:

onreply_route {
     sip_capture();
     drop;
}

  • I have results in webhomer, but some messages are still missing. What did I do wrong ?

Check your route block in the kamailio.cfg. If you want to capture all messages your route block must looks as follows:

route {
   sip_capture();
   drop;
}

if you wish to bypass specific methods, i.e. OPTIONS or NOTIFY, use the following approach:


route {
     
    if(!(is_method("OPTIONS|NOTIFY")) {
            sip_capture();
    }
    drop;
}

onreply_route {

    if(!($rm =~"*OPTIONS|NOTIFY)$")) {
            sip_capture();
    }
    drop;
}



  • I have duplicate traffic/packets in my results

If you enabled capturing on your all SIP Proxies, each will duplicate incoming and outgoing SIP messages to your Homer node.

How do I fix it ?

  1. if you are using captagent, update to the latest git code and create an extra pcap file filter (using the -f param):
and not src host 10.0.0.1

where 10.0.0.1 is your sip proxy - all packets from this host will be not duplicated to Homer.

  1. if you are using built-in agent, activate sip_trace() only for outgoing or incoming messages.

  • Partition Rotation doesn't work anymore and partoration_unixtimestamp.pl scripts reports: "DBD::mysql::db do failed: Out of resources when opening file './homer_db/sip_capture#P#p2011082512.MYD' (Errcode: 24) at partrotate_unixtimestamp.pl line 137."

Increase open_file_limit for mySQL in your my.cnf (/etc/my.cnf)

open_files_limit = 24000

and restart mysql


  • No new traffic is inserted to DB and i see the following in my syslog: 'driver error on query: Table has no partition ...'

Your partition rotation script is not running. Please verify its correctly scheduled in CRON (to verify this is the case, execute the partrotate_unixtimestamp.pl script manually)


  • No new traffic is inserted to DB and I see the following in my syslog: db_mysql [km_dbase.c:122]: driver error on query: Unknown column 'auth' in 'field list'

You're probably using the new DB schema with older Kamailio - Add the following line to your Kamailio configuration and restart:

modparam("sipcapture", "authorization_column", "authorization")

  • I have a lot of SIP traffic and some SIP messages are missing...

MySQL drops some INSERTS in HIGH traffic. Easy fix is to recompile MYSQL with INSERT DELAYED support for partitioning table:

=== modified file 'sql/ha_partition.h'
--- sql/ha_partition.h	2009-11-17 19:02:16 +0000
+++ sql/ha_partition.h	2010-01-17 00:06:41 +0000
@@ -53,7 +53,6 @@
                                         HA_CAN_FULLTEXT | \
                                         HA_DUPLICATE_POS | \
                                         HA_CAN_SQL_HANDLER | \
-                                        HA_CAN_INSERT_DELAYED | \
                                         HA_PRIMARY_KEY_REQUIRED_FOR_POSITION)
 class ha_partition :public handler
 {

http://bugs.mysql.com/bug.php?id=50393

and activate insert delayed in kamailio.cfg

modparam("sipcapture", "db_insert_mode", 1)

and do some tunning in my.cnf:

delayed_insert_limit = 8000
delayed_queue_size = 1000000
delayed_insert_timeout = 600
max_delayed_threads = 600

and also your kernel kernel in /etc/sysctl.conf

net.ipv4.udp_rmem_min = 131072
net.ipv4.udp_wmem_min = 131072
net.core.netdev_max_backlog=1000
net.core.rmem_max=67108864
net.ipv4.udp_mem = 19257652

  • Can we see a sample my.cnf?

Dome parameters maybe not be needed, but with following mysqld works fine :-)

max_connections = 8000
key_buffer = 512M
myisam_sort_buffer_size = 128M
join_buffer_size = 4M
read_buffer_size = 4M
sort_buffer_size = 8M
table_cache = 1800
thread_cache_size = 384
wait_timeout = 7200
connect_timeout = 10
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 64M
max_connect_errors = 1000
read_rnd_buffer_size = 524288
bulk_insert_buffer_size = 8M
query_cache_limit = 4M
query_cache_size =128M
query_cache_type = 1
query_prealloc_size = 65536
query_alloc_block_size = 131072

thread_cache_size = 16
open_files_limit = 24000
table_open_cache = 1024
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 128M
delayed_insert_limit = 8000
delayed_queue_size = 1000000
delayed_insert_timeout = 600
max_delayed_threads = 600
max_heap_table_size=2G
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 16


  • The following error appears in syslog: "ERROR: sipcapture [sipcapture.c:658]: sipcapture:hep_msg_received: unsupported family"

Regular SIP messages are reaching your HEP socket. Consider using a non-standard port for your HEP capture.


  • Where is the captagent source? It used to be bundled with Homer?

Captagent has moved to its own repository starting with the new release.


  • I need to import a PCAP into Homer DB. Is it possible?

Yes it sure is

CAPTAGENT 4.x Download the latest version of captagent and use the flag -D to import a pcap. Please complete the setup and configuration before running:

captagent -v -D test.pcap

CAPTAGENT 0.x If you are using the "original" captagent originally included with webHomer, use the following syntax instead:

To import a pcap to Homer with current timestamp traffic:

captagent -p 9060 -D test.pcap -s homerserver -n -r 5060-5080 

To preserve the pcap original timestamps, just use HEPv2:

captagent -p 9060 -D test.pcap -s homerserver -n -r 5060-5080 -H 2 -i 101

You can also specify the captagent 0.8 path to automate the process in webHomer by using the following preferences.php - an IMPORT button will appear in PCAP toolbox:

define('PCAP_AGENT', 'captagent'); /* System path captagent 0.8 bin */
define('PCAP_HEP_IP', "192.168.1.100"); /* HEP server IP */
define('PCAP_HEP_PORT', "5060"); /* HEP server PORT */

  • I use OpenSIPS 1.7.x and siptrace module does not support HEP encapsulation

To enable HEP support in siptrace/opensips 1.7.1 do the following:

  1. Download OpenSIPS SVN head

  2. Copy modules/siptrace and modules/sipcapture to the 1.7.1 source tree

  3. Modify modules/siptrace/siptrace.c as follows:

	-     if (dlgb.create_dlg(msg,0)<1) {
	+     if (dlgb.create_dlg(msg)<1) {
  1. Recompile the siptrace module:
	# make modules=modules/siptrace modules

Q: I see errors related to API calls (404 Not Found)

please be sure that you have activated mod_rewrite and added AllowOverride All to your Directory section:

https://github.com/sipcapture/homer/wiki/webHomer-settings#apache-mod_rewrite

Clone this wiki locally