Change summary
web.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Detailed changes
@@ -383,7 +383,9 @@ class Web < Roda
r.post "status" do
log.info "#{params['eventType']} #{params['callId']}", loggable_params
if params["eventType"] == "disconnect"
- call_attempt_repo.ending_call(c, params["callId"])
+ customer_id = params["from"].sub(/^(?:\+|c)/, "")
+ customer_id = from.sub(/^1/, "") if customer_id.length > 10
+ call_attempt_repo.ending_call(customer_id, params["callId"])
cdr_repo.put(CDR.for_outbound(params)).catch(&method(:log_error))
end
"OK"