Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function transfer_or_record() {
- // get the current time and day
- // date_default_timezone_set('America/New_York');
- $hour = date('H');
- $minute = date('i');
- // make sure we're dealing with integers
- $hour = (int)$hour;
- $minute = (int)$minute;
- _log('the hour is '. $hour);
- _log('the minute is '. $minute);
- // server time is 4 hours later than EST
- if(($hour == 21 && $minute > 30) || $hour > 21 || $hour < 12) {
- say("http://hosting.tropo.com/63931/www/audio/OutsideHours.mp3");
- record_voicemail();
- } else {
- transfer(array("sip:tscmoving@sip2sip.info","+1352328xxxx","+1352328xxxx"), array(
- "playvalue" => "http://hosting.tropo.com/63931/www/audio/TransferMessage.mp3",
- "terminator" => "*",
- "timeout" => 20,
- "onTimeout" => "transfer_timeout",
- "onError" => "transfer_timeout",
- "onCallFailure" => "transfer_timeout"
- )
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement