return strtolower(trim($argv['1'])); } function get_type() { global $argv; return strtolower(trim($argv['2'])); } ################################################################### # Main code ################################################################### $agi = new AGI(); $exten = agi_get_variable("USER"); $action = get_action(); $type = get_type(); # VM exists? if (check_for_voicemail_box($exten)) { # Retrieve Spooler directory $spool_dir = agi_get_variable('ASTSPOOLDIR'); # Depending on message type switch ($type) { case 'temp': $play = 'vm-rec-temp'; $file = $spool_dir . '/voicemail/default/' . $exten . '/temp'; break; case 'name': $play = 'vm-rec-name'; $file = $spool_dir . '/voicemail/default/' . $exten . '/greet'; break; case 'busy': $play = 'vm-rec-busy'; $file = $spool_dir . '/voicemail/default/' . $exten . '/busy';
# New AGI $agi = new AGI(); # Retrieve calling extension $exten = $agi->request['agi_callerid']; # Retrieve parameters $array = read_session('vmail', $exten); $action = $array['action']; $type = $array['type']; $user = $array['user']; if ($type == 'message') { $action = 'play'; $folder = $array['folder']; $msgid = $array['msgid']; } # VM exists? if (check_for_voicemail_box($user)) { # Retrieve Spooler directory $spool_dir = agi_get_variable('ASTSPOOLDIR'); # Depending on message type switch ($type) { case 'temp': $play = 'vm-rec-temp'; $file = $spool_dir . '/voicemail/default/' . $user . '/temp'; break; case 'name': $play = 'vm-rec-name'; $file = $spool_dir . '/voicemail/default/' . $user . '/greet'; break; case 'busy': $play = 'vm-rec-busy'; $file = $spool_dir . '/voicemail/default/' . $user . '/busy';