Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

WHISTLE-42: use the publish_command to ensure all default headers are…

… populated
  • Loading branch information...
commit f0b2d42c1b5c93224fde54fca782e615341a3fb4 1 parent 855bfd9
@k-anderson k-anderson authored
Showing with 5 additions and 10 deletions.
  1. +5 −10 whistle_apps/apps/trunkstore/src/ts_from_offnet.erl
View
15 whistle_apps/apps/trunkstore/src/ts_from_offnet.erl
@@ -79,12 +79,11 @@ wait_for_win(State, Command) ->
end.
send_onnet(State, Command) ->
- {ok, Payload} = wapi_dialplan:bridge(Command),
- lager:debug("sending onnet command: ~s", [Payload]),
+ lager:debug("sending onnet command: ~p", [Command]),
CtlQ = ts_callflow:get_control_queue(State),
- amqp_util:callctl_publish(CtlQ, Payload),
+ wapi_dialplan:publish_command(CtlQ, Command),
wait_for_bridge(State).
wait_for_bridge(State) ->
@@ -177,22 +176,18 @@ try_failover_sip(State, SIPUri) ->
lager:debug("routing to failover sip uri: ~s", [SIPUri]),
- EndPoint = wh_json:from_list([
- {<<"Invite-Format">>, <<"route">>}
+ EndPoint = wh_json:from_list([{<<"Invite-Format">>, <<"route">>}
,{<<"Route">>, SIPUri}
]),
%% since we only route to one endpoint, we specify most options on the endpoint's leg
- Command = [
- {<<"Call-ID">>, CallID}
+ Command = [{<<"Call-ID">>, CallID}
,{<<"Application-Name">>, <<"bridge">>}
,{<<"Endpoints">>, [EndPoint]}
| wh_api:default_headers(Q, <<"call">>, <<"command">>, ?APP_NAME, ?APP_VERSION)
],
- {ok, Payload} = wapi_dialplan:bridge(Command),
-
- amqp_util:targeted_publish(CtlQ, Payload, <<"application/json">>),
+ wapi_dialplan:publish_command(CtlQ, Command),
wait_for_bridge(ts_callflow:set_failover(State, wh_json:new())).
try_failover_e164(State, ToDID) ->
Please sign in to comment.
Something went wrong with that request. Please try again.