Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option to not record Unit-to-Unit voice calls #667

Merged
merged 5 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ Here is a map of the different sections of the *config.json* file:
| digitalLevels | | 1 | number (1-16) | The amount of amplification that will be applied to the digital audio. |
| unitTagsFile | | | string | This is the filename of a CSV files that provides information about the unit tags. It allows a Unit ID to be assigned a name. This file should be located in the same directory as the trunk-recorder executable. The format is 2 columns, the first being the decimal number of the Unit ID, the second is the Unit Name, |
| recordUnknown | | true | **true** / **false** | Record talkgroups if they are not listed in the Talkgroups File. |
| recordUUVCalls | | true | **true** / **false** | [ P25 only ] Record Unit to Unit Voice calls. |
| hideEncrypted | | false | **true** / **false** | Hide encrypted talkgroups log entries |
| hideUnknownTalkgroups | | false | **true** / **false** | Hide unknown talkgroups log entries |
| minDuration | | 0<br />(which is disabled) | number | The minimum call duration in seconds (decimals allowed), calls below this number will have recordings deleted and will not be uploaded. |
Expand Down
1 change: 1 addition & 0 deletions trunk-recorder/global_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct Config {
int control_retune_limit;
bool broadcast_signals;
bool enable_audio_streaming;
bool record_uu_v_calls;
};


Expand Down
14 changes: 14 additions & 0 deletions trunk-recorder/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ bool load_config(string config_file) {
BOOST_LOG_TRIVIAL(info) << "Control channel retune limit: " << config.control_retune_limit;
config.enable_audio_streaming = pt.get<bool>("audioStreaming", false);
BOOST_LOG_TRIVIAL(info) << "Enable Audio Streaming: " << config.enable_audio_streaming;
config.record_uu_v_calls = pt.get<bool>("recordUUVCalls", true);
BOOST_LOG_TRIVIAL(info) << "Record Unit to Unit Voice Calls: " << config.record_uu_v_calls;
std::string frequencyFormatString = pt.get<std::string>("frequencyFormat", "exp");

if (boost::iequals(frequencyFormatString, "mhz")) {
Expand Down Expand Up @@ -1105,6 +1107,18 @@ void handle_message(std::vector<TrunkMessage> messages, System *sys) {
handle_call_update(message, sys);
break;

case UU_V_GRANT:
if(config.record_uu_v_calls){
handle_call_grant(message, sys);
}
break;

case UU_V_UPDATE:
if(config.record_uu_v_calls){
handle_call_update(message, sys);
}
break;

case CONTROL_CHANNEL:
sys->add_control_channel(message.freq);
break;
Expand Down
6 changes: 3 additions & 3 deletions trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ std::vector<TrunkMessage> P25Parser::decode_mbt_data(unsigned long opcode, boost
unsigned long sa = bitset_shift_mask(header, 48, 0xffffff);
unsigned long ta = bitset_shift_mask(mbt_data, 24, 0xffffff);

message.message_type = GRANT;
message.message_type = UU_V_GRANT;
message.freq = f;
message.talkgroup = ta;
message.source = sa;
Expand Down Expand Up @@ -448,7 +448,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
unsigned long sa = bitset_shift_mask(tsbk, 16, 0xffffff);
unsigned long ta = bitset_shift_mask(tsbk, 40, 0xffffff);

message.message_type = GRANT;
message.message_type = UU_V_GRANT;
message.freq = f;
message.talkgroup = ta;
message.source = sa;
Expand Down Expand Up @@ -499,7 +499,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
unsigned long sa = bitset_shift_mask(tsbk, 16, 0xffffff);
unsigned long ta = bitset_shift_mask(tsbk, 40, 0xffffff);

message.message_type = UPDATE;
message.message_type = UU_V_UPDATE;
message.freq = f;
message.talkgroup = ta;
message.source = sa;
Expand Down
2 changes: 2 additions & 0 deletions trunk-recorder/systems/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ enum MessageType {
PATCH_DELETE = 11,
DATA_GRANT = 12,
UU_ANS_REQ = 13,
UU_V_GRANT = 14,
UU_V_UPDATE = 15,
UNKNOWN = 99
};

Expand Down