AEL Keyword IfTime With Variable On Time Range

Home » Asterisk Users » AEL Keyword IfTime With Variable On Time Range
Asterisk Users 3 Comments

Hi

It’s possible using a variable in the iftime keyword argument?

E.g:

context text {
s => {
timerange = ’06:00-12:00|*|*|*’;
ifTime(${timerange} {
Playback(ivr/goodbye);
}
}
}

thanks

[image: Sua Foto] Rafael S. SaraivaPorto Alegre – RS
| Mobile: (51) 8174-7956

3 thoughts on - AEL Keyword IfTime With Variable On Time Range

  • ——=_NextPart_001_003A_01D08CB2.538E33C0
    Content-Type: text/plain;
    charset=”utf-8″
    Content-Transfer-Encoding: quoted-printable

    You should try it and find out if it works. If it does, let us know.

    Regards;

    John

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Rafael dos Santos Saraiva Sent: Tuesday, May 12, 2015 11:58 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion Subject: [asterisk-users] AEL keyword IfTime with variable on time range

    Hi

    It’s possible using a variable in the iftime keyword argument?

    E.g:

    context text {

    s => {

    timerange = ’06:00-12:00|*|*|*’;

    ifTime(${timerange} {

    Playback(ivr/goodbye);

    }

    }

    }

    thanks

    Image removed by sender. Sua Foto

    Rafael S. Saraiva

    Porto Alegre – RS | Mobile: Image removed by sender. (51) 8174-7956

    <http://br.linkedin.com/pub/rafael-saraiva/52/aab/230> Image removed by sender. <https://plus.google.com/u/0/+RafaelSaraivaRS> Image removed by sender.

    ——=_NextPart_001_003A_01D08CB2.538E33C0
    Content-Type: text/html;
    charset=”utf-8″
    Content-Transfer-Encoding: quoted-printable

  • –001a11c3170083f5080515e5f862
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Sorry, I forget to tell I tried, but not works.

    *Context:*
    context ivr_temp2 {
    s => {
    Proceeding();
    str_time_01 = ’06:00-12:00|*|*|*’; // Manhã
    ifTime (${str_time_01}) {
    Playback(ura/bom_dia);
    }
    }
    }

    The error is showed on “ael reload”.

    *Console errors:*
    rs0000sr304*CLI> ael reload Command ‘ael reload’ failed.
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:164 pbx_load_module: Starting AEL load process.
    [May 12 14:31:52] ERROR[20773]: ael.y:840 ael_yyerror: ==== File:
    /etc/asterisk/extensions.ael, Line 315, Cols: 32-32: Error: syntax error, unexpected ‘)’, expecting ‘|’
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:177 pbx_load_module: AEL load process: parsed config file name ‘/etc/asterisk/extensions.ael’.
    [May 12 14:31:52] ERROR[20773]: pbx_ael.c:197 pbx_load_module: Sorry, but 1
    syntax errors and 0 semantic errors were detected. It doesn’t make sense to compile.

    [image: Sua Foto] Rafael S. SaraivaPorto Alegre – RS
    | Mobile: (51) 8174-7956
    <http://br.linkedin.com/pub/rafael-saraiva/52/aab/230>
    <https://plus.google.com/u/0/+RafaelSaraivaRS>

    2015-05-12 13:51 GMT-03:00 Tech Support :

    –001a11c3170083f5080515e5f862
    Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Sorry, I forget to tell I tried, but not works.

    Context:
    context ivr_temp2 {
        s => {
            Proceeding();
            str_time_01 = '06:00-12:00|*|*|*';              // Manhã
            ifTime (${str_time_01}) {
    Playback(ura/bom_dia);
            }
        }
    }
    The error is showed on "ael reload".
    Console errors:
    rs0000sr304*CLI> ael reload
    Command 'ael reload' failed.
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:164 pbx_load_module: Starting AEL load process.
    [May 12 14:31:52] ERROR[20773]: ael.y:840 ael_yyerror: ==== File: /etc/asterisk/extensions.ael, Line 315, Cols: 32-32: Error: syntax error, unexpected ')', expecting '|'
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:177 pbx_load_module: AEL load process: parsed config file name '/etc/asterisk/extensions.ael'.
    [May 12 14:31:52] ERROR[20773]: pbx_ael.c:197 pbx_load_module: Sorry, but 1 syntax errors and 0 semantic errors were detected. It doesn't make sense to compile.

    Sua Foto Rafael S. Saraiva
    Porto Alegre – RS | Mobile:  (51) 8174-7956
     

    2015-05-12 13:51 GMT-03:00 Tech Support <asterisk@voipbusiness.us>:

    You should try it and find out if it works. If it does, let us know.

    Regards;

    John

     

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Rafael dos Santos Saraiva
    Sent: Tuesday, May 12, 2015 11:58 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion
    Subject: [asterisk-users] AEL keyword IfTime with variable on time range

     

    Hi

     

    It's possible using a variable in the iftime keyword argument?

     

    E.g:

     

    context text {

     s => {

      timerange = '06:00-12:00|*|*|*';

      ifTime(${timerange} {

       Playback(ivr/goodbye);

      }

     }

    }

     

     

    thanks


     

    Image removed by sender. Sua Foto

    Rafael S. Saraiva

    Porto Alegre – RS | Mobile: Image removed by sender. (51) 8174-7956

    Image removed by sender. Image removed by sender.

     


    _____________________________________________________________________
    — Bandwidth and Colocation Provided by http://www.api-digital.com
    New to Asterisk? Join us for a live introductory webinar every Thurs:
                   http://www.asterisk.org/hello

    asterisk-users mailing list
    To UNSUBSCRIBE or update options visit:
       http://lists.digium.com/mailman/listinfo/asterisk-users

    –001a11c3170083f5080515e5f862

  • –089e0122e6aa05a67c051601b42d Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Solved!!

    Set(time_01=06:00-12:00,*,*,*);
    Set(time_02=12:00-18:00,*,*,*);
    Set(time_03=18:00-06:00,*,*,*);

    if(${IFTIME(${time_01}?1:0)} == 1) {
    NoOp(“Bom dia”);
    Playback(beep);
    } else if(${IFTIME(${time_02}?1:0)} == 1) {
    NoOp(“Boa tarde”);
    Playback(beep);
    } else if(${IFTIME(${time_03}?1:0)} == 1) {
    NoOp(“Boa noite”);
    Playback(beep);
    }

    Thank’s

    [image: Sua Foto] Rafael S. SaraivaPorto Alegre – RS
    | Mobile: (51) 8174-7956
    <http://br.linkedin.com/pub/rafael-saraiva/52/aab/230>
    <https://plus.google.com/u/0/+RafaelSaraivaRS>

    2015-05-12 14:39 GMT-03:00 Rafael dos Santos Saraiva :

    –089e0122e6aa05a67c051601b42d Content-Type: text/html; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    Solved!!

    Set(time_01=06:00-12:00,*,*,*);
    Set(time_02=12:00-18:00,*,*,*);
    Set(time_03=18:00-06:00,*,*,*);
    if(${IFTIME(${time_01}?1:0)} == 1) {
    NoOp("Bom dia");
    Playback(beep);
    } else if(${IFTIME(${time_02}?1:0)} == 1) {
    NoOp("Boa tarde");
    Playback(beep);
    } else if(${IFTIME(${time_03}?1:0)} == 1) {
    NoOp("Boa noite");
    Playback(beep);
    }
    Thank's

    Sua Foto Rafael S. Saraiva
    Porto Alegre – RS | Mobile:  (51) 8174-7956
     

    2015-05-12 14:39 GMT-03:00 Rafael dos Santos Saraiva <rafaelsnsa@gmail.com>:

    Sorry, I forget to tell I tried, but not works.

    Context:
    context ivr_temp2 {
        s => {
            Proceeding();
            str_time_01 = '06:00-12:00|*|*|*';              // Manhã
            ifTime (${str_time_01}) {
    Playback(ura/bom_dia);
            }
        }
    }
    The error is showed on "ael reload".
    Console errors:
    rs0000sr304*CLI> ael reload
    Command 'ael reload' failed.
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:164 pbx_load_module: Starting AEL load process.
    [May 12 14:31:52] ERROR[20773]: ael.y:840 ael_yyerror: ==== File: /etc/asterisk/extensions.ael, Line 315, Cols: 32-32: Error: syntax error, unexpected ')', expecting '|'
    [May 12 14:31:52] NOTICE[20773]: pbx_ael.c:177 pbx_load_module: AEL load process: parsed config file name '/etc/asterisk/extensions.ael'.
    [May 12 14:31:52] ERROR[20773]: pbx_ael.c:197 pbx_load_module: Sorry, but 1 syntax errors and 0 semantic errors were detected. It doesn't make sense to compile.

    Sua Foto Rafael S. Saraiva
    Porto Alegre – RS | Mobile:  (51) 8174-7956
     

    2015-05-12 13:51 GMT-03:00 Tech Support <asterisk@voipbusiness.us>:

    You should try it and find out if it works. If it does, let us know.

    Regards;

    John

     

    From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Rafael dos Santos Saraiva
    Sent: Tuesday, May 12, 2015 11:58 AM
    To: Asterisk Users Mailing List – Non-Commercial Discussion
    Subject: [asterisk-users] AEL keyword IfTime with variable on time range

     

    Hi

     

    It's possible using a variable in the iftime keyword argument?

     

    E.g:

     

    context text {

     s => {

      timerange = '06:00-12:00|*|*|*';

      ifTime(${timerange} {

       Playback(ivr/goodbye);

      }

     }

    }

     

     

    thanks


     

    Image removed by sender. Sua Foto

    Rafael S. Saraiva

    Porto Alegre – RS | Mobile: Image removed by sender. (51) 8174-7956

    Image removed by sender. Image removed by sender.

     


    _____________________________________________________________________
    — Bandwidth and Colocation Provided by http://www.api-digital.com
    New to Asterisk? Join us for a live introductory webinar every Thurs:
                   http://www.asterisk.org/hello

    asterisk-users mailing list
    To UNSUBSCRIBE or update options visit:
       http://lists.digium.com/mailman/listinfo/asterisk-users

    –089e0122e6aa05a67c051601b42d