sipcapture / homer5-docker

HOMER 5 Docker Containers (OBSOLETE)
http://sipcapture.org
40 stars 61 forks source link

RTCP Information not being displayed #54

Open arainero opened 6 years ago

arainero commented 6 years ago

Hello,

I am currently using the latest homer-docker version and I am having difficulty getting RTCP information displayed under QoS reports.

When I check the database I see there is JSON information there. I looked at the apache logs and I don't see anything unusual there either. I don't know what config files or logs to post that would be helpful. So please, let me know and I will provide them.

Also, is there a way to set a timezone for the docker images? They currently don't use the host timezone. Everything appears to be set in "Etc/UTC". I tried changing it, but nothing appears to stick.

dougbtv commented 6 years ago

Thanks for the report on this one, there's a couple things here as a todo...

Firstly... RTCP info hasn't been verified on homer-docker (at least by me), so, it can use a full-out double check on that, and then Travis CI tests to verify that it's there.

Regarding the timezone, can you try changing the value in the homer.env file and see if that works and let us know. This one: https://github.com/sipcapture/homer-docker/blob/master/homer.env

arainero commented 6 years ago

Thanks @dougbtv

This is what I see in the database for call id "7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060". This would be considered proper RTCP data, right?

mysql> mysql> SELECT * FROM rtcp_capture WHERE correlation_id IN ('7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060');
+-----+---------------------+------------------+---------------------------------------------------+-------------+-------------+----------------+------------------+-------+--------+------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id  | date                | micro_ts         | correlation_id                                    | source_ip   | source_port | destination_ip | destination_port | proto | family | type | node         | msg                                                                                                                                                                                                                                                                                                                                                                                                                               |
+-----+---------------------+------------------+---------------------------------------------------+-------------+-------------+----------------+------------------+-------+--------+------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 202 | 2017-10-16 14:16:37 | 1508163397664937 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3309146077,"ntp_timestamp_usec":1043740842,"octets":39200,"rtp_timestamp":546897920, "packets":245},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3209013755}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}    |
| 235 | 2017-10-16 14:16:42 | 1508163402664195 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3393032157,"ntp_timestamp_usec":905578410,"octets":79360,"rtp_timestamp":3539200, "packets":496},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3209341435}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}       |
| 263 | 2017-10-16 14:16:47 | 1508163407672750 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3476918237,"ntp_timestamp_usec":1026701228,"octets":119360,"rtp_timestamp":1087504640, "packets":746},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3209669640}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}  |
| 294 | 2017-10-16 14:16:52 | 1508163412664562 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3560804317,"ntp_timestamp_usec":3816562858,"octets":159360,"rtp_timestamp":2154693120, "packets":996},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3209996795}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}  |
| 327 | 2017-10-16 14:16:57 | 1508163417664412 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3644690397,"ntp_timestamp_usec":371332778,"octets":199360,"rtp_timestamp":3221881600, "packets":1246},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3210324475}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}  |
| 360 | 2017-10-16 14:17:02 | 1508163422664674 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3728576477,"ntp_timestamp_usec":3566217130,"octets":238880,"rtp_timestamp":547685120, "packets":1493},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3210652155}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}  |
| 396 | 2017-10-16 14:17:07 | 1508163427664353 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3812462557,"ntp_timestamp_usec":2423657130,"octets":279040,"rtp_timestamp":4326400, "packets":1744},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3210979835}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}    |
| 433 | 2017-10-16 14:17:12 | 1508163432664116 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3896348637,"ntp_timestamp_usec":129761962,"octets":311520,"rtp_timestamp":954074112, "packets":1947},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3211307515}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}   |
| 469 | 2017-10-16 14:17:17 | 1508163437665147 | 7a16ed6b6f0b1d4f6271c9657704527b@10.10.10.42:5060 | 10.10.10.42 |       16647 | 10.11.11.25   |            19131 |     1 |      2 |    1 | homer01:3442 | { "sender_information":{"ntp_timestamp_sec":3980234717,"ntp_timestamp_usec":526272170,"octets":351520,"rtp_timestamp":2021262592, "packets":2197},"ssrc":551677255,"type":200, "report_blocks":[{"source_ssrc":0,"highest_seq_no":0,"fraction_lost":0,"ia_jitter":0,"packets_lost":1,"lsr":0,"dlsr":3211635261}],"report_count":1,"sdes_ssrc":551677255,"sdes_chunk_ssrc":16777216,"sdes_information": [],"sdes_report_count":0}  |
+-----+---------------------+------------------+---------------------------------------------------+-------------+-------------+----------------+------------------+-------+--------+------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9 rows in set (0.00 sec)

I modified the homer.env to be "America/New_York" did a docker-compose down, then a docker-compose build (is this step necessary?), and finally docker-compose up.

The time didn't change. I also modified the .travis.yml file too. I noticed it had timezone settings as well. Neither change seemed to make a difference.

I'm not very familiar with Travis CI. If there is something I should read to do a Travis CI test please let me know.

dougbtv commented 6 years ago

Thanks for the extra info. No action necessary on your part, for making the new travis CI tests (unless you want to contribute, which would be much appreciated as always).

I'm going to open a new issue for the timezone, I'll reference this issue.

arainero commented 6 years ago

@dougbtv

I'm starting to wonder if the timezone might be the reason the RTCP stats aren't displayed. Is there an easy way to confirm this or is that not possibly the case?

dougbtv commented 6 years ago

That's.... actually a good idea to check. Exec into the mysql container, and look for the rtcp tables and see if there's any data there, way worth a look.

On Wed, Oct 18, 2017 at 8:05 AM arainero notifications@github.com wrote:

I'm starting to wonder if the timezone might be the reason the RTCP stats aren't displayed. Is there an easy way to confirm this or is that not possibly the case?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/sipcapture/homer-docker/issues/54#issuecomment-337568790, or mute the thread https://github.com/notifications/unsubscribe-auth/AFN_vTx8x9lp6HNW9D4XubSCtPSAf_LTks5stel-gaJpZM4P6uMa .

arainero commented 6 years ago

@dougbtv

I see that the date column has a different time from the "ntp_timestamp_sec" entry. Would this do it?

You can see the differences I'm talking about from my previous post.

arainero commented 6 years ago

@lmangani do you have any thoughts on this?

lmangani commented 6 years ago

I still need to review the exact details, but time is extracted from the packets so that's most likely what was sent. Mind internally to HOMER everything is and should be UTC in order for things to correlate correctly, multiple timezones will confuse the pairing or completely impair it.

arainero commented 6 years ago

@lmangani Ok, I see what you mean about everything being in UTC for consistency. That makes me believe it may not be a time issue after all then.

Is there anything you want me to provide to you to help narrow this down?

sudermanjr commented 6 years ago

I can't comment on the TZ stuff because I run everything in UTC. However, I do have RTCP stats working in homer-docker. What I had to do was edit the preferences.php on the webapp to read:

define('RTCP_TABLE_PARTITION', 0);

I got some info here: https://github.com/sipcapture/homer-api/issues/161

Looks like the some of the default config in the homer-docker capture stuff uses a single table to handle all the rtcp data instead of a rotated table like the other information. This configuration tells the webapp to use a single table to find that info. Worked like a charm for me.

lmangani commented 6 years ago

@sudermanjr well caught! This is indeed the issue and needs to be reflected in defaults.

arainero commented 6 years ago

Hey @lmangani, I am going to revisit this now. I am inside the homer-webapp container and I see that inside homer-api/api there is the following:

Authentication RestApi autoload.php preferences_example.php COPYING RestService configuration_example.php Database Statistic index.php

Do I need to rename preferences_example.php to preferences.php or does it utilize preferences_example.php as default?

Also, what is the best way to modify files within a container? I am not the most experienced with Docker and was wondering if I could just edit it or if there was a process involved?

Thank you.

arainero commented 6 years ago

I think I was going about this incorrectly. Instead of modifying the files within the container I realized that there was a preferences.php file in homer-docker/webapp. I added:

define('RTCP_TABLE_PARTITION', 0);

to the prefercenes.php file and I still can't get RTCP stats to show.

This is with a fresh docker install. @sudermanjr, did you have to do anything else for it to work? I also tried:

define('RTCP_TABLE_PARTITION', 1);

arainero commented 6 years ago

I just got it to work! I didn't know I had to do a docker-compose build after modifying the files (it makes sense now). I thought that after taking the container down and modifying the environment file in there it would work fine, but I was incorrect.

Thank you all for the help with this.

lmangani commented 6 years ago

I'll change the defaults to avoid this in the future! Images are being rebuilt, if you feel like trying to confirm it now works without modification, that's super super welcome!

EDIT: new default is:

define('RTCP_TABLE_PARTITION', 1);
arainero commented 6 years ago

I did not try your build yet, but I did test "define('RTCP_TABLE_PARTITION', 1);" and "define('RTCP_TABLE_PARTITION', 0);" and only "define('RTCP_TABLE_PARTITION', 0);" works for me. If it is set to 1 the data does not show. (this was after doing a docker-compose build).

What does the 0/1 do for the RTCP table partition? I tried looking around for an answer and it wasn't clear.

Would changing it to a value of "1" and looking up data that was recorded when it was "0" make a difference?

vtzan commented 6 years ago

Dear Team,

I have verified that RTCP Stats to work for current homer-docker on multi-containers installation the value on preferences.php that resides on /var/www/html/api in the homer-webapp container should be set to 0.

define('RTCP_TABLE_PARTITION', 0);

This is needed because all the RTCP the data is saved to the rtcp_capture table

The rotating tables are created successfully in the DB though.

rtcp_capture_all_20180906
rtcp_capture_all_20180907
rtcp_capture_all_20180908 

Thanks

Vasilios Tzanoudakis

adubovikov commented 4 years ago

https://github.com/sipcapture/homer-app/releases/tag/1.1.32 also the packages are in the repository. Please update