#!/usr/local/bin/php -q 'nomoney', '3' => 'frozen' ); /** * End of config section */ $stdin = fopen('php://stdin', 'r'); $stdout = fopen('php://stdout', 'w'); $number=$argv[1]; $url = $ubillingApiUrl . '?module=remoteapi&key=' . $ubillingSerial . '&action=telepony&number=' . $number; $user = file_get_contents($url); $user = trim($user); if (isset($userStates[$user])) { //uncomment following line to debug detected caller id user state //fputs($stdout,'SAY ALPHA "'.$userStates[$user].'" ""'.PHP_EOL); fputs($stdout,'EXEC PLAYBACK "/usr/local/etc/asterisk/ivr_media/'.$userStates[$user].'" ""'.PHP_EOL); fflush($stdout); } fclose ($stdin); fclose ($stdout); exit(0);