From a306882b9d697f2a60619c91448a9608de27b2f7 Mon Sep 17 00:00:00 2001 From: lazedo Date: Wed, 1 Apr 2020 12:32:02 +0000 Subject: [PATCH] return caller-controls with profile (#6437) --- applications/conference/src/conf_config_req.erl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/applications/conference/src/conf_config_req.erl b/applications/conference/src/conf_config_req.erl index 91ce93293fa..c7bf484df89 100644 --- a/applications/conference/src/conf_config_req.erl +++ b/applications/conference/src/conf_config_req.erl @@ -60,9 +60,11 @@ handle_request(<<"Controls">>, JObj, Conference) -> handle_profile_request(JObj, Conference) -> ProfileName = requested_profile_name(JObj), Profile = lookup_profile(ProfileName, Conference), + Controls = conference_controls(Conference), ServerId = kz_api:server_id(JObj), Resp = [{<<"Profiles">>, kz_json:from_list([{ProfileName, Profile}])} + ,{<<"Caller-Controls">>, Controls} ,{<<"Advertise">>, advertise(ProfileName)} ,{<<"Chat-Permissions">>, chat_permissions(ProfileName)} ,{<<"Msg-ID">>, kz_api:msg_id(JObj)} @@ -252,3 +254,9 @@ requested_controls_name(JObj) -> controls(ControlsName, Controls) -> kz_json:from_list([{ControlsName, Controls}]). +conference_controls(Conference) -> + ControlNames = lists:usort([kapps_conference:caller_controls(Conference) + ,kapps_conference:moderator_controls(Conference) + ]), + kz_json:from_list([{Name, kapps_conference:controls(Conference, Name)} || Name <- ControlNames]). +