Skip to content

Commit

Permalink
minor fix to unit answer reqest
Browse files Browse the repository at this point in the history
also logging source (caller)
  • Loading branch information
rosecitytransit committed Apr 6, 2022
1 parent 4af616b commit a5a0b3e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plugins/unit_script/unit_script.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ int unit_data_grant(System *sys, long source_id) {
return 1;
}

int unit_answer_request(System *sys, long source_id) {
int unit_answer_request(System *sys, long source_id, long talkgroup) {
std::string system_script = get_system_script(sys->get_short_name());
if ((system_script != "") && (source_id != 0)) {
char shell_command[200];
sprintf(shell_command, "%s %s %li ans_req &", system_script.c_str(), sys->get_short_name().c_str(), source_id);
sprintf(shell_command, "%s %s %li ans_req %li &", system_script.c_str(), sys->get_short_name().c_str(), source_id, talkgroup);
int rc = system(shell_command);
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk-recorder/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,8 @@ void unit_data_grant(System *sys, long source_id) {
plugman_unit_data_grant(sys, source_id);
}

void unit_answer_request(System *sys, long source_id) {
plugman_unit_answer_request(sys, source_id);
void unit_answer_request(System *sys, long source_id, long talkgroup) {
plugman_unit_answer_request(sys, source_id, talkgroup);
}

void unit_location(System *sys, long source_id, long talkgroup_num) {
Expand Down
2 changes: 1 addition & 1 deletion trunk-recorder/plugin_manager/plugin_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Plugin_Api {
virtual int unit_acknowledge_response(System *sys, long source_id) { return 0; };
virtual int unit_group_affiliation(System *sys, long source_id, long talkgroup_num) { return 0; };
virtual int unit_data_grant(System *sys, long source_id) { return 0; };
virtual int unit_answer_request(System *sys, long source_id) { return 0; };
virtual int unit_answer_request(System *sys, long source_id, long talkgroup) { return 0; };
virtual int unit_location(System *sys, long source_id, long talkgroup_num) { return 0; };
void set_frequency_format(int f) { frequencyFormat = f;}
virtual ~Plugin_Api(){};
Expand Down
4 changes: 2 additions & 2 deletions trunk-recorder/plugin_manager/plugin_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,11 @@ void plugman_unit_data_grant(System *system, long source_id) {
}
}
}
void plugman_unit_answer_request(System *system, long source_id) {
void plugman_unit_answer_request(System *system, long source_id, long talkgroup) {
for (std::vector<Plugin *>::iterator it = plugins.begin(); it != plugins.end(); it++) {
Plugin *plugin = *it;
if (plugin->state == PLUGIN_RUNNING) {
plugin->api->unit_data_grant(system, source_id);
plugin->api->unit_data_grant(system, source_id), talkgroup;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk-recorder/plugin_manager/plugin_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ void plugman_unit_deregistration(System * system, long source_id);
void plugman_unit_acknowledge_response(System * system, long source_id);
void plugman_unit_group_affiliation(System * system, long source_id, long talkgroup_num);
void plugman_unit_data_grant(System * system, long source_id);
void plugman_unit_answer_request(System * system, long source_id);
void plugman_unit_answer_request(System * system, long source_id, long talkgroup);
void plugman_unit_location(System * system, long source_id, long talkgroup_num);
#endif // PLUGIN_MANAGER_H
1 change: 1 addition & 0 deletions trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
message.mode = mode;
message.priority = priority;
message.source = sa;
message.talkgroup = si;

BOOST_LOG_TRIVIAL(debug) << "tsbk05\tUnit To Unit Answer Request\tsa " << sa << "\tSource ID: " << si;
} else if (opcode == 0x06) { // Unit to Unit Voice Channel Grant Update (UU_V_CH_GRANT_UPDT)
Expand Down

0 comments on commit a5a0b3e

Please sign in to comment.