So far I have:
- Created a bridge
- Created a channel
- Added the channel to the bridge
- Instructed the channel to dial
- Answered the phone upon ring
- Created a playback resource to play into the channel
And all of that is working great, EXCEPT, I don’t hear any audio on the phone. After I call the /play method I see these websocket messages:
{
"application": "asteriskcontroller",
"asterisk_id": "54:b2:03:10:1f:3a",
"playback": {
"id": "pr0",
"language": "en",
"media_uri": "sound:/var/lib/asterisk/sounds/en/andnowstandby.wav",
"state": "playing",
"target_uri": "bridge:br0"
},
"timestamp": "2024-10-17T14:44:31.960-0400",
"type": "PlaybackStarted"
}
{
"application": "asteriskcontroller",
"asterisk_id": "54:b2:03:10:1f:3a",
"playback": {
"id": "pr0",
"language": "en",
"media_uri": "sound:/var/lib/asterisk/sounds/en/andnowstandby.wav",
"state": "failed",
"target_uri": "bridge:br0"
},
"timestamp": "2024-10-17T14:44:31.961-0400",
"type": "PlaybackFinished"
}
So clearly the “failed” state indicates something went wrong, but what? I confirmed the file (/var/lib/asterisk/sounds/en/andnowstandby.wav) exists on the PBX. And my response to the /play function call is:
{
"id": "pr0",
"language": "en",
"media_uri": "sound:/var/lib/asterisk/sounds/en/andnowstandby.wav",
"state": "queued",
"target_uri": "bridge:br0"
}
The Asterisk CLI shows:
[2024-10-17 15:03:24] WARNING[2367032]: file.c:825 ast_openstream_full: File /var/lib/asterisk/sounds/en/andnowstandby.wav does not exist in any format
[2024-10-17 15:03:24] WARNING[2367032]: file.c:1322 ast_streamfile: Unable to open /var/lib/asterisk/sounds/en/andnowstandby.wav (format (slin)): No such file or directory
[2024-10-17 15:03:24] WARNING[2367032]: res_stasis_playback.c:280 playback_final_update: 1729191804.7: Playback failed for sound:/var/lib/asterisk/sounds/en/andnowstandby.wav
so “no such file or directory” is the error, yet the file definitely exists:
root@pbx:/var/lib/asterisk/sounds/en $ ll /var/lib/asterisk/sounds/en/andnowstandby.wav
-rw-rw-r-- 1 asterisk asterisk 71042 Jan 26 2018 /var/lib/asterisk/sounds/en/andnowstandby.wav
What is going wrong? I’m wondering about codec/file format (given the slin message) but not sure. The file ownership is asterisk:asterisk with 664 permissions, so I don’t think it’s a rights issue. Is the absolute file path the issue? Grasping at straws here…