Когда я делаю запрос на API
curl -X GET “http://127.0.0.1:6666/api/rest/admin/active-calls?filter[node-id-eq]=1&filter[orig-gw-id-eq]=17” -H “Accept: application/vnd.api+json” -H “Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mjg0MTYyMjAsInN1YiI6M30.BeDKFuxwMxjLOD9pDbQ4QGc0MkkvxDPShGl4qu5GiR8”
Получаю ответ
{“errors”:[{“title”:“Internal Server Error”,“detail”:“Internal Server Error”,“code”:“500”,“status”:“500”}]}
В случае если есть какие-то активные вызовы.
Если же без фильтров или же через node, то ответ корректный.
Подскажите пожалуйста что не так.
When I make a request to the API
curl -X GET “http://127.0.0.1:6666/api/rest/admin/active-calls?filter[node-id-eq]=1&filter[orig-gw-id-eq]=17” -H " Accept: application/vnd.api+json" -H “Authorization: bearer eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3Mjg0MTYyMjAsInN1YiI6M30.BeDKFuxwMxjLOD9pDbQ4QGc0MkkvxDPShGl4qu5GiR8”
Getting a response
{“errors”:[{“title”:“Internal server error”,“detail”:“Internal server error”,“code”:“500”,“status”:“500”}]}
In case there are any active calls.
If the same without filters or the same through a node, the answer is correct.
Please tell me what’s wrong.
You have to check yeti-web logs. Exception details should be visible there.
That’s right, I get this message:
Oct 9 14:47:16 250012 yeti-web[141163]: [f980a4a5-e1c5-4f68-ac5c-2d5304ad8ba3] Started GET “/api/rest/admin/active-calls?filter%5Borig-gw-id-eq% 5D=17” for 127.0.0.1 at 2024-10-09 14:47:16 +0200
Oct 9 14:47:16 250012 yeti-web[141163]: [f980a4a5-e1c5-4f68-ac5c-2d5304ad8ba3] Processing by Api::Rest::Admin::ActiveCallsController#index as API_JSON
Oct 9 14:47:16 250012 yeti-web[141163]: [f980a4a5-e1c5-4f68-ac5c-2d5304ad8ba3] Parameters: {“filter”=>{“orig-gw-id-eq”=>“17”} }
Oct 9 14:47:17 250012 yeti-web[141163]: request to node 1
Oct 9 14:47:17 250012 yeti-web[141163]: loading 1 active calls
Oct 9 14:47:17 250012 yeti-web[141163]: [f980a4a5-e1c5-4f68-ac5c-2d5304ad8ba3] Internal Server Error: undefined method to_i' for ["17"]:Array /opt/yeti-web/ app/models/yeti/cdrs_filter.rb:60:in
block (3 levels) in generate_filter’#012>
Oct 9 14:47:17 250012 yeti-web[141163]: [f980a4a5-e1c5-4f68-ac5c-2d5304ad8ba3] Completed 500 Internal Server Error in 51ms (Views: 0.4ms | ActiveRecord: 5.9ms | Allocations: 10444)
I don’t really understand the essence of this error, but I’m almost sure that I’m passing the value correctly.
looks like bug. What version you running?