Answer the question
In order to leave comments, you need to log in
Play sound file with phpari in Asterisk 16?
I want to manage Aster using ARI. Why php ?, it is closer to me.
[email protected]:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.8 (stretch)
Release: 9.8
Codename: stretch
asterisk*CLI> core show version
Asterisk 16.2.0-rc2
cat ari.conf
[general]
enabled=yes
pretty=yes
allowed_origins=*
[test_ari]
type=user
read_only=no
password=test_ari
cat http.conf
[general]
enabled=yes
enablestatic=yes
bindaddr=192.168.2.208
bindport=8088
prefix=asterisk
asterisk*CLI> ari show status
ARI Status:
Enabled: Yes
Output format: pretty
Auth realm: Asterisk REST Interface
Allowed Origins: *
User count: 1
asterisk*CLI> http show status
HTTP Server Status:
Prefix: /asterisk
Server: Asterisk/16.2.0-rc2
Server Enabled and Bound to 192.168.2.208:8088
Enabled URI's:
/asterisk/httpstatus => Asterisk HTTP General Status
/asterisk/ static/... => Asterisk HTTP Static Delivery
/asterisk/ari/... => Asterisk RESTful API
/asterisk/ws => Asterisk HTTP WebSocket
Enabled Redirects:
None.
cat phpari.ini
[general]
debug=9
logfile=console ; console for direct console output, filename for file based logging
[asterisk_ari]
username=test_ari
password=test_ari
host=192.168.2.208
port=8088
protocol=http
endpoint=/asterisk/ari
transport=ws ; ws for none encrypted, wss for encrypted (currently, only ws is supported)
[asterisk_manager]
username=test_ari
password=test_ari
host=192.168.2.208
port=8088
#!/usr/bin/env php
<?php
require_once "./vendor/autoload.php";
$conn = new phpari("hello-world"); //create new object
$channels = new channels($conn);
$response = $channels->channel_originate(
'PJSIP/1001',
NULL,
array(
"extension" => "s",
"context" => 'obzvon',
"priority" => 1,
"app" => "",
"appArgs" => "",
"callerId" => "1001",
"timeout" => -1,
"channelId" => '324234',
"otherChannelId" => ""
),
array("var1" => "cool")
);
exit(0);
?>
cat extensions.conf
[obzvon]
exten => s,1,Wait(2)
exten => s,n,Playback(/var/lib/asterisk/sounds/music)
exten => s,n,Hangup
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question