Skip to content

Commit

Permalink
WHISTLE-1186: text fragments can come in pieces, esp if its a URL wit…
Browse files Browse the repository at this point in the history
…h query string parameters. Take the list of xmlText elements and join the text to make the final URL
  • Loading branch information
James Aimonetti committed Jun 8, 2012
1 parent 9d195ee commit c1f5360
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/whistle_translator-1.0.0/src/wht_twiml.erl
Expand Up @@ -93,10 +93,12 @@ exec_element(Call, 'Play', [#xmlText{value=PlayMe, type=text}], #xmlElement{attr
exec_element(Call, 'Say', [#xmlText{value=SayMe, type=text}], #xmlElement{attributes=Attrs}) ->
maybe_stop(Call, say(Call, SayMe, Attrs), {ok, Call});

exec_element(Call, 'Redirect', [#xmlText{value=Url}], #xmlElement{attributes=Attrs}) ->
exec_element(Call, 'Redirect', [#xmlText{}|_]=Texts, #xmlElement{attributes=Attrs}) ->
Call1 = maybe_answer_call(Call),
Props = attrs_to_proplist(Attrs),

Url = wh_util:join_binary([wh_util:to_binary(Frag) || #xmlText{value=Frag} <- Texts], <<>>),

NewUri = wht_util:resolve_uri(whapps_call:kvs_fetch(<<"voice_uri">>, Call1), Url),
Method = wht_util:http_method(props:get_value(method, Props, post)),
BaseParams = wh_json:from_list(req_params(Call1) ),
Expand Down

0 comments on commit c1f5360

Please sign in to comment.