Hi guys , meet a critical problem when using ari in asterisk!!!
1. install version 14.7.2 with shell script below:
git clone -b 14.7.2 --depth 1 https://github.com/asterisk/asterisk.git && \
$COMPILE_DIR/asterisk/contrib/scripts/install_prereq install
cd $COMPILE_DIR/asterisk
# Configure
mkdir $COMPILE_DIR/downloads && \
wget -O $COMPILE_DIR/downloads/pjproject-2.6.tar.bz2 http://www.pjsip.org/release/2.6/pjproject-2.6.tar.bz2 && \
wget -O $COMPILE_DIR/downloads/pjproject-2.6.md5 http://www.pjsip.org/release/2.6/MD5SUM.TXT
contrib/scripts/get_mp3_source.sh
./configure --prefix=$INSTALL_DIR --libdir=/usr/lib64 --with-externals-cache=$COMPILE_DIR/downloads --with-pjproject-bundled
make menuselect/menuselect menuselect-tree menuselect.makeopts && \
menuselect/menuselect --disable BUILD_NATIVE \
--enable format_mp3 menuselect.makeopts \
--enable app_fax menuselect.makeopts \
--enable codec_opus menuselect.makeopts \
--enable codec_silk menuselect.makeopts \
--enable BETTER_BACKTRACES menuselect.makeopts \
--disable MOH-OPSOUND-WAV \
--enable MOH-OPSOUND-GSM \
menuselect.makeopts
make 1> /dev/null
make install 1> /dev/null
make install samples
2. I edit the “http.conf”
[general]
servername=Asterisk
enabled=yes
bindaddr=0.0.0.0:8087
**"ari.conf"**
[general]
enabled = yes
pretty = no
allowed_origins = * ;
[mashuishui]
type = user
read_only = no
password = 123456
**"extensions.conf"**
[default]
exten => 1000,1,NoOp()
same => n,Stasis(pttProxy)
same => n,Hangup()
3. enter cli asterisk -vvvvvr && connect with
wscat -c “ws://“Server IP”:8087/ari/events?api_key=mashuishui:123456&app=pttProxy”
but get error :
error: Error: unexpected server response (500)
and In asterisk console:
<— Sending ARI response to “Connect IP”:51425 —>
0 (null)
then I use web “ari.asterisk.org” to connect :
<— Sending ARI response to “Client IP”:51689 —>
0 (null)
Access-Control-Allow-Origin: http://ari.asterisk.org
Access-Control-Allow-Credentials: true
4. I tried to reinstall asterisk with :
make clean make uninstall-all and the install script in section 1
I still got the same error
&& I tried change http bind port in http.conf, still the same …
Question:
I dont know how to solve this… i have tried everything i thought…