Telegram - . ? :)

! Asterisk . PHP, Perl C, Pascal Shell. , Asterisk AGI (Asterisk Gateway Interface) .


?

AGI - ( ) Asterisk. , - . Asterisk AGI, . agi_:

agi_request trunk.php
agi_channel , Local/89123456789@from-internal-00000002;2
agi_language en
agi_type , Local
agi_uniqueid 1497364935.15
agi_version Asterisk 13.10.0
agi_callerid (CID Number) 89123456789
agi_calleridname (CID Name) 89123456789
agi_dnid unknown
agi_context macro-dialout-trunk

AGI ?

AGI : , /var/lib/asterisk/agi-bin/. , . , trunk.php:

chmod 755 /var/lib/asterisk/agi-bin/trunk.php
chown asterisk:asterisk /var/lib/asterisk/agi-bin/trunk.php

, , :

exten => 1333,n,AGI(trunk.php)

, ? ? :

exten => 1333,n,AGI(trunk.php, ${CALLERID(number)})
Asterisk Gateway Interface (AGI)
?

PHP. . :

#!/usr/bin/php -q
<?php
require('phpagi.php'); 
$agi = new AGI(); //  phpagi.php  1  2     
$cid = $agi->request['agi_callerid']; //   AGI  
mail("info@merionet.ru", '!', '   :', $cid); //  
?>

. , .


?

 .

P.S. , :)

"",