Skip to content

Commit

Permalink
return caller-controls with profile (#6437)
Browse files Browse the repository at this point in the history
  • Loading branch information
lazedo authored Apr 1, 2020
1 parent dbecd68 commit a306882
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions applications/conference/src/conf_config_req.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down Expand Up @@ -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]).

0 comments on commit a306882

Please sign in to comment.