Change summary
web.rb | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Detailed changes
@@ -400,8 +400,7 @@ class Web < Roda
r.post "status" do
log.info "#{params['eventType']} #{params['callId']}", loggable_params
if params["eventType"] == "disconnect"
- customer_id = params["from"].sub(/^(?:\+|c)/, "")
- customer_id = from.sub(/^1/, "") if customer_id.length > 10
+ customer_id = params["from"].sub(/^(?:\+1|c)/, "")
call_attempt_repo.ending_call(customer_id, params["callId"])
cdr_repo
.put(CDR.for_outbound(customer_id, params))
@@ -411,8 +410,7 @@ class Web < Roda
end
r.post do
- from = params["from"].sub(/^(?:\+|c)/, "")
- from = from.sub(/^1/, "") if from.length > 10
+ from = params["from"].sub(/^(?:\+1|c)/, "")
customer_repo(
sgx_repo: Bwmsgsv2Repo.new
).find_by_format(from).then { |c|