Seems there is a bug with ExternalMedia + AudioSocket on asterisk 22:
core show version
Asterisk 22.8.0 built by root @ test on a x86_64 running Linux on 2026-01-23 12:11:36 UTC
curl -v -u asterisk:asterisk -X POST “http://127.0.0.1:8088/ari/channels/externalMedia” -H “Content-Type: application/json” -d ‘{ “app”: “test”, “external_host”: “127.0.0.1:9999”, “format”: “ulaw”, “transport”: “tcp”, “encapsulation”: “audiosocket”, “connection_type”: “client”, “direction”: “both” }’
Note: Unnecessary use of -X or --request, POST is already inferred.
Trying 127.0.0.1:8088…
Connected to 127.0.0.1 (127.0.0.1) port 8088 (#0)
Server auth using Basic with user ‘asterisk’
POST /ari/channels/externalMedia HTTP/1.1
Host: 127.0.0.1:8088
Authorization: Basic YXN0ZXJpc2s6YXN0ZXJpc2s=
User-Agent: curl/7.76.1
Accept: /
Content-Type: application/json
Content-Length: 178
Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< Server: Asterisk
< Date: Sun, 01 Mar 2026 11:53:22 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 78
<
{
“message”: “An internal error prevented this request from being handled”
Connection #0 to host 127.0.0.1 left intact
}
Doing same on asterisk version 20 gives different result - “data can not be empty” which is ok:
core show version
Asterisk 20.4.0 built by root @ test on a x86_64 running Linux on 2023-08-20 16:35:41 UTC
curl -v -u asterisk:asterisk -X POST “http://127.0.0.1:8088/ari/channels/externalMedia” -H “Content-Type: application/json” -d ‘{ “app”: “test”, “external_host”: “127.0.0.1:9999”, “format”: “ulaw”, “transport”: “tcp”, “encapsulation”: “audiosocket”, “connection_type”: “client”, “direction”: “both” }’
Note: Unnecessary use of -X or --request, POST is already inferred.
Trying 127.0.0.1:8088…
Connected to 127.0.0.1 (127.0.0.1) port 8088 (#0)
Server auth using Basic with user ‘asterisk’
POST /ari/channels/externalMedia HTTP/1.1
Host: 127.0.0.1:8088
Authorization: Basic YXN0ZXJpc2s6YXN0ZXJpc2s=
User-Agent: curl/7.76.1
Accept: /
Content-Type: application/json
Content-Length: 178
Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Server: Asterisk
< Date: Sun, 01 Mar 2026 11:42:51 GMT
< Cache-Control: no-cache, no-store
< Content-type: application/json
< Content-Length: 40
<
{
“message”: “data can not be empty”
Connection #0 to host 127.0.0.1 left intact
}
Am I doing something wrong or there is really an issue?
Thanks in advance.