Asterisk 1.8.20 AGI Function SAY DATETIME Does Not Play Anything When Mode In Say.conf Is Changed To “new”

Home » Asterisk Users » Asterisk 1.8.20 AGI Function SAY DATETIME Does Not Play Anything When Mode In Say.conf Is Changed To “new”
Asterisk Users 4 Comments

Hi

I am using following say.conf file. Its a default file, which comes with Asterisk installation. When I call SAY DATETIME AGI function, it simply returns without playing date & time. Where as if I use mode=old setting, it works. Is this a bug or mode=new is not implemented for SAY DATETIME AGI function?

[general]
mode=new ; method for playing numbers and dates
; old – using asterisk core function
; new – using this configuration file

[digit-base](!) ; base rule for digit strings
; XXX incomplete yet
_digit:[0-9] => digits/${SAY}
_digit:[-] => letters/dash
_digit:[*] => letters/star
_digit:[@] => letters/at
_digit:[0-9]. => digit:${SAY:0:1}, digit:${SAY:1}

[date-base](!) ; base rules for dates and times
; the ‘SAY’ variable contains YYYYMMDDHHmm.ss-dow-doy
; these rule map the strftime attributes.
_date:Y:. => num:${SAY:0:4} ; year, 19xx
_date:[Bbh]:. => digits/mon-$[${SAY:4:2}-1] ; month name, 0..11
_date:[Aa]:. => digits/day-${SAY:16:1} ; day of week
_date:[de]:. => num:${SAY:6:2} ; day of month
_date:[H]:. => digits/oh, num:${SAY:8:2} ; hour (oh one, oh two,
…, oh nine, ten, eleven, …, twenty-three)
_date:[I]:. => num:$[${SAY:8:2} % 12] ; hour 0-12
_date:[M]:. => num:${SAY:10:2} ; minute
; XXX too bad the ‘?’ function does not remove the quotes
; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? “p-m” :: “a-m”]
; am pm
_date:[pP]:. => digits/p-m ; am pm
_date:[S]:. => num:${SAY:13:2} ; seconds
_date:[Ii]:. => num:$[${SAY:8:2} % 12] ; hour 0-12
_date:[k]:. => num:${SAY:8:2} ; hour (one, two. three, …,twenty three
_date:[m]:. => num:${SAY:4:2} ; month number
_date:[Q]:. => date:dby ;incompleat ; “today”, “yesterday” or ABdY
_date:[q]:. => date:dby ;incompleat ; “” (for today), “yesterday”, weekday, or ABdY
_date:[R]:. => date:HM${SAY} ; 24 hour time, including minute
_date:[T]:. => date:HMS${SAY} ; 24 hour, minure, seconds

[en-base](!)
_[n]um:0. => num:${SAY:1}
_[n]um:X => digits/${SAY}
_[n]um:1X => digits/${SAY}
_[n]um:[2-9]0 => digits/${SAY}
_[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
_[n]um:X00 => num:${SAY:0:1}, digits/hundred
_[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}

_[n]um:X000 => num:${SAY:0:1}, digits/thousand
_[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
_[n]um:XX000 => num:${SAY:0:2}, digits/thousand
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
_[n]um:XXX000 => num:${SAY:0:3}, digits/thousand
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}

_[n]um:X000000 => num:${SAY:0:1}, digits/million
_[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
_[n]um:XX000000 => num:${SAY:0:2}, digits/million
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
_[n]um:XXX000000 => num:${SAY:0:3}, digits/million
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}

_[n]um:X000000000 => num:${SAY:0:1}, digits/billion
_[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
_[n]um:XX000000000 => num:${SAY:0:2}, digits/billion
_[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
_[n]um:XXX000000000 => num:${SAY:0:3}, digits/billion
_[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}

; enumeration
_e[n]um:X => digits/h-${SAY}
_e[n]um:1X => digits/h-${SAY}
_e[n]um:[2-9]0 => digits/h-${SAY}
_e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1}
_e[n]um:[1-9]00 => num:${SAY:0:1}, digits/h-hundred
_e[n]um:[1-9]XX => num:${SAY:0:1}, digits/h-hundred, enum:${SAY:1}

[en_GB](date-base,digit-base,en-base)
_[n]um:XXX => num:${SAY:0:1}, digits/hundred, vm-and, num:${SAY:1}

Thanks & Regards, Amit Patkar

4 thoughts on - Asterisk 1.8.20 AGI Function SAY DATETIME Does Not Play Anything When Mode In Say.conf Is Changed To “new”

  • Processing of say.conf is performed by the app_playback module, not by the Asterisk core itself. Do you have the app_playback module loaded? If you run the CLI command “say load”, what does it report?

    Matt

  • Thanks Matt.

    app_playback module is loaded. I am able to play numbers.Issue is only with date & time and only with SAY DATETIME function. If I use SAY DATE, date is getting played. Do I need to check some other settings?

    Thanks & Regards, Amit Patkar

  • Hi Matt,

    As required, please find DEBUG trace for datetime function. I have used this function in Dialplan to capture DEBUG trace. I hope, this can help us in resolving the issue.

    [Jul 2 15:54:44] DEBUG[2698] chan_sip.c: Checking device state for peer
    1001
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: Changing state for SIP/1001
    – state 2 (In use)
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: device ‘SIP/1001’ state ‘2’
    [Jul 2 15:54:44] DEBUG[2737] pbx.c: Launching ‘Answer’
    [Jul 2 15:54:44] VERBOSE[2737] pbx.c: — Executing [6666@avhan:1]
    Answer(“SIP/1001-00000000”, “”) in new stack
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: No provider found, checking channel drivers for SIP – 1001
    [Jul 2 15:54:44] DEBUG[2698] chan_sip.c: Checking device state for peer
    1001
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: Changing state for SIP/1001
    – state 2 (In use)
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: device ‘SIP/1001’ state ‘2’
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: SIP answering channel:
    SIP/1001-00000000
    [Jul 2 15:54:44] DEBUG[2737] res_rtp_asterisk.c: Setting the marker bit due to a source update
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Setting framing from config on incoming call
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: ** Our capability: 0x4 (ulaw)
    Video flag: True Text flag: True
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: ** Our prefcodec: 0x0 (nothing)
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: — Done with adding codecs to SDP
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Done building SDP. Settling with this capability: 0x4 (ulaw)
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Trying to put ‘SIP/2.0 200’
    onto UDP socket destined for 192.168.2.18:7490
    [Jul 2 15:54:44] DEBUG[2734] app_queue.c: Device ‘SIP/1001’ changed to state ‘2’ (In use) but we don’t care because they’re not a member of any queue.
    [Jul 2 15:54:44] DEBUG[2734] app_queue.c: Device ‘SIP/1001’ changed to state ‘2’ (In use) but we don’t care because they’re not a member of any queue.
    [Jul 2 15:54:44] DEBUG[2734] app_queue.c: Device ‘SIP/1001’ changed to state ‘2’ (In use) but we don’t care because they’re not a member of any queue.
    [Jul 2 15:54:44] DEBUG[2722] chan_sip.c: = Looking for Call ID:
    YjNlMjU5YTJlMmQ5Njc3YjQ1MDgyMDg3ZjI1ZDViMmY. (Checking From) –From tag
    226b515a –To-tag as6e727cd7
    [Jul 2 15:54:44] DEBUG[2722] chan_sip.c: **** Received ACK (6) –
    Command in SIP ACK
    [Jul 2 15:54:44] DEBUG[2722] chan_sip.c: Stopping retransmission on
    ‘YjNlMjU5YTJlMmQ5Njc3YjQ1MDgyMDg3ZjI1ZDViMmY.’ of Response 2: Match Found
    [Jul 2 15:54:44] DEBUG[2737] pbx.c: Launching ‘DateTime’
    [Jul 2 15:54:44] VERBOSE[2737] pbx.c: — Executing [6666@avhan:2]
    DateTime(“SIP/1001-00000000”, “1365120000,,YBd”) in new stack
    [Jul 2 15:54:44] DEBUG[2737] app_playback.c: string
    depth <0>
    [Jul 2 15:54:44] DEBUG[2737] app_playback.c: try
    in
    [Jul 2 15:54:44] DEBUG[2737] pbx.c: Launching ‘Hangup’
    [Jul 2 15:54:44] VERBOSE[2737] pbx.c: — Executing [6666@avhan:3]
    Hangup(“SIP/1001-00000000”, “”) in new stack
    [Jul 2 15:54:44] DEBUG[2737] pbx.c: Spawn extension (avhan,6666,3)
    exited non-zero on ‘SIP/1001-00000000’
    [Jul 2 15:54:44] VERBOSE[2737] pbx.c: == Spawn extension (avhan,
    6666, 3) exited non-zero on ‘SIP/1001-00000000’
    [Jul 2 15:54:44] DEBUG[2737] channel.c: Soft-Hanging up channel
    ‘SIP/1001-00000000’
    [Jul 2 15:54:44] DEBUG[2737] channel.c: Hanging up channel
    ‘SIP/1001-00000000’
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Hangup call SIP/1001-00000000, SIP callid YjNlMjU5YTJlMmQ5Njc3YjQ1MDgyMDg3ZjI1ZDViMmY.
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Updating call counter for incoming call
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: No provider found, checking channel drivers for SIP – 1001
    [Jul 2 15:54:44] DEBUG[2698] chan_sip.c: Checking device state for peer
    1001
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: Changing state for SIP/1001
    – state 1 (Not in use)
    [Jul 2 15:54:44] DEBUG[2698] devicestate.c: device ‘SIP/1001’ state ‘1’
    [Jul 2 15:54:44] DEBUG[2737] res_rtp_asterisk.c: Setting RTCP address on RTP instance ‘0x98ac7f0’
    [Jul 2 15:54:44] DEBUG[2737] netsock2.c: Splitting ‘192.168.2.18:7490’
    into…
    [Jul 2 15:54:44] DEBUG[2737] netsock2.c: …host ‘192.168.2.18’ and port ‘7490’.
    [Jul 2 15:54:44] DEBUG[2737] chan_sip.c: Trying to put ‘BYE sip:100’
    onto UDP socket destined for 192.168.2.18:7490

    Thanks & Regards, Amit Patkar

  • So, these statements show that it is actually using the config file to try to say the datetime:

    [Jul 2 15:54:44] VERBOSE[2737] pbx.c: — Executing [6666@avhan:2]
    DateTime(“SIP/1001-00000000”, “1365120000,,YBd”) in new stack
    [Jul 2 15:54:44] DEBUG[2737] app_playback.c: string
    depth <0>
    [Jul 2 15:54:44] DEBUG[2737] app_playback.c: try
    in

    The DEBUG statements in app_playback indicate the following:
    * It will use the configuration in the [en] context (no language was specified, so it defaults to en)
    * It will use the configuration in the datetime extension
    * It will attempt a match in the datetime extension on datetime:YBd
    * It will attempt to say 201304050530.00-5- 94 based on whatever extension pattern matches datetime:YBd

    Looking at your say.conf config file, you don’t have an extension that matches “datetime”. You have one that matches “date” and “time”, but not the combination of the two.

    Matt