I am trying to debug a problem which my ARI calls /ari/asterisk/info and fails with “invalid method” message. But only when called from my C code, but works fine called from command line with curl. When my C program runs it generates the output below in the Asterisk CLI. It would appear that the ARI is correctly parsing the URL to find the info command. Does anyone see a problem below?
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1958 httpd_helper_thread: HTTP opening session. Top level
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1417 handle_uri: HTTP Request URI is /ari/asterisk/info
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1472 handle_uri: match request [ari/asterisk/info] with handler [httpstatus] len 10
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1472 handle_uri: match request [ari/asterisk/info] with handler [metrics] len 7
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1472 handle_uri: match request [ari/asterisk/info] with handler [ari] len 3
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:1488 handle_uri: Match made with [ari]
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:507 ast_ari_invoke: Finding handler for asterisk/info
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:514 ast_ari_invoke: Finding handler for asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari applications: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari events: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari recordings: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari playbacks: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari endpoints: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking ari sounds: Didn't match asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:529 ast_ari_invoke: Checking ari asterisk: Explicit match with asterisk
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:514 ast_ari_invoke: Finding handler for info
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:531 ast_ari_invoke: Checking asterisk config: Didn't match info
[2024-03-17 16:28:52] DEBUG[1538019]: res_ari.c:529 ast_ari_invoke: Checking asterisk info: Explicit match with info
[2024-03-17 16:28:52] DEBUG[1538019]: http.c:568 ast_http_send: HTTP keeping session open. status_code:405
So why is Asterisk returning “invalid method” ? One clue…when I use curl the last line above is replaced with:
[2024-03-17 16:33:55] DEBUG[1538427]: http.c:568 ast_http_send: HTTP keeping session open. status_code:200
[2024-03-17 16:33:55] DEBUG[1538427]: http.c:2015 httpd_helper_thread: HTTP closing session. Top level
Notice the 200 instead of 405 code!? I’m sending the correct credentials…so 405 error (method not allowed) doesn’t make sense. I’m confused about what Asterisk is trying to tell me.