Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (4)

View Page History
{zone-data:use-cases}
{deck:id=UseCases1}
{card:label=Basic example}
#!/usr/bin/php
<?php

require_once __DIR__ . '/../application/Init.php';
use Zend\Telephony\Asterisk\Agi;

$options = array('debugFile' => '/debug');
$agi = new Agi($options);
$agi->answer();

// We can't just write to stdout, so we're logging to a file
$agi->writeDebug($agi::DEBUG_INFO, $agi->exec('PLAYBACK vm-INBOX'));
$agi->writeDebug($agi::DEBUG_INFO, print_r($agi->getLastResult(),1));

sleep(20);
$agi->hangup();{card}
{card:label=How Asterisk works}
For now I will only assume usage of the AGI interface. The story is that someone calls an asterisk server (#1). The caller will hear a message describing what options they can choose from (#6). Then this person wants to hear this message again (#9). When listening to it again (#11), he chooses option 3 (sales) (#13), but no one is present (#17). As such, the caller is redirected to a voicemail (#19). After having recorded the voicemail (#24) sales is sent an email that a voicemail is awaiting them (#24). PHP shuts down (#26).
26. PHP tells asterisk (STDOUT) to close the channel
27. Asterisk hangs up PHP quits {code}
{card}{card:label=Basic example}
#!/usr/bin/php {card}
<?php

require_once __DIR__ . '/../application/Init.php';
use Zend\Telephony\Asterisk\Agi;

$options = array('debugFile' => '/debug');
$agi = new Agi($options);
$agi->answer();

// We can't just write to stdout, so we're logging to a file
$agi->writeDebug($agi::DEBUG_INFO, $agi->exec('PLAYBACK vm-INBOX'));
$agi->writeDebug($agi::DEBUG_INFO, print_r($agi->getLastResult(),1));

sleep(20);
$agi->hangup();{card}
{deck}