Make a call with playback from ari

I try to make call via Asterisk REST API, I want to make call like that (CLI command example):

channel originate SIP/4444@sipprovider application playback tt-monkeys

I try to use curl for that:

curl -v -u admin:pass -X POST "http://127.0.0.1:8085/ari/channels?endpoint=SIP/1000&extension=4444&context=sipprovider"

When I post request I get this error:

Allocation failed

What I do wrong?

  1. You appear to be completely bypassing FreePBX, so you might be better off asking on the Asterisk community forum.

  2. You are using a deprecated and unsupported channel driver.

  3. You didn’t provide the complete message. However, as far as I can tell, Allocation Failed is used for out of memory conditions.

  4. You’ve used an extension mode ARI request for something specified as an app mode originate.

  5. I’m not sure if this is just bad practice, or is actually an error, but you have put the parameters in the URI, rather than as POST data.

the call is now established and working fine but how to play the sound? i need this feature I need to automate call that play alert from the monitoring system

If you want to do it in extension mode, rather than app mode, and within the FreePBX framework, you’d probably make the Announcements Application Module the destination of the extension you used. sipprovider doesn’t sound like a sensible context for that extension, as you would want it treated like an internal call.

in my case, the sound should be changed every time that has a new trigger so in the announcements, it is always static so what you suggest.

I think you need to provide us with a complete specification of the requirement.

Also, if this is being initiated from the same machine, creating a call file, may be better, as Asterisk will retry failed calls, or using the CLI originate command may be better, as it is simple and well established.

In all cases, you probably want to do it outside of FreePBX, by using the application mode of originate.

Let;s starrt by understanding what you are trying to do.

What service is running on localhost:8085?

does it return media recognizable and readable to the asterisk user , sample rate of 8000 , one channel and 16 bit data?

Google suggests it is an AWS failure so ‘On what platform are you running it on ?’

you are using curl with ‘-v’, so there should be a lot of data returned, , make that -vv and provide the issue when you call your service purely from a shell and as the ‘asterisk user’.

yes, you are right. we have a monitoring system that monitors our network. what I need to do that integrate this monitoring system with FreePBX. For example, once we have a network problem we should establish a call with text to speech to notify the support team this is my project

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.