Summary:ASTERISK-15421: SayUnixTime plays nothing if say.conf mode=new and a format is specified
Reporter:David Ruggles (thedavidfactor)Labels:
Date Opened:2010-01-13 11:29:43.000-0600Date Closed:2017-08-31 10:11:03
Versions:Frequency of
Description:There is no error generated, SayUnixTime simply does nothing. Any format can be specified, I have even duplicated the default format with the same result. I tried to debug it, but this seems be beyond my limited C abilities to debug.


I'm more then willing to assist with debugging this and I'll take any opportunity to learn more.
Comments:By: Mark Petersen (roadkill) 2010-08-09 05:54:52

I can also confirm that this is still a problem on 1.8.0-beta2
the proble is only in relation to date's
number play fine

By: Mark Petersen (roadkill) 2010-08-11 02:36:50

and just retestet with beta3 and trunk
here is the console output

ip-technology*CLI> core set debug 100
Core debug was 0 and is now 100
ip-technology*CLI> core set verbose 100
Verbosity was 3 and is now 100

ip-technology*CLI> say load old
setting say mode from new to old
   -- Executing [111@FromInternal:1] Answer("SIP/mpe-00000003", "") in new stack
   -- Executing [111@FromInternal:2] SayUnixTime("SIP/mpe-00000003", ",,abd") in new stack
   -- <SIP/mpe-00000003> Playing 'digits/day-3.slin' (language 'en')
   -- <SIP/mpe-00000003> Playing 'digits/mon-7.slin' (language 'en')
   -- <SIP/mpe-00000003> Playing 'digits/h-11.slin' (language 'en')
   -- Executing [111@FromInternal:3] Hangup("SIP/mpe-00000003", "") in new stack
 == Spawn extension (FromInternal, 111, 3) exited non-zero on 'SIP/mpe-00000003'

ip-technology*CLI> say load new
setting say mode from old to new
   -- Executing [111@FromInternal:1] Answer("SIP/mpe-00000004", "") in new stack
   -- Executing [111@FromInternal:2] SayUnixTime("SIP/mpe-00000004", ",,abd") in new stack
   -- Executing [111@FromInternal:3] Hangup("SIP/mpe-00000004", "") in new stack
 == Spawn extension (FromInternal, 111, 3) exited non-zero on 'SIP/mpe-00000004'

ip-technology*CLI> core show version
Asterisk SVN-trunk-r281257 built by root @ ip-technology.local on a i386 running Darwin on 2010-08-11 07:24:39 UTC

By: slimey (slimey) 2010-08-20 19:01:25

I've just stumbled across this same issue whilst trying to get SayUnixTime working correctly under

This isn't so much a code issue as a configuration issue in say.conf

If you pass in a format string to SayUnixTime, it passes this as the middle 'parameter' when looking up the rules in say.conf (e.g. in your example it'll look up datetime:abd:201008210057.xxxxx)

There's a rule in say.conf for "datetime::." (i.e. with no format specified):

   _datetime::. => date:ABdY 'digits/at' IMp:${SAY}

Assuming the parser allows it, a rule will need to be written along the line of (yes, I know this won't work):

   _datetime:.:. => date:${FORMAT}:${SAY}

By: Mark Petersen (roadkill) 2010-08-25 03:59:35

hi slimey

is this a feature request or a bug, but either way please create it as a new Issue
what do you wnat to do with ${FORMAT}, where do you plan to define it
the hole purpose with the line is to define the default format if no options has been set

By: Peter Babcsany (arywyr) 2011-04-23 12:04:49

Hi, RoadKill, slimey,

if you specify the format in the dialplan as the 3rd parameter then SayUnixTime will NOT use the default rule in the say.conf file so you need to specify a line with the exact same format.

My say.conf contains this for hungarian:
   _datetime:BdAk:. => date:BdA k 'ora':${SAY}

In the dialplan (I use AEL and this is a line with fixed date for testing):
       210 => {
               SayUnixTime(${STRPTIME(2011-05-02 08:00:00,Europe/Budapest,%Y-%m-%d %H:%M:%S)},Europe/Budapest,BdAk);

This works with Asterisk built by root @ localhost.localdomain on a x86_64 running Linux on 2011-03-30 09:55:35 UTC on CentOS.

By: Leonardo Frittelli (leof) 2012-02-23 01:17:10.065-0600

I can report that I am still seeing the same issue.
I am using Asterisk in Ubuntu 11-10 x86_64.

I can reproduce the defect with the test data provided by Peter:

exten=>210,n,SayUnixTime(${STRPTIME(2011-05-02 08:00:00,Europe/Budapest,%Y-%m-%d %H:%M:%S)},Europe/Budapest,BdAk);

The call is terminated immediately and nothing is Play'd
   -- Executing [210@users:1] Wait("SIP/leo-local-0000000b", "1") in new stack
   -- Executing [210@users:2] Answer("SIP/leo-local-0000000b", "") in new stack
   -- Executing [210@users:3] Set("SIP/leo-local-0000000b", "CHANNEL(language)=en") in new stack
   -- Executing [210@users:4] SayUnixTime("SIP/leo-local-0000000b", "1304316000,Europe/Budapest,BdAk") in new stack
   -- Auto fallthrough, channel 'SIP/leo-local-0000000b' status is 'UNKNOWN'

Here is the output for the same example, only using SayUnixTime with no arguments:

   -- Executing [210@users:1] Wait("SIP/leo-local-00000012", "1") in new stack
   -- Executing [210@users:2] Answer("SIP/leo-local-00000012", "") in new stack
   -- Executing [210@users:3] Set("SIP/leo-local-00000012", "CHANNEL(language)=en") in new stack
   -- Executing [210@users:4] SayUnixTime("SIP/leo-local-00000012", "") in new stack
   -- <SIP/leo-local-00000012> Playing 'digits/day-4.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/20.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/3.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/mon-1.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/2.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/thousand.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/12.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/at.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/7.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/2.gsm' (language 'en')
   -- <SIP/leo-local-00000012> Playing 'digits/p-m.gsm' (language 'en')
   -- Auto fallthrough, channel 'SIP/leo-local-00000012' status is 'UNKNOWN'

By: Marek Cervenka (cervajs) 2017-08-30 10:39:56.834-0500

replicated on 13.17.0 / Centos 7

By: Marek Cervenka (cervajs) 2017-08-31 07:51:49.286-0500

same problem when AGI is used
<SIP/666-0000000d>AGI Rx << SAY DATETIME 1504183693 "" dm
<SIP/666-0000000d>AGI Tx >> 200 result=0

By: Sean Bright (seanbright) 2017-08-31 10:11:04.042-0500

This is technically not a bug. The implementation leaves something to be desired, but that is neither here nor there. As others have pointed out, in order to be able to use a specific format, you need to modify {{say.conf}}. For the example {{abd}} format and assuming English, you need to open {{say.conf}} and find this block:

   _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
   _date::. => date:AdBY:${SAY}
   _time::. => date:IMp:${SAY}

Once you have found it, add another {{_datetime}}, so that you end up with this:

   _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
   _datetime:abd:. => date:abd:${SAY} ; <-- Add this line
   _date::. => date:AdBY:${SAY}
   _time::. => date:IMp:${SAY}

Restart Asterisk or run {{module reload app_playback.so}} at the CLI. Run {{say load new}}, and then try your test call.

For every custom datetime format that you want to use you have to specify a corresponding format in {{say.conf}}.

Yes it's lame. Yes it's inelegant. But it is unfortunately not a bug.