login | register
Fri 09 of May, 2008 [16:58 UTC]

voip-info.org

Search with Google
Search this site with Google. Results may not include recent changes.
 
Google Ads
Shoutbox
  • Nick Barnes, Fri 09 of May, 2008 [11:36 UTC]: Christopher - yesterday I tried an Asterisk install on a CentOS 5.1 box with stock GUI and it all worked fine. Sorry I can't help.
  • aero, Fri 09 of May, 2008 [08:20 UTC]: can someone help me out on this, i tried to play some sound files on my asterisk box and this is the error message i got. WARNING[4429]: format_wav.c:169 check_header: Unexpected freqency 22050 May 8 11:17:39 WARNING[4433]: codec_gsm.c:194 gsmtolin_fra
  • Christopher Faust, Thu 08 of May, 2008 [14:15 UTC]: I beleive that I may have to change something in the xserver configuration. Please advise
  • Christopher Faust, Thu 08 of May, 2008 [14:14 UTC]: Everything was perfect. In the bios I have increased the memory allocated Still receive input not supported on my display.
  • Christopher Faust, Thu 08 of May, 2008 [14:13 UTC]: This would not be my main box. I am doing some testing to see if I can install zaptel and asterisk 1.4 on a full centos 5.1 box with development software Its bizzare, because before I went through the asterisk and zaptel installation everything was perfe
  • Nick Barnes, Thu 08 of May, 2008 [13:44 UTC]: Christopher - I can't see any way in which an Asterisk installation would muck your GUI, but remember that it is advised not to use a GUI on an Asterisk box anyway.
  • Christopher Faust, Wed 07 of May, 2008 [15:28 UTC]: When I try to startx I ge input not supported. Though before installing asterisk I had no video issue to start the GUI
  • Christopher Faust, Wed 07 of May, 2008 [15:26 UTC]: Hi Nick, I got centos 5.1 and asterisk up But now I cannot start startx I have set the depth from 24 to 16 for the video i810 driver for the i845 on my netvista machine but I cannot start GNOME. Please advise
  • Nick Barnes, Wed 07 of May, 2008 [10:01 UTC]: Howard - You'll need to provide a lot more information if you really want help.
  • Nick Barnes, Wed 07 of May, 2008 [10:00 UTC]: Christopher - Search the Wiki and you'll find a page I wrote detailing exactly what you have to do for Asterisk 1.4 + CentOS 5.1.
Server Stats
  • Execution time: 0.37s
  • Memory usage: 2.19MB
  • Database queries: 29
  • GZIP: Disabled
  • Server load: 1.24

say datetime

SAY DATETIME <time> <escape digits> [format] [timezone]

Say a given date and time, returning early if any of the given DTMF digits are received on the channel.

<time> is number of seconds elapsed since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
[format] is the format the time should be said in. See voicemail.conf (defaults to "ABdY 'digits/at' IMp").
Acceptable values for [timezone] can be found in /usr/share/zoneinfo. Defaults to machine default.

Returns:
failure: 200 result=-1
success: 200 result=0
digit pressed: 200 result=<digit>

<digit> is the ascii code for the digit pressed.


Go back to Asterisk AGI
Created by Adam Higerd, Last modification by Adam Higerd on Thu 13 of Oct, 2005 [15:46 UTC]

Comments Filter

accurate talking clock example

by Chris on Sunday 29 of July, 2007 [05:46:23 UTC]

#!/usr/bin/perl
###############################################################################
#           ACCURATE TALKING CLOCK script for use with ASTERISK PBX
###############################################################################
# Created by Chris Walton July 22/2007; tested with Asterisk 1.4.6
# Use it, copy it, do what you wish with it!
###############################################################################
# This script will generate a 1.5s beep at 0, 15, 30, and 45 seconds past
#  each minute.
# It uses sub-second time delays in order to be as accurate as possible.
# The time is annoumced in English at 11 seconds before the beep.
# Warning "blips" play and 2 seconds and 1 second before the beep.
###############################################################################
# After writing this simple test I put it to a simple test:
# I tuned my shortwave radio to pick up the National Research Council of
# Canada official time broadcasts.
# I launched this script at the same time.
# The beeps from the radio and the beeps from this program were very much in
#  sync.
###############################################################################
# This script interfaces with the Asterisk AGI module.
# It should be installed in /var/lib/asterisk/agi-bin.
# To use, place the line:      "exten => xxx,1,AGI(talking-clock.agi)"
#  in an appropriate context of the extensions.conf file. Replace "xxx" with
#  an unused extension of your choice.
###############################################################################
# Requirements (nothing you don't already have) :
# 1) Asterisk PBX software with AGI module enabled.
# 2) Perl with "Time::HiRes" module.  If you have perl, you probably have the
#     Time::HiRes module; it is part of the core perl distribution.
# 3) The "at-tone-time-exactly" sound file which is part of the "extra-sounds"
#     tarballs available at http://ftp.digium.com/pub/telephony/sounds/
###############################################################################
# 1st PASS example... assume program starts at 5.5 seconds past the minute:
# ----------------------------------------------------------------------------
# 0    1    2    3    4    5    6    7    8    9    10   11   12  13   14   15
#                             ->BLIP>BLIP>BLIP>BLIP>BLIP>BLIP>BLI>BLIP>BLIP>BEEP
###############################################################################
# normal operation (loop):
# ----------------------------------------------------------------------------
# 0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15
# BEEP--->SILENCE----->TIME_ANNOUNCEMENT_FOLLOWED_BY_SILENCE----->BLIP>BLIP>BEEP
###############################################################################

use Time::HiRes ("usleep", "gettimeofday");

$blip="!523/20,!0/980";      # 20ms blip followed by 980ms silence.
$beep="!415/1500";           # 1.5s beep.
$silence="!0/500";           # 0.5s silence.

# Turn off output buffering to stop dead lock.
$|=1;

sub status {
  # AGI function status is avaialbe on STDIN
  my $cmd=shift;
  my $status=<STDIN>;
  if ( $status !~ /^200 result=0/ ){
    print STDERR "$cmd returned with bad status ($status)\n";
    exit -1;
  }
}

# STDIN will initially contain assorted channel information. Discard it all.
while(<STDIN>) {
        chomp;
        last unless ($_);
}

# Answer the channel
print "ANSWER\n"; 
status("Exec Answer");

while (1){
  my ($seconds,$microseconds)=gettimeofday;

  # Sleep until the next second rolls around.
  usleep (1000000-$microseconds);

  # Calculate number of seconds left before the beep.
  my $time_til_beep=14-($seconds%15);

  if ( $time_til_beep < 11 ){

    # Insufficient time to announce the time; just play blips.
    # This should only occur on first pass.
    print "EXEC PlayTones ", ("$blip," x $time_til_beep), $beep, "\n"; 
    status("Exec PlayTones");

    # Sleep while the blips and beep are playing.
    usleep ( $time_til_beep * 1000000 + 1500000 ) ;

  } else {

    # We have sufficient time to announce what the time will be at the beep.
    $time_at_beep=$seconds + $time_til_beep + 1;

    # Sleep until 11 seconds before the beep and then announce the time.
    usleep ( ($time_til_beep - 11 ) * 1000000 );
    print qq{STREAM FILE at-tone-time-exactly ""\n};
    status("Stream File");
    print qq{SAY DATETIME $time_at_beep "#" "IM'vm-and'S'seconds'\n};
    status("Say DateTime");

    # We need to get the time again because we don't know how long
    # the announcement took to play.
    ($seconds,$microseconds)=gettimeofday;

    # Now sleep until 2.5 seconds before the beep.
    my $delay=12500000 - $microseconds - (($seconds%15)*1000000) ;
    next if ( $delay < 0); # abort if annoucment took too long to play.
    usleep ($delay);

    # Now play two warning blips followed by the beep.
    # Preceeding the blips with .5s silence ensures the 1st blip is heard.
    print "EXEC PlayTones $silence,$blip,$blip,$beep\n";
    status("Exec PlayTones");

    # Sleep while the blips and beep are playing.
    usleep 4000000;
  }
}


Please update this page with new information, just login and click on the "Edit" or "Add Comment" button above. Get a free login here: Register Thanks! - support@voip-info.org

Page Changes | Comments

Sponsored by:

Terms of Service Privacy Policy
© 2003-2008 VOIP-Info.org LLC

Powered by bitweaver