Hi everybody,
I have been working on a system through ARI through C++. I have been able to execute almost all kind of command, such as play, get digits, mute, unmute, create a bridge, insert a created channel on this bridge, for example. But there is an important feature my system has to have that is not working. When a user is listening to and audio and press some digit, the audio has to stop. This way the system can process the digit the user entered and play the next audio. I implemented the suggested command for stop a playback ( https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Playbacks+REST+API#Asterisk14PlaybacksRESTAPI-stop ), I mean, the DELETE for /playbacks/{playbackId}.
I am able to play an audio and get a playbackId ( since I provided one I choosed at the command I sent ).
For example, I send a play command and try to stop this play. But this doen’t work.
PLAY COMMAND - "/ari/channels/{CHANNEL ID}/play/{PLAY BACK ID}?media=sound:{SOUND FILE NAME}&lang={LANGUAGE}"
Bellow is the REST reosponde sent by ASTERISK
PLAY STATUS : 201
PLAY BODY : {{
“message”: “Invalid event source URI scheme”
}{
“id”: “1”,
“media_uri”: “sound:VerificaIdade_BemVindo”,
“target_uri”: “channel:1504531606.16”,
“language”: “App/Prompts/VerificaIdade”,
“state”: “queued”
}}
This command works fine, since I inserted my sound (*.alaw ) inside the directory ( /var/lib/asterisk/sounds). From this path I created the one that appears in language : /App/Prompts . So, the complete path is /var/lib/asterisk/sounds/App/Prompts. The sound file VerificaIdade.alaw is in this directory.
To stop the ongoing play, I tryed the command
"/ari/channels/{CHANNEL ID }/playbacks/{PLAY BACK ID }"
Bellow is the REST response sent by ASTERISK
STOP PLAY STATUS : 404
STOP PLAY BODY : {{
“message”: “Invalid event source URI scheme”
}{
“id”: “1”,
“media_uri”: “sound:VerificaIdade_BemVindo”,
“target_uri”: “channel:1504531606.16”,
“language”: “App/Prompts/VerificaIdade”,
“state”: “queued”
}{
“message”: “Resource not found”
}}
The same file ASTERISK audio file found and played successfully cannot by stopped through the DELETE playback command.
Someone could implement the stop playback command successfully through ARI - REST command ?
I would appreciate some feedbacks.