Skip to content

Commit

Permalink
doodle_util was not properly taking the Message Body. This resulted i…
Browse files Browse the repository at this point in the history
…n sms documents with no body property - a bug
  • Loading branch information
aberke authored and jamesaimonetti committed Feb 9, 2015
1 parent 19cc6b9 commit b192ef1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions applications/doodle/src/doodle_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-export([endpoint_from_sipdb/2, get_endpoint_from_sipdb/2]).
-export([save_sms/1, save_sms/2]).
-export([replay_sms/2]).
-export([set_sms_body/2]).
-export([get_sms_body/1, set_sms_body/2]).
-export([set_flow_status/2, set_flow_status/3]).
-export([set_flow_error/2, set_flow_error/3, clear_flow_error/1]).
-export([handle_bridge_failure/2, handle_bridge_failure/3]).
Expand All @@ -39,6 +39,10 @@
set_sms_body(Body, Call) ->
whapps_call:kvs_store(<<"Body">>, Body, Call).

-spec get_sms_body(whapps_call:call()) -> ne_binary().
get_sms_body(Call) ->
whapps_call:kvs_fetch(<<"Body">>, Call).

-spec set_flow_status(ne_binary(), whapps_call:call()) -> whapps_call:call().
set_flow_status(Status, Call) ->
whapps_call:kvs_store(<<"flow_status">>, Status, Call).
Expand Down Expand Up @@ -111,7 +115,7 @@ save_sms(JObj, DocId, Doc, Call) ->
OwnerId = whapps_call:owner_id(Call),
AuthType = whapps_call:authorizing_type(Call),
AuthId = whapps_call:authorizing_id(Call),
Body = wh_json:get_value(<<"Body">>, JObj),
Body = get_sms_body(Call),
To = whapps_call:to(Call),
From = whapps_call:from(Call),
Request = whapps_call:request(Call),
Expand Down

0 comments on commit b192ef1

Please sign in to comment.