$num, 'description' => $foundone ); } } $type = isset($active_modules['customappsreg']['type'])?$active_modules['customappsreg']['type']:'tool'; foreach ($results as $result) { $thisexten = $result['exten']; $extenlist[$thisexten]['description'] = _("DUNDi: ").$result['description']; $extenlist[$thisexten]['status'] = 'INUSE'; $extenlist[$thisexten]['edit_url'] = 'config.php?display=dundicheck&dundiconflict=true&extdisplay='.urlencode($thisexten); } return $extenlist; } else { return array(); } } function dundicheck_lookup($num, $map) { global $astman; if ($astman) { foreach ($map as $lookup) { $response = $astman->send_request('Command',array('Command'=>"dundi lookup $num@$lookup")); if (strstr($response['data'],$num.' (EXISTS)')) { $parser = explode("@",$response['data']); $parser = explode("\n",$parser[1]); return $parser[0]; } } // if sound would have returned so return null return null; } } function dundicheck_lookup_all($num) { global $astman; $dundimap = array(); $trunklist = core_trunks_list(true); if (is_array($trunklist)) { foreach ($trunklist as $trunkprops) { if (trim($trunkprops['value']) == 'on') { // value of on is disabled and for zap we don't create a context continue; } switch ($trunkprops['tech']) { case 'DUNDI': $dundimap[] = $trunkprops['name']; break; default: } } } $results = array(); if ($astman) { foreach ($dundimap as $lookup) { $response = $astman->send_request('Command',array('Command'=>"dundi lookup $num@$lookup")); if (strstr($response['data'],$num.' (EXISTS)')) { $results[$lookup] = $response['data']; } } // if sound would have returned so return null return $results; } } ?>