Skip to content

Commit

Permalink
WHISTLE-1678: ensure flags can be found
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anderson committed Oct 3, 2012
1 parent 0ec723a commit fe9429c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions whistle_apps/apps/trunkstore/src/ts_from_onnet.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@ onnet_data(State) ->


Options = case ts_util:lookup_did(FromUser, AcctID) of Options = case ts_util:lookup_did(FromUser, AcctID) of
{ok, Opts} -> Opts; {ok, Opts} -> Opts;
_ -> wh_json:new() _ ->
Username = wh_json:get_value([<<"Custom-Channel-Vars">>, <<"Username">>], JObj, <<>>),
Realm = wh_json:get_value([<<"Custom-Channel-Vars">>, <<"Realm">>], JObj, <<>>),
case ts_util:lookup_user_flags(Username, Realm, AcctID) of
{ok, Opts} -> Opts;
_ -> wh_json:new()
end
end, end,


DIDOptions = wh_json:get_value(<<"DID_Opts">>, Options, wh_json:new()), DIDOptions = wh_json:get_value(<<"DID_Opts">>, Options, wh_json:new()),
AcctOptions = wh_json:get_value(<<"account">>, Options, wh_json:new()), AcctOptions = wh_json:get_value(<<"account">>, Options, wh_json:new()),
SrvOptions = wh_json:get_value([<<"server">>, <<"options">>], Options, wh_json:new()), SrvOptions = wh_json:get_value([<<"server">>, <<"options">>], Options, wh_json:new()),



MediaHandling = ts_util:get_media_handling([ MediaHandling = ts_util:get_media_handling([
wh_json:get_value(<<"media_handling">>, DIDOptions) wh_json:get_value(<<"media_handling">>, DIDOptions)
,wh_json:get_value(<<"media_handling">>, SrvOptions) ,wh_json:get_value(<<"media_handling">>, SrvOptions)
Expand Down Expand Up @@ -90,7 +97,7 @@ onnet_data(State) ->
,wh_json:get_value(<<"flags">>, SrvOptions) ,wh_json:get_value(<<"flags">>, SrvOptions)
,wh_json:get_value(<<"flags">>, AcctOptions) ,wh_json:get_value(<<"flags">>, AcctOptions)
]), ]),

io:format("~p ~p~n", [DIDFlags, SrvOptions]),
Q = ts_callflow:get_my_queue(State), Q = ts_callflow:get_my_queue(State),


Command = [ KV Command = [ KV
Expand Down

0 comments on commit fe9429c

Please sign in to comment.