[asterisk-dev] AGI SAY DATETIME not working as expected

Tilghman Lesher tlesher at digium.com
Thu Jan 28 15:00:11 CST 2010


On Thursday 28 January 2010 13:40:49 Bryant Zimmerman wrote:
> Can anyone give me some insight into the SAY DATETIME agi command.
>
> I am giving it a value like
> SAY DATETIME 1264686554 # ABdY'digits/at'IMpT  Central
>
> When it says the date and time there are several issues.
> 1.      According to the wicki the ABdY'digits/at'IMpT string should read
> the time zone on the end but it gives me the full military time instead of
> the time zone. How do I get it to read the time zone?

Well, there are no recordings for the name of the timezone, so you'd have to
provide your own in the single quotes to read back.

> 2.      I have tried 
> many combinations for the [TIMEZONE] value. If I don't provide a value it
> reads the time in UTC if I provide any value it reads the time in the local
> machine time zone (Eastern).  What should I be using for timezone values to
> get this to work correctly?  I have tried Central, Eastern, Pacific,
> Mountain. I have tried putting US/ZoneValue and nothing seems to be
> working. I want to be able to have my app vary the time based on the time
> zone for the called party wich may be in a zone different from the Local
> Machine time zone.

Have you verified that the name of the zone you're looking for is a literal
file that can be found in /usr/share/zoneinfo on the Asterisk machine?  If the
file is not there, it won't work.  If you're on Solaris, the alternate
location is /usr/share/lib/zoneinfo.

On my system:
$ 
ls -ld /usr/share/zoneinfo/Eastern /usr/share/zoneinfo/Central /usr/share/zoneinfo/Mountain /usr/share/zoneinfo/Pacific /usr/share/zoneinfo/US
ls: cannot access /usr/share/zoneinfo/Eastern: No such file or directory
ls: cannot access /usr/share/zoneinfo/Central: No such file or directory
ls: cannot access /usr/share/zoneinfo/Mountain: No such file or directory
drwxr-xr-x 2 root root 4096 2010-01-14 00:18 /usr/share/zoneinfo/Pacific
drwxr-xr-x 2 root root 4096 2010-01-14 00:18 /usr/share/zoneinfo/US

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list