Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

stop trying to store the CDR, that's done elsewhere

  • Loading branch information...
commit e1487b96481438a208be2d6edfa12e2d7e314d62 1 parent 1510c5f
James Aimonetti jamesaimonetti authored
24 whistle_apps/apps/trunkstore/src/ts_from_offnet.erl
@@ -97,17 +97,14 @@ wait_for_bridge(State) ->
97 97
98 98 wait_for_cdr(State) ->
99 99 case ts_callflow:wait_for_cdr(State) of
100   - {cdr, aleg, CDR, State1} ->
101   - ALeg = ts_callflow:get_aleg_id(State1),
  100 + {cdr, aleg, _CDR, State1} ->
102 101 AcctID = ts_callflow:get_account_id(State1),
103 102 Cost = ts_callflow:get_call_cost(State1),
104 103
105 104 ?LOG("a-leg CDR for ~s costs ~p", [AcctID, Cost]),
106 105
107   - _ = ts_cdr:store(wh_json:set_value(<<"A-Leg">>, ALeg, CDR)),
108   -
109 106 wait_for_other_leg(State1, bleg);
110   - {cdr, bleg, CDR, State2} ->
  107 + {cdr, bleg, _CDR, State2} ->
111 108 BLeg = ts_callflow:get_bleg_id(State2),
112 109 AcctID = ts_callflow:get_account_id(State2),
113 110 Cost = ts_callflow:get_call_cost(State2),
@@ -115,8 +112,6 @@ wait_for_cdr(State) ->
115 112 ?LOG("b-leg CDR for ~s costs ~p", [AcctID, Cost]),
116 113 ?LOG(BLeg, "b-leg CDR for ~s costs ~p", [AcctID, Cost]),
117 114
118   - _ = ts_cdr:store(wh_json:set_value(<<"B-Leg">>, BLeg, CDR)),
119   -
120 115 wait_for_other_leg(State2, aleg);
121 116 {timeout, State3} ->
122 117 ?LOG("Timed out waiting for CDRs, cleaning up"),
@@ -130,19 +125,14 @@ wait_for_other_leg(State, aleg) ->
130 125 wait_for_other_leg(State, bleg) ->
131 126 wait_for_other_leg(State, bleg, ts_callflow:wait_for_cdr(State)).
132 127
133   -wait_for_other_leg(_State, aleg, {cdr, aleg, CDR, State1}) ->
134   - ALeg = ts_callflow:get_aleg_id(State1),
135   - _ = ts_cdr:store(wh_json:set_value(<<"A-Leg">>, ALeg, CDR)),
136   - ts_callflow:finish_leg(State1, ALeg);
137   -wait_for_other_leg(_State, bleg, {cdr, bleg, CDR, State1}) ->
138   - BLeg = ts_callflow:get_bleg_id(State1),
139   - _ = ts_cdr:store(wh_json:set_value(<<"B-Leg">>, BLeg, CDR)),
140   - ts_callflow:finish_leg(State1, BLeg);
  128 +wait_for_other_leg(_State, aleg, {cdr, aleg, _CDR, State1}) ->
  129 + ts_callflow:finish_leg(State1, ts_callflow:get_aleg_id(State1));
  130 +wait_for_other_leg(_State, bleg, {cdr, bleg, _CDR, State1}) ->
  131 + ts_callflow:finish_leg(State1, ts_callflow:get_bleg_id(State1));
141 132 wait_for_other_leg(_State, Leg, {timeout, State1}) ->
142 133 ?LOG("Timed out waiting for ~s CDR, cleaning up", [Leg]),
143 134
144   - ALeg = ts_callflow:get_bleg_id(State1),
145   - ts_callflow:finish_leg(State1, ALeg).
  135 + ts_callflow:finish_leg(State1, ts_callflow:get_bleg_id(State1)).
146 136
147 137 try_failover(State) ->
148 138 case {ts_callflow:get_control_queue(State), ts_callflow:get_failover(State)} of
21 whistle_apps/apps/trunkstore/src/ts_from_onnet.erl
@@ -155,17 +155,14 @@ wait_for_bridge(State) ->
155 155
156 156 wait_for_cdr(State) ->
157 157 case ts_callflow:wait_for_cdr(State) of
158   - {cdr, aleg, CDR, State1} ->
159   - ALeg = ts_callflow:get_aleg_id(State1),
  158 + {cdr, aleg, _CDR, State1} ->
160 159 AcctID = ts_callflow:get_account_id(State1),
161 160 Cost = ts_callflow:get_call_cost(State1),
162 161
163 162 ?LOG("a-leg CDR for ~s costs ~p", [AcctID, Cost]),
164 163
165   - _ = ts_cdr:store(wh_json:set_value(<<"A-Leg">>, ALeg, CDR)),
166   -
167 164 wait_for_other_leg(State1, bleg);
168   - {cdr, bleg, CDR, State2} ->
  165 + {cdr, bleg, _CDR, State2} ->
169 166 BLeg = ts_callflow:get_bleg_id(State2),
170 167 AcctID = ts_callflow:get_account_id(State2),
171 168 Cost = ts_callflow:get_call_cost(State2),
@@ -173,8 +170,6 @@ wait_for_cdr(State) ->
173 170 ?LOG("b-leg CDR for ~s costs ~p", [AcctID, Cost]),
174 171 ?LOG(BLeg, "b-leg CDR for ~s costs ~p", [AcctID, Cost]),
175 172
176   - _ = ts_cdr:store(wh_json:set_value(<<"B-Leg">>, BLeg, CDR)),
177   -
178 173 wait_for_other_leg(State2, aleg);
179 174 {timeout, State3} ->
180 175 ?LOG("timed out waiting for CDRs, cleaning up"),
@@ -186,14 +181,10 @@ wait_for_cdr(State) ->
186 181 wait_for_other_leg(State, WaitingOnLeg) ->
187 182 wait_for_other_leg(State, WaitingOnLeg, ts_callflow:wait_for_cdr(State)).
188 183
189   -wait_for_other_leg(_State, aleg, {cdr, aleg, CDR, State1}) ->
190   - ALeg = ts_callflow:get_aleg_id(State1),
191   - _ = ts_cdr:store(wh_json:set_value(<<"A-Leg">>, ALeg, CDR)),
192   - ts_callflow:finish_leg(State1, ALeg);
193   -wait_for_other_leg(_State, bleg, {cdr, bleg, CDR, State1}) ->
194   - BLeg = ts_callflow:get_bleg_id(State1),
195   - _ = ts_cdr:store(wh_json:set_value(<<"B-Leg">>, BLeg, CDR)),
196   - ts_callflow:finish_leg(State1, BLeg);
  184 +wait_for_other_leg(_State, aleg, {cdr, aleg, _CDR, State1}) ->
  185 + ts_callflow:finish_leg(State1, ts_callflow:get_aleg_id(State1));
  186 +wait_for_other_leg(_State, bleg, {cdr, bleg, _CDR, State1}) ->
  187 + ts_callflow:finish_leg(State1, ts_callflow:get_bleg_id(State1));
197 188 wait_for_other_leg(_State, Leg, {timeout, State1}) ->
198 189 ?LOG("timed out waiting for ~s CDR, cleaning up", [Leg]),
199 190

0 comments on commit e1487b9

Please sign in to comment.
Something went wrong with that request. Please try again.