Author Topic: ตัวอย่างการเขียน agi connect กับ elastix  (Read 4931 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ตัวอย่างการเขียน agi connect กับ elastix
« on: ตุลาคม 29, 2014, 04:26:00 PM »
ส่วนไฟล์ /etc/asterisk/extensions.conf ก็ประมาณนี้ครับ

โค้ด: เลือกทั้งหมด
    [from-internal]
    exten => 000,1,Answer
    exten => 000,n,AGI(myfirstagi.php)
    exten => 000,n,Hangup

ตัวอย่างการใช้งาน 1

ไฟล์ /var/lib/asterisk/agi-bin/myfirstagi.php

    #!/usr/bin/php -q
    <?php
    include ("phpagi.php");
    $agi = new AGI();
    $agi->answer();
    $a = 11;
    $b = 10;
    $sum = $a+$b;
    $agi->say_number($sum);
    ?>

    #chmod +x /var/lib/asterisk/agi-bin/myfirstagi.php

ขอบคุณข้อมูล และสามารถอ่านเพิ่มเติมได้จากที่ : http://www.voip4share.com/phpagi-where-php-connects-to-asterisk-f64/phpagi-t1017.html
« Last Edit: ตุลาคม 29, 2014, 05:01:59 PM by golfreeze »