$file_name = AASTRA_PATH_CACHE . 'w-' . $zip . '.rss'; if (!file_exists($file_name)) { $generate = 1; } else { if (time() - filemtime($file_name) > 4 * 3600) { $generate = 1; } } # If need to generate if ($generate == 1) { # Check if target directory is present if (!is_dir(AASTRA_PATH_CACHE)) { @mkdir(AASTRA_PATH_CACHE); } # Open and retrieve RSS XML file $array = Aastra_xml2array('http://www.rssweather.com/zipcode/' . $zip . '/rss.php', 0); $search = array_key_exists_r('item', $array); if ($search[0]) { if (is_array($search[1][0])) { $allItems = $search[1]; $itemCount = count($allItems); } else { $allItems[0] = $search[1]; $itemCount = 1; } } else { Aastra_debug('rss', 'Cannot open ' . 'http://www.rssweather.com/zipcode/' . $zip . '/rss.php' . ' in read mode'); $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Information not available', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); $output = $object->output();
function Aastra_agent_context_Asterisk() { # No by default $return = 'from-internal'; # Get freePBX version $array = Aastra_xml2array('/var/www/html/admin/modules/framework/module.xml'); if (substr($array['module']['version'], 0, 3) >= '2.6') { $return = 'from-queue'; } # Return result return $return; }
$generate = 1; } } else { if (time() - filemtime($file_name) > $ttl[$index]) { $generate = 1; } } } # If need to generate if ($generate == 1) { # Check if target directory is present if (!is_dir(AASTRA_PATH_CACHE)) { @mkdir(AASTRA_PATH_CACHE); } # Open and retrieve RSS XML file $array = Aastra_xml2array($xml[$index], 0); $search = array_key_exists_r('item', $array); if ($search[0]) { if (is_array($search[1][0])) { $allItems = $search[1]; $itemCount = count($allItems); } else { $allItems[0] = $search[1]; $itemCount = 1; } } else { Aastra_debug('rss', 'Cannot open ' . $xml[$index] . ' in read mode'); $object = new AastraIPPhoneTextScreen(); $object->setTitle(Aastra_get_label('Information not available', $language)); $object->setText(Aastra_get_label('The information you are looking for is not available at this time. Try again later.', $language)); $nb = Aastra_number_softkeys_supported();