ถ้าเรียก scripts ที่ใ้ช้ Asterisk Manager API (AMI) จากเครื่องของ Trixbox เลยไม่มีปัญหา
แต่คราวนี้สมมุติว่ามี VoIP Server 2 ตัว (VoIP1, VoIP2) เพื่อ backup, load balance กัน ส่วน scripts ที่เรียกใช้ VoIP นั้น แยกไปอยู่อีก server หนึ่ง (wsVoiceServer) ซึ่งจะเลือกว่า จะใช้ VoIP Server ไหนในการสั่งโทร
แต่พอสั่ง scripts ที่เครื่อง wsVoiceServer เพื่อติดต่อกับ VoIP1 ปรากฏว่าไม่ work ลองดู debug ใน VoIP1 พบว่า
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Connect attempt from '127.0.0.1' unable to authenticate
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Connect attempt from '127.0.0.1' unable to authenticate
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Connect attempt from '127.0.0.1' unable to authenticate
......
......
......
; Asterisk Call Management support
;
[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[admin]
secret = amp_password_ja
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
#include manager_additional.conf
#include manager_custom.conf
อันที่จริงก็ยังงงๆ อยู่ เพราะที่อ่านจาก document ผ่านๆ ตามา เราสามารถกำหนดเพิ่มไปได้เช่น
permit=127.0.0.1/255.255.255.0,192.168.1.123 แต่ไม่เห็นจะช่วยอะไรได และถ้าต้องแก้ด้วยวิธีด้านบน ต้องจำเอาไว้ว่าหากเปลี่ยน IP เครือ่ง ก็ต้องมาปรับตามด้วย ทั้งที่การใช้ 127.0.0.1 น่าจะรวมไปถึง IP ของเครื่องด้วย ซึ่ง FreePBX น่าจะฉลาดมากกว่านี้....
แสดงว่า อาจมี directive ที่สั่งให้ reload config ทุกครั้งที่ asterisk เริ่มทำงาน ต้องค้นๆ ดูเพิ่ม