Архив рубрики: Asterisk
Php agi распечатать массив
$agi->verbose(print_r($array, true));
Вывод информации о текущих каналах
core show channels concise core show channels verbose core show channels count
Debug Agi
asterisk -rx ‘core stop now’ asterisk -vvvgc agi set debug on
Добавить Extension в очередь
member=Local/Exn-num@customer-survey-ivr/n,0,Exn-num,hint:Exn-num@ext-local
Asterisk php ivr
public function inputToInt($sound, $maxDigits = 1, $repetitions = 3) { for ($ok = 0; $ok < $repetitions; $ok++) { $input = $this->agi->get_data($sound, 3000, $maxDigits)[‘result’]; if ($input) { return $input; } elseif ($ok == 2) { $this->agi->stream_file($this->path . ‘akasha-error’); exit(); } $this->agi->stream_file($this->path . ‘maharehet-mamtina-le-phira’); } }
Agi commands php
Asterisk ivr
[main-entry] exten => s,1,Answer exten => s,n,Playback(sound) exten => s,n,Set(numTries=0) exten => s,n(naberite),Background(sound) exten => s,n,WaitExten(3) exten => 1,1,Goto(blacklist,s,1) exten => 2,1,Dial(IAX2/asterisk/1000,,m) exten => 3,1,Dial(IAX2/asterisk/1000,,m) exten => 4,1,Dial(IAX2/asterisk/1000,,m) exten => 0,1,Dial(IAX2/asterisk/1000,,m) exten => i,1,Playback(/var/lib/asterisk/agi-bin/register/sound/pbx-invalid) exten => i,n,Goto(s,naberite) exten => t,1,Set(numTries=$[${numTries} + 1]) exten => t,n,GotoIf($[«${numTries}» < «3»]?s,naberite) exten => t,n,Dial(IAX2/asterisk/1000,,m)
Asterisk start Agi
#!/usr/bin/php -q <?php require(‘/var/lib/asterisk/agi-bin/phpagi.php’); $agi = new AGI(); $agi->answer();
Agi php back to extensions
Agi php back to extensions $agi->exec_goto(‘menu-change-address,s,1’); $agi->exec(‘Goto’, «app-daynight,1,1»);
